Search in sources :

Example 6 with Mat4

use of org.asassecreations.engine.math.vector.Mat4 in project Voxel_Game by ASasseCreations.

the class BlockRaycast method worldSpace.

private static final Vec3 worldSpace(final Vec4 eye) {
    final Mat4 intertedView = Mat4.invert(GameCamera.view, null);
    final Vec4 world = Mat4.transform(intertedView, eye, null);
    final Vec3 ray = new Vec3(world.x, world.y, world.z);
    ray.normalise();
    return ray;
}
Also used : Mat4(org.asassecreations.engine.math.vector.Mat4) Vec3(org.asassecreations.engine.math.vector.Vec3) Vec4(org.asassecreations.engine.math.vector.Vec4)

Aggregations

Mat4 (org.asassecreations.engine.math.vector.Mat4)6 Vec3 (org.asassecreations.engine.math.vector.Vec3)4 Vec4 (org.asassecreations.engine.math.vector.Vec4)2