Box3
new Box3(min?: Vector3, max?: Vector3)THREE equivalent: THREE.Box3
3D axis-aligned bounding box. Used for frustum culling, raycasting, and bounding-volume tests.
Differs from THREE.js
Uses British spelling: centre/getCentre instead of center/getCenter.
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
min |
Vector3 |
Lower corner. |
max |
Vector3 |
Upper corner. |
centre |
Vector3 |
Center point (read-only getter). |
size |
Vector3 |
Width/height/depth (read-only getter). |
isEmpty |
boolean |
True if the box has no volume (read-only). |
Methods
Section titled “Methods”| Method | Description |
|---|---|
setFromObject(object: Node): this |
Computes the box from a scene object’s geometry. |
setFromPoints(points: Vector3[]): this |
Computes the box enclosing all points. |
expandByPoint(point: Vector3): this |
Expands the box to include the point. |
containsPoint(point: Vector3): boolean |
Returns true if the point is inside the box. |
intersectsBox(box: Box3): boolean |
Returns true if the boxes overlap. |
intersectsSphere(sphere: Sphere): boolean |
Returns true if the box intersects the sphere. |
clone(): Box3 |
Returns a new Box3 with the same bounds. |