Constructor
new Frustum(left, right, bottom, top, near, far)
Constructs a frustum.
Parameters:
Name | Type | Description |
---|---|---|
left |
Plane | The frustum's left plane. |
right |
Plane | The frustum's right plane. |
bottom |
Plane | The frustum's bottom plane. |
top |
Plane | The frustum's top plane. |
near |
Plane | The frustum's near plane. |
far |
Plane | The frustum's far plane. |
- Source:
Throws:
-
If any specified plane is null or undefined.
- Type
- ArgumentError
Members
(readonly) bottom :Plane
This frustum's bottom plane.
Type:
- Source:
(readonly) far :Plane
This frustum's far plane.
Type:
- Source:
(readonly) left :Plane
This frustum's left plane.
Type:
- Source:
(readonly) near :Plane
This frustum's near plane.
Type:
- Source:
(readonly) right :Plane
This frustum's right plane.
Type:
- Source:
(readonly) top :Plane
This frustum's top plane.
Type:
- Source:
Methods
(static) fromProjectionMatrix(matrix) → {Frustum}
Extracts a frustum from a projection matrix.
This method assumes that the specified matrix represents a projection matrix. If it does not represent a projection matrix the results are undefined.
A projection matrix's view frustum is a Cartesian volume that contains everything visible in a scene displayed using that projection matrix.
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix | The projection matrix to extract the frustum from. |
- Source:
Throws:
-
If the specified matrix is null or undefined.
- Type
- ArgumentError
Returns:
A new frustum containing the projection matrix's view frustum, in eye coordinates.
- Type
- Frustum
(static) unitFrustum() → {Frustum}
Returns a new frustum with each of its planes 1 meter from the center.
- Source:
Returns:
The new frustum.
- Type
- Frustum
intersectsSegment(pointA, pointB) → {boolean}
Determines whether a line segment intersects this frustum.
Parameters:
Name | Type | Description |
---|---|---|
pointA |
Vec3 | One end of the segment. |
pointB |
Vec3 | The other end of the segment. |
- Source:
Throws:
-
If either point is null or undefined.
- Type
- ArgumentError
Returns:
true
if the segment intersects or is contained in this frustum,
otherwise false
.
- Type
- boolean
normalize() → {Frustum}
Normalizes the plane vectors of the planes composing this frustum.
- Source:
Returns:
This frustum with its planes normalized.
- Type
- Frustum
transformByMatrix(matrix) → {Frustum}
Transforms this frustum by a specified matrix.
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix | The matrix to apply to this frustum. |
- Source:
Throws:
-
If the specified matrix is null or undefined.
- Type
- ArgumentError
Returns:
This frustum set to its original value multiplied by the specified matrix.
- Type
- Frustum