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. | |
getEyePoint(result?: Point3d): undefined | Point3d | Get the eye point - undefined if parallel projection | |
getFraction(): number | Get the ratio of the length of the diagonal of the front plane to the diagonal of the back plane. | |
getIntersectionWithPlane(plane: Plane3dByOriginAndUnitNormal): undefined | Point3d[] | Get a (convex) polygon that represents the intersection of this frustum with a plane, or undefined if no intersection exists | |
getRangePlanes(clipFront: boolean, clipBack: boolean, expandPlaneDistance: number): ConvexClipPlaneSet | Get a convex set of clipping planes bounding the region contained by this Frustum. | |
getRotation(result?: Matrix3d): undefined | Matrix3d | Get the rotation matrix to the frame of this frustum. | |
initFromRange(range: Readonly<WritableLowAndHighXY> | Readonly<WritableLowAndHighXYZ>): void | Initialize this Frustum from a Range | |
initNpc(): Frustum | 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. | |
scaleXYAboutCenter(scale: number): void | Scale this frustum's XY (viewing) plane about its center | |
setFrom(other: Frustum): void | Set the points of this Frustum to be copies of the points in another Frustum. | |
setFromCorners(corners: Point3d[]): void | Set the points of this frustum from array of corner points in NPC order. | |
toMap4d(): undefined | Map4d | 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: Readonly<WritableXYAndZ>): void | Offset all of the points of this Frustum by a vector. | |
fromRange(range: Readonly<WritableLowAndHighXY> | Readonly<WritableLowAndHighXYZ>, out?: Frustum): Frustum Static | Create a new Frustum from a Range3d |
Properties
Name | Type | Description | |
---|---|---|---|
frontCenter Accessor ReadOnly | Point3d | The point at the center of the front face of this frustum | |
hasMirror Accessor ReadOnly | boolean | Return true if this Frustum has a mirror (is not in the correct order.) | |
points Readonly | Point3d[] | Array of the 8 points of this Frustum. | |
rearCenter Accessor ReadOnly | Point3d | The point at the center of the rear face of this frustum |
Defined in
- core/common/src/Frustum.ts Line 75
Last Updated: 04 October, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.