Home Reference Source
import {Frustum} from 'math-ds'
public class | source

Frustum

A frustum.

Constructor Summary

Public Constructor
public

constructor(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane)

Constructs a new frustum.

Member Summary

Public Members
public

The six planes that form the frustum.

Method Summary

Public Methods
public

Clones this frustum.

public

Checks if this frustum contains the given point.

public

copy(frustum: Frustum): Frustum

Copies a given frustum.

public

Checks if this frustum intersects with the given sphere.

public

Checks if this frustum intersects with the given sphere.

public

set(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane): Frustum

Sets the planes of this frustum.

public
this method was deprecated. Use setFromPerspectiveMatrix instead.

Sets this frustum based on a given projection matrix.

public

Sets this frustum based on a given projection matrix.

Public Constructors

public constructor(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane) source

Constructs a new frustum.

Params:

NameTypeAttributeDescription
p0 Plane
  • optional

A plane.

p1 Plane
  • optional

A plane.

p2 Plane
  • optional

A plane.

p3 Plane
  • optional

A plane.

p4 Plane
  • optional

A plane.

p5 Plane
  • optional

A plane.

Public Members

public planes: Plane[] source

The six planes that form the frustum.

Public Methods

public clone(): Frustum source

Clones this frustum.

Return:

Frustum

The cloned frustum.

public containsPoint(point: Vector3): Boolean source

Checks if this frustum contains the given point.

Params:

NameTypeAttributeDescription
point Vector3

A point.

Return:

Boolean

Whether this frustum contains the point.

public copy(frustum: Frustum): Frustum source

Copies a given frustum.

Params:

NameTypeAttributeDescription
frustum Frustum

A frustum.

Return:

Frustum

This frustum.

public intersectsBox(box: Box3): Boolean source

Checks if this frustum intersects with the given sphere.

Params:

NameTypeAttributeDescription
box Box3

A box.

Return:

Boolean

Whether this frustum intersects with the box.

public intersectsSphere(sphere: Sphere): Boolean source

Checks if this frustum intersects with the given sphere.

Params:

NameTypeAttributeDescription
sphere Sphere

A sphere.

Return:

Boolean

Whether this frustum intersects with the sphere.

public set(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane): Frustum source

Sets the planes of this frustum.

Params:

NameTypeAttributeDescription
p0 Plane
  • optional

A plane.

p1 Plane
  • optional

A plane.

p2 Plane
  • optional

A plane.

p3 Plane
  • optional

A plane.

p4 Plane
  • optional

A plane.

p5 Plane
  • optional

A plane.

Return:

Frustum

This frustum.

public setFromMatrix(m: Matrix4): Frustum source

this method was deprecated. Use setFromPerspectiveMatrix instead.

Sets this frustum based on a given projection matrix.

Params:

NameTypeAttributeDescription
m Matrix4

A matrix.

Return:

Frustum

This frustum.

public setFromProjectionMatrix(m: Matrix4): Frustum source

Sets this frustum based on a given projection matrix.

Params:

NameTypeAttributeDescription
m Matrix4

A matrix.

Return:

Frustum

This frustum.