Class BoundingSphere
Constructors
constructor
-
new BoundingSphere(
min: DeepImmutable<Vector3>,
max: DeepImmutable<Vector3>,
worldMatrix?: DeepImmutableObject<Matrix>,
): BoundingSphereCreates a new bounding sphere
Parameters
- min: DeepImmutable<Vector3>
defines the minimum vector (in local space)
- max: DeepImmutable<Vector3>
defines the maximum vector (in local space)
OptionalworldMatrix: DeepImmutableObject<Matrix>defines the new world matrix
Returns BoundingSphere
- min: DeepImmutable<Vector3>
Properties
Readonlycenter
Gets the center of the bounding sphere in local space
Readonlycenter World
Gets the center of the bounding sphere in world space
Readonlymaximum
Gets the maximum vector in local space
Readonlyminimum
Gets the minimum vector in local space
radius
Radius of the bounding sphere in local space
radius World
Radius of the bounding sphere in world space
Methods
get World Matrix
intersects Point
-
Tests if a point is inside the bounding sphere
Parameters
- point: DeepImmutable<Vector3>
defines the point to test
Returns boolean
true if the point is inside the bounding sphere
- point: DeepImmutable<Vector3>
is Center In Frustum
-
Tests if the bounding sphere center is in between the frustum planes. Used for optimistic fast inclusion.
Parameters
- frustumPlanes: DeepImmutableObject<Plane>[]
defines the frustum planes to test
Returns boolean
true if the sphere center is in between the frustum planes
- frustumPlanes: DeepImmutableObject<Plane>[]
is In Frustum
-
Tests if the bounding sphere is intersecting the frustum planes
Parameters
- frustumPlanes: DeepImmutableObject<Plane>[]
defines the frustum planes to test
Returns boolean
true if there is an intersection
- frustumPlanes: DeepImmutableObject<Plane>[]
re Construct
-
reConstruct(
min: DeepImmutable<Vector3>,
max: DeepImmutable<Vector3>,
worldMatrix?: DeepImmutableObject<Matrix>,
): voidRecreates the entire bounding sphere 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 sphere by applying a scale factor
Parameters
- factor: number
defines the scale factor to apply
Returns BoundingSphere
the current bounding box
- factor: number
StaticCreate From Center And Radius
-
CreateFromCenterAndRadius(
center: DeepImmutable<Vector3>,
radius: number,
matrix?: DeepImmutableObject<Matrix>,
): BoundingSphereCreates a sphere from a center and a radius
Parameters
- center: DeepImmutable<Vector3>
The center
- radius: number
radius
Optionalmatrix: DeepImmutableObject<Matrix>Optional worldMatrix
Returns BoundingSphere
The sphere
- center: DeepImmutable<Vector3>
StaticIntersects
-
Intersects(
sphere0: DeepImmutable<BoundingSphere>,
sphere1: DeepImmutable<BoundingSphere>,
): booleanChecks if two sphere intersect
Parameters
- sphere0: DeepImmutable<BoundingSphere>
sphere 0
- sphere1: DeepImmutable<BoundingSphere>
sphere 1
Returns boolean
true if the spheres intersect
- sphere0: DeepImmutable<BoundingSphere>
Class used to store bounding sphere information