mesh.getBoundingBox

Section: Mesh (Babylon)

What it does

mesh.getBoundingBox reads BoundingBox on a mesh object. It takes id, and answers {min, max, center}.

Signature

mesh.getBoundingBox(id) → {min, max, center}

Arguments

  • id

Example · generated

function update(dt) {  mesh.createBox('box', { size: 1 });  const result = mesh.getBoundingBox('box');}

mesh.createBox is there to give the call something to act on; mesh.getBoundingBox is the line that matters. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

20 members in mesh