-
Notifications
You must be signed in to change notification settings - Fork 0
Frustum Culling
ExodusCoder9 edited this page Jun 20, 2026
·
1 revision
FrustumIntersection extracts 6 frustum planes from a projection-view matrix and tests AABBs, spheres, and points against them.
// OpenGL clip space (z=[-1,1]) — default
FrustumIntersection frustum = new FrustumIntersection();
// Vulkan clip space (z=[0,1])
FrustumIntersection frustum = new FrustumIntersection(true);
Update
frustum.set(projectionViewMatrix); // pass Matrix4f
Tests
// AABB test — returns INSIDE, INTERSECT, or OUTSIDE
FrustumIntersection.Intersection result = frustum.intersects(aabb);
// Sphere test — returns same enum
FrustumIntersection.Intersection result = frustum.intersects(sphere);
// Point test — returns boolean
boolean visible = frustum.intersects(point);
Access Planes
Plane p = frustum.plane(0); // left, right, bottom,