15 lines
325 B
Java
15 lines
325 B
Java
package speiger.src.coreengine.rendering.input.raycast;
|
|
|
|
import speiger.src.coreengine.math.vector.floats.Vec3f;
|
|
|
|
public record Ray(Vec3f start, Vec3f end)
|
|
{
|
|
public Vec3f interpolate(float progress) {
|
|
return start.lerp(end, progress, Vec3f.ZERO);
|
|
}
|
|
|
|
public Vec3f distance() {
|
|
return end.asMutable().sub(start);
|
|
}
|
|
}
|