PhysicsDebugBVH

@three-blocks/proPhysicsDebugWebGPUWebGL
new PhysicsDebugBVH(physics : Physics, options : Object)
Extends
THREE.Object3D

PhysicsDebugBVH - BVH debug overlay for physics bodies

Visualizes collision meshes and BVH helpers for all registered bodies. Extends THREE.Object3D - MUST be added to the scene to be visible.

Note: For dynamic/kinematic bodies, call update() every frame to keep transforms synced.

Constructor Parameters
The Physics instance to debug
optionsoptionalObject
Configuration options
  • enabledoptionalboolean
    Whether to start enabled
    Default is true.
  • autoSyncoptionalboolean
    Whether to auto-sync bodies
    Default is true.
  • syncIntervaloptionalnumber
    How often to sync bodies (ms)
    Default is 300.
Example
import { PhysicsDebugBVH } from '@three-blocks/pro';

// Create and add to scene (REQUIRED for visibility!)
const debugBVH = new PhysicsDebugBVH( physics, { enabled: true } );
scene.add( debugBVH );  // <-- Don't forget this!

function animate() {
  debugBVH.update();  // Sync transforms for moving bodies
  renderer.render( scene, camera );
}