Skip to content

Documentation / base / Frustum

Class: Frustum ​

Defined in: libs/base/src/math/frustum.ts:27

The frustum class

Constructors ​

Constructor ​

new Frustum(transform): Frustum

Defined in: libs/base/src/math/frustum.ts:44

Creates a frustum from the tranform matrix.

Parameters ​

transform ​

Matrix4x4

The transform matrix

Returns ​

Frustum

Constructor ​

new Frustum(other): Frustum

Defined in: libs/base/src/math/frustum.ts:49

Creates a frustum initialized with an existing frustum.

Parameters ​

other ​

Frustum

The frustum to copy from.

Returns ​

Frustum

Properties ​

CORNER_LEFT_TOP_NEAR ​

readonly static CORNER_LEFT_TOP_NEAR: 0 = 0b000

Defined in: libs/base/src/math/frustum.ts:28


CORNER_LEFT_TOP_FAR ​

readonly static CORNER_LEFT_TOP_FAR: 1 = 0b001

Defined in: libs/base/src/math/frustum.ts:29


CORNER_LEFT_BOTTOM_NEAR ​

readonly static CORNER_LEFT_BOTTOM_NEAR: 2 = 0b010

Defined in: libs/base/src/math/frustum.ts:30


CORNER_LEFT_BOTTOM_FAR ​

readonly static CORNER_LEFT_BOTTOM_FAR: 3 = 0b011

Defined in: libs/base/src/math/frustum.ts:31


CORNER_RIGHT_TOP_NEAR ​

readonly static CORNER_RIGHT_TOP_NEAR: 4 = 0b100

Defined in: libs/base/src/math/frustum.ts:32


CORNER_RIGHT_TOP_FAR ​

readonly static CORNER_RIGHT_TOP_FAR: 5 = 0b101

Defined in: libs/base/src/math/frustum.ts:33


CORNER_RIGHT_BOTTOM_NEAR ​

readonly static CORNER_RIGHT_BOTTOM_NEAR: 6 = 0b110

Defined in: libs/base/src/math/frustum.ts:34


CORNER_RIGHT_BOTTOM_FAR ​

readonly static CORNER_RIGHT_BOTTOM_FAR: 7 = 0b111

Defined in: libs/base/src/math/frustum.ts:35

Accessors ​

planes ​

Get Signature ​

get planes(): readonly Readonly<{[key: number]: number; a: number; b: number; c: number; d: number; px: number; py: number; pz: number; nx: number; ny: number; nz: number; assign: Plane; setEquation: Plane; initWithOriginNormal: Plane; initWithPoints: Plane; distanceToPoint: number; nearestPointToPoint: Vector3; getNormal: Vector3; inplaceFlip: Plane; inplaceNormalize: Plane; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; }>[]

Defined in: libs/base/src/math/frustum.ts:61

Get the frustum planes.

Returns ​

readonly Readonly<{[key: number]: number; a: number; b: number; c: number; d: number; px: number; py: number; pz: number; nx: number; ny: number; nz: number; assign: Plane; setEquation: Plane; initWithOriginNormal: Plane; initWithPoints: Plane; distanceToPoint: number; nearestPointToPoint: Vector3; getNormal: Vector3; inplaceFlip: Plane; inplaceNormalize: Plane; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; }>[]


corners ​

Get Signature ​

get corners(): readonly Readonly<{[key: number]: number; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; clone: Vector3; x: number; y: number; z: number; magnitude: number; magnitudeSq: number; xy: Vector2; setXYZ: Vector3; setAndNormalize: Vector3; subBy: Vector3; addBy: Vector3; combineBy: Vector3; mulBy: Vector3; divBy: Vector3; scaleBy: Vector3; inplaceNormalize: Vector3; inplaceInverse: Vector3; inplaceMin: Vector3; inplaceMax: Vector3; }>[]

Defined in: libs/base/src/math/frustum.ts:67

Get the corner points.

Returns ​

readonly Readonly<{[key: number]: number; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; clone: Vector3; x: number; y: number; z: number; magnitude: number; magnitudeSq: number; xy: Vector2; setXYZ: Vector3; setAndNormalize: Vector3; subBy: Vector3; addBy: Vector3; combineBy: Vector3; mulBy: Vector3; divBy: Vector3; scaleBy: Vector3; inplaceNormalize: Vector3; inplaceInverse: Vector3; inplaceMin: Vector3; inplaceMax: Vector3; }>[]

Methods ​

getCorner() ​

getCorner(pos): Readonly<{[key: number]: number; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; clone: Vector3; x: number; y: number; z: number; magnitude: number; magnitudeSq: number; xy: Vector2; setXYZ: Vector3; setAndNormalize: Vector3; subBy: Vector3; addBy: Vector3; combineBy: Vector3; mulBy: Vector3; divBy: Vector3; scaleBy: Vector3; inplaceNormalize: Vector3; inplaceInverse: Vector3; inplaceMin: Vector3; inplaceMax: Vector3; }>

Defined in: libs/base/src/math/frustum.ts:90

Get the point of a given corner.

Parameters ​

pos ​

number

The corner index.

Returns ​

Readonly<{[key: number]: number; equalsTo: boolean; toString: string; isNaN: boolean; setRandom: void; clone: Vector3; x: number; y: number; z: number; magnitude: number; magnitudeSq: number; xy: Vector2; setXYZ: Vector3; setAndNormalize: Vector3; subBy: Vector3; addBy: Vector3; combineBy: Vector3; mulBy: Vector3; divBy: Vector3; scaleBy: Vector3; inplaceNormalize: Vector3; inplaceInverse: Vector3; inplaceMin: Vector3; inplaceMax: Vector3; }>

The point of given corner

Remarks ​

The possible values of argument 'pos' are:

  • [Frustum.CORNER\_LEFT\_TOP\_NEAR](#corner-left-top-near)
  • [Frustum.CORNER\_LEFT\_TOP\_FAR](#corner-left-top-far)
  • [Frustum.CORNER\_RIGHT\_BOTTOM\_FAR](#corner-right-bottom-far)
  • [Frustum.CORNER\_RIGHT\_BOTTOM\_NEAR](#corner-right-bottom-near)
  • [Frustum.CORNER\_LEFT\_BOTTOM\_NEAR](#corner-left-bottom-near)
  • [Frustum.CORNER\_LEFT\_BOTTOM\_FAR](#corner-left-bottom-far)
  • [Frustum.CORNER\_RIGHT\_BOTTOM\_FAR](#corner-right-bottom-far)
  • [Frustum.CORNER\_RIGHT\_BOTTOM\_NEAR](#corner-right-bottom-near)

containsPoint() ​

containsPoint(pt, epsl?): boolean

Defined in: libs/base/src/math/frustum.ts:99

Tests if a point is inside the frustum.

Parameters ​

pt ​

Vector3

The point to test.

epsl? ​

number = 1e-6

Returns ​

boolean

true if the point is inside the frustum, otherwise false


initWithMatrix() ​

initWithMatrix(transform): Frustum

Defined in: libs/base/src/math/frustum.ts:112

Initialize the frustum by given model-view matrix

Parameters ​

transform ​

Matrix4x4

Model-view matrix used to initialize the frustum

Returns ​

Frustum

self

Released under the MIT License.