Frustum Class

The region of physical (3d) space that appears in a view. It forms the field-of-view of a camera. It is stored as 8 points, in Npc order, that must define a truncated pyramid.

Methods

Name Description
constructor(): Frustum Constructor for Frustum.  
clone(result?: Frustum): Frustum Make a copy of this Frustum.  
distance(corner1: number, corner2: number): number Get the distance between two corners of this Frustum.  
equals(rhs: Frustum): boolean Return true if this Frustum is equal to another Frustum  
fixPointOrder(): void Make sure the frustum point order does not include mirroring.  
getCenter(): Point3d Get the point at the center of this Frustum (halfway between RightTopFront and LeftBottomRear.  
getCorner(i: number): Point3d Get a corner Point from this Frustum.  
getFraction(): number Get the ratio of the length of the diagonal of the front plane to the diagonal of the back plane.  
getRangePlanes(clipFront: boolean, clipBack: boolean, expandPlaneDistance: number): ConvexClipPlaneSet Get a convex set of clipping planes bounding the region contained by this Frustum.  
initFromRange(range: LowAndHighXYZ | LowAndHighXY): void Initialize this Frustum from a Range  
initNpc(): this Initialize this Frustum to the 8 corners of the NPC cube.  
invalidate(): void Invalidate this Frustum by setting all 8 points to zero.  
isSame(other: Frustum): boolean Return true if all of the points in this Frustum are almost the same as the points in another Frustum.  
multiply(trans: Transform): void Multiply all the points of this Frustum by a Transform, in place.  
scaleAboutCenter(scale: number): void Scale this Frustum, in place, about its center by a scale factor.  
setFrom(other: Frustum): void Set the points of this Frustum to be copies of the points in another Frustum.  
toMap4d(): Map4d | undefined Create a Map4d that converts world coordinates to/from Npc coordinates of this Frustum.  
toRange(range?: Range3d): Range3d Calculate a bounding range from the 8 points in this Frustum.  
transformBy(trans: Transform, result?: Frustum): Frustum Transform all the points of this Frustum and return the result in another Frustum.  
translate(offset: XYAndZ): void Offset all of the points of this Frustum by a vector.  
fromRange(range: LowAndHighXYZ | LowAndHighXY, out?: Frustum): Frustum Static Create a new Frustum from a Range3d  

Properties

Name Type Description
hasMirror Accessor ReadOnly boolean Return true if this Frustum has a mirror (is not in the correct order.)  
points Point3d[] Array of the 8 points of this Frustum.  

Defined in

Last Updated: 13 June, 2024