Constructor
new Frustum(options)
| Name | Type | Description |
|---|---|---|
options | * |
- Source
Methods
containsBox(box) → {boolean}
Returns true if the box intersects or is inside the frustum.
| Name | Type | Description |
|---|---|---|
box | Box | Bounding box. |
- Source
true when the box is not fully outside.
- Type:
- boolean
containsPoint(point) → {boolean}
Returns true if the point is inside the frustum.
| Name | Type | Description |
|---|---|---|
point | Vec3 | Cartesian point. |
- Source
true when the point is inside.
- Type:
- boolean
containsSphere(sphere) → {boolean}
Returns true if the sphere is inside the frustum.
| Name | Type | Description |
|---|---|---|
sphere | Sphere | Bounding sphere. |
- Source
true when the sphere is inside.
- Type:
- boolean
containsSphere2(center, radius) → {boolean}
Returns true if the sphere is inside the frustum.
| Name | Type | Description |
|---|---|---|
center | Vec3 | Sphere center. |
radius | number | Sphere radius. |
- Source
true when the sphere is inside.
- Type:
- boolean
containsSphereBottomExc(sphere) → {boolean}
Returns true if the sphere is inside the frustum, ignoring the bottom plane.
| Name | Type | Description |
|---|---|---|
sphere | Sphere | Bounding sphere. |
- Source
true when the sphere passes all checked planes.
- Type:
- boolean
containsSphereButtom(sphere) → {boolean}
Checks sphere intersection with the bottom frustum plane only.
| Name | Type | Description |
|---|---|---|
sphere | Sphere | Bounding sphere. |
- Source
true when the sphere is not clipped by the bottom plane.
- Type:
- boolean
getBackwardPlane() → {NumberArray4}
Returns backward clipping plane.
- Source
Backward clipping plane coefficients.
- Type:
- NumberArray4
getBottomPlane() → {NumberArray4}
Returns bottom clipping plane.
- Source
Bottom clipping plane coefficients.
- Type:
- NumberArray4
getForwardPlane() → {NumberArray4}
Returns forward clipping plane.
- Source
Forward clipping plane coefficients.
- Type:
- NumberArray4
getInverseProjectionMatrix() → {NumberArray16}
Returns inverse projection matrix.
- Source
Inverse projection matrix values.
- Type:
- NumberArray16
getLeftPlane() → {NumberArray4}
Returns left clipping plane.
- Source
Left clipping plane coefficients.
- Type:
- NumberArray4
getProjectionMatrix() → {NumberArray16}
Returns projection matrix.
- Source
Projection matrix values.
- Type:
- NumberArray16
getProjectionViewMatrix() → {NumberArray16}
Returns projection-view matrix.
- Source
Projection-view matrix values.
- Type:
- NumberArray16
getProjectionViewRTEMatrix() → {NumberArray16}
Returns projection-view RTE matrix.
- Source
Projection-view RTE matrix values.
- Type:
- NumberArray16
getRightPlane() → {NumberArray4}
Returns right clipping plane.
- Source
Right clipping plane coefficients.
- Type:
- NumberArray4
getTopPlane() → {NumberArray4}
Returns top clipping plane.
- Source
Top clipping plane coefficients.
- Type:
- NumberArray4
setNearFar(near, faropt)
Updates near and far clipping planes.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
near | number | Near clipping plane distance. | ||
far | number | <optional> | this.far | Far clipping plane distance. |
- Source
setProjectionMatrix(viewAngle, aspect, near, far, isOrthographicopt, focusDistanceopt, reverseDepthopt, depthZeroToOneopt)
Sets up camera projection matrix.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
viewAngle | number | Camera vertical field of view angle in degrees. | ||
aspect | number | Viewport aspect ratio ( | ||
near | number | Near clipping plane distance. | ||
far | number | Far clipping plane distance. | ||
isOrthographic | boolean | <optional> | false | Enables orthographic projection mode. |
focusDistance | number | <optional> | 10 | Reference distance used to compute orthographic frustum size. |
reverseDepth | boolean | <optional> | false | Enables reverse-Z infinite perspective projection. |
depthZeroToOne | boolean | <optional> | false | Uses |
- Source
setProjectionViewRTEMatrix(viewRTEMatrix)
Updates projection-view RTE matrix.
| Name | Type | Description |
|---|---|---|
viewRTEMatrix | Mat4 | View matrix in RTE coordinates. |
- Source
setViewMatrix(viewMatrix)
Camera's projection matrix values.
| Name | Type | Description |
|---|---|---|
viewMatrix | Mat4 | View matrix. |
- Source