Frustum

Math.Frustum exported from @manycore/aholo-viewer.

Math Class

Constructors

Constructor

new Frustum(p0?, p1?, p2?, p3?, p4?, p5?): Frustum

Parameters

p0?

Plane

p1?

Plane

p2?

Plane

p3?

Plane

p4?

Plane

p5?

Plane

Returns

Frustum

Properties

planes

planes: Plane[]

Array of 6 planes.


corners

corners: Vector3[]

The eight vertex’s position of frustum

Methods

set()

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

Sets the frustum from the passed planes. No plane order is implied. Note that this method only copies the values from the given objects.

Parameters

p0

Plane

p1

Plane

p2

Plane

p3

Plane

p4

Plane

p5

Plane

Returns

Frustum


clone()

clone(): Frustum

Return a new Frustum with the same parameters as this one.

Returns

Frustum


copy()

copy(frustum): Frustum

Copies the properties of the passed frustum into this one.

Parameters

frustum

Frustum

The frustum to copy.

Returns

Frustum


getCorners()

getCorners(): Vector3[]

Return the corners.

Returns

Vector3[]


setFromMatrix()

setFromMatrix(m): Frustum

Sets the frustum by a transform matrix.

Parameters

m

Matrix4

Returns

Frustum


intersectsObject()

intersectsObject(object): boolean

Checks whether the object’s BufferGeometry.boundingSphere| bounding is intersecting the frustum. Note that the object must have a BufferGeometry| geometry so that the bounding sphere can be calculated.

Parameters

object

Object3D

Returns

boolean


intersectsSprite()

intersectsSprite(sprite): boolean

Checks whether the sprite is intersecting the frustum.

Parameters

sprite

Sprite

Returns

boolean


intersectsSphere()

intersectsSphere(sphere): boolean

Return true if sphere intersects with this frustum.

Parameters

sphere

Sphere

Sphere to check for intersection.

Returns

boolean


intersectsBox()

intersectsBox(box): boolean

Return true if box intersects with this frustum.

Parameters

box

Box3

Box3 to check for intersection.

Returns

boolean


containsPoint()

containsPoint(point): boolean

Checks to see if the frustum contains the point.

Parameters

point

Vector3

Vector3 to test.

Returns

boolean


getCameraClosestDistanceFromBoxes()

getCameraClosestDistanceFromBoxes(camera, boxes): number

Return a value to represent the closest distance between camera and box, if there are any part of bos inside the frustum.

Parameters

camera

PerspectiveCamera

boxes

Box3[]

Returns

number