Capítulo 319 de 859

Chapter 319: Box3Helper

Core Idea

A helper object to visualize an instance of Box3.

Key Concepts

  • box : Box3: The box being visualized.

Code Examples

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 )
  • What it demonstrates: Typical usage of Box3Helper.

Reference Tables

Constructor

Signature
`new Box3Helper( box : Box3, color : number

Properties

PropertyDescription
.box : Box3The box being visualized.

Methods

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

Key Takeaways

  1. Box3Helper extends: EventDispatcher → Object3D → Line → LineSegments
  2. Most relevant properties: box.
  3. Key methods: dispose.

Connects To

  • EventDispatcher: parent class
  • Object3D: parent class
  • Line: parent class
  • LineSegments: parent class
  • Source: src/helpers/Box3Helper.js