Class BoundingInfo
Implements
Constructors
constructor
-
new BoundingInfo(
minimum: DeepImmutable<Vector3>,
maximum: DeepImmutable<Vector3>,
worldMatrix?: DeepImmutableObject<Matrix>,
): BoundingInfoConstructs bounding info
Parameters
- minimum: DeepImmutable<Vector3>
min vector of the bounding box/sphere
- maximum: DeepImmutable<Vector3>
max vector of the bounding box/sphere
OptionalworldMatrix: DeepImmutableObject<Matrix>defines the new world matrix
Returns BoundingInfo
- minimum: DeepImmutable<Vector3>
Properties
Readonlybounding Box
Bounding box for the mesh
Readonlybounding Sphere
Bounding sphere for the mesh
Accessors
diagonal Length
-
get diagonalLength(): number
Gets the world distance between the min and max points of the bounding box
Returns number
is Locked
-
get isLocked(): boolean
If the info is locked and won't be updated to avoid perf overhead
Returns boolean
-
set isLocked(value: boolean): void
Parameters
- value: boolean
Returns void
maximum
-
max vector of the bounding box/sphere
Returns Vector3
minimum
-
min vector of the bounding box/sphere
Returns Vector3
Methods
center On
-
Recreate the bounding info to be centered around a specific point given a specific extend.
Parameters
- center: DeepImmutable<Vector3>
New center of the bounding info
- extend: DeepImmutable<Vector3>
New extend of the bounding info
Returns BoundingInfo
the current bounding info
- center: DeepImmutable<Vector3>
encapsulate
-
Grows the bounding info to include the given point.
Parameters
- point: Vector3
The point that will be included in the current bounding info (in local space)
Returns BoundingInfo
the current bounding info
- point: Vector3
encapsulate Bounding Info
-
Grows the bounding info to encapsulate the given bounding info.
Parameters
- toEncapsulate: BoundingInfo
The bounding info that will be encapsulated in the current bounding info
Returns BoundingInfo
the current bounding info
- toEncapsulate: BoundingInfo
intersects
-
Checks if another bounding info intersects the bounding box and bounding sphere or the mesh
Parameters
- boundingInfo: DeepImmutable<BoundingInfo>
the bounding info to check intersection with
- precise: boolean
if the intersection should be done using OBB
Returns boolean
if the bounding info intersects
- boundingInfo: DeepImmutable<BoundingInfo>
intersects Point
-
Checks if a point is inside the bounding box and bounding sphere or the mesh
Parameters
- point: DeepImmutable<Vector3>
the point to check intersection with
Returns boolean
if the point intersects
- point: DeepImmutable<Vector3>
is Completely In Frustum
-
Checks if a cullable object (mesh...) is in the camera frustum Unlike isInFrustum this checks the full bounding box
Parameters
- frustumPlanes: DeepImmutableObject<Plane>[]
Camera near/planes
Returns boolean
true if the object is in frustum otherwise false
- frustumPlanes: DeepImmutableObject<Plane>[]
is In Frustum
-
Returns
trueif the bounding info is within the frustum defined by the passed array of planes.Parameters
- frustumPlanes: DeepImmutableObject<Plane>[]
defines the frustum to test
- strategy: number = Constants.MESHES_CULLINGSTRATEGY_STANDARD
defines the strategy to use for the culling (default is BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD) The different strategies available are:
- BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD most accurate but slower
Returns boolean
true if the bounding info is in the frustum planes
- frustumPlanes: DeepImmutableObject<Plane>[]
re Construct
-
reConstruct(
min: DeepImmutable<Vector3>,
max: DeepImmutable<Vector3>,
worldMatrix?: DeepImmutableObject<Matrix>,
): voidRecreates the entire bounding info from scratch as if we call the constructor in place
Parameters
- min: DeepImmutable<Vector3>
defines the new minimum vector (in local space)
- max: DeepImmutable<Vector3>
defines the new maximum vector (in local space)
OptionalworldMatrix: DeepImmutableObject<Matrix>defines the new world matrix
Returns void
- min: DeepImmutable<Vector3>
scale
-
Scale the current bounding info by applying a scale factor
Parameters
- factor: number
defines the scale factor to apply
Returns BoundingInfo
the current bounding info
- factor: number
update
-
Updates the bounding sphere and box
Parameters
- world: DeepImmutable<Matrix>
world matrix to be used to update
Returns void
- world: DeepImmutable<Matrix>
Info for a bounding data of a mesh