Skip to main content

Object3DLineLineSegments

Box3Helper

Helper object to visualize a Box3.

Code Example

const box = new THREE.Box3(); box.setFromCenterAndSize( new THREE.Vector3( 1,
1, 1 ), new THREE.Vector3( 2, 1, 3 ) ); const helper = new THREE.Box3Helper(
box, 0xffff00 ); scene.add( helper );

Constructor

Box3Helper

function Box3Helper( box: Box3, color: Color ): void;  

box -- the Box3 to show.
color -- (optional) the box's color. Default is 0xffff00.

Creates a new wireframe box that represents the passed Box3.

Properties

See the base LineSegments class for common properties.

box

box: Box3;  

The Box3 being visualized.

Methods

See the base LineSegments class for common methods.

updateMatrixWorld

function updateMatrixWorld( force: Boolean ): undefined;  

This overrides the method in the base Object3D class so that it also updates the wireframe box to the extent of the .box property.

dispose

function dispose( ): undefined;  

Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

Source

src/helpers/Box3Helper.js