kick.math.Frustum Class
Frustum represented as 6 line equations (ax+by+c*z+d=0 , where [a,b,c] is the normal of the plane). Note the normals of the frustum points inwards. The order of the planes are left, right, top, bottom, near, far The implementation is based on "Fast Extraction of Viewing Frustum Planes from the WorldView-Projection Matrix" by Gil Grib and Klaus Hartmann http://www.cs.otago.ac.nz/postgrads/alexis/planeExtraction.pdf
Item Index
Methods
- create static
- extractPlanes static
- intersectAabb static
Properties
- INSIDE static
- INTERSECTING static
- OUTSIDE static
Methods
create
()
static
Create a array of 24. 6 line equations (ax+by+c*z+d=0 , where [a,b,c] is the normal of the plane).
extractPlanes
(
Array_24
static
-
out
-
modelViewMatrix
-
normalize
Parameters:
-
out
Array_24 -
modelViewMatrix
kick.math.Mat4 -
normalize
Booleannormalize plane normal
Returns:
Array_24:
out
intersectAabb
(
Number
static
-
frustumPlanes
-
aabbIn
Based on [Akenine-Moller's Real-Time Rendering 3rd Ed] chapter 16.14.3
Parameters:
-
frustumPlanes
kick.math.Frustum -
aabbIn
kick.math.Aabb
Returns:
Number:
frustum.OUTSIDE = outside(0), frustum.INSIDE = inside(1), frustum.INTERSECTING = intersecting(2)
Properties
INSIDE
Number
static
Value = 1
INTERSECTING
Number
static
Value = 2
OUTSIDE
Number
static
Value = 0