package speiger.src.coreengine.rendering.input.raycast;

import speiger.src.coreengine.math.vector.floats.Vec3f;

public class Ray
{
	protected Vec3f start;
	protected Vec3f end;
	
	public Ray(Vec3f start, Vec3f end)
	{
		this.start = start.asImmutable();
		this.end = end.asImmutable();
	}
	
	public Vec3f getStart()
	{
		return start;
	}
	
	public Vec3f getEnd()
	{
		return end;
	}
	
	public Vec3f interpolate(float progress)
	{
		return start.lerp(end, progress, Vec3f.ZERO);
	}
	
	public Vec3f distance()
	{
		return end.asMutable().sub(start);
	}
}
