Skip to content

Documentation / base / Frustum

Class: Frustum

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

The frustum class

Constructors

Constructor

new Frustum(transform): Frustum

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

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:44

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:23


CORNER_LEFT_TOP_FAR

readonly static CORNER_LEFT_TOP_FAR: 1 = 0b001

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


CORNER_LEFT_BOTTOM_NEAR

readonly static CORNER_LEFT_BOTTOM_NEAR: 2 = 0b010

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


CORNER_LEFT_BOTTOM_FAR

readonly static CORNER_LEFT_BOTTOM_FAR: 3 = 0b011

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


CORNER_RIGHT_TOP_NEAR

readonly static CORNER_RIGHT_TOP_NEAR: 4 = 0b100

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


CORNER_RIGHT_TOP_FAR

readonly static CORNER_RIGHT_TOP_FAR: 5 = 0b101

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


CORNER_RIGHT_BOTTOM_NEAR

readonly static CORNER_RIGHT_BOTTOM_NEAR: 6 = 0b110

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


CORNER_RIGHT_BOTTOM_FAR

readonly static CORNER_RIGHT_BOTTOM_FAR: 7 = 0b111

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

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:56

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:62

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:85

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:94

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:107

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.