For example, Ammo.js has the DebugDrawer class to draw colliders. Has Babylon.js the build-in functionality for drawing colliders?
1 Like
Can I use it from code, without editor?
The inspector is using this code:
const physicsViewer = new PhysicsViewer(scene);
for (var mesh of scene.meshes) {
if (mesh.physicsImpostor) {
let debugMesh = physicsViewer.showImpostor(mesh.physicsImpostor, mesh as Mesh);
}
}
1 Like
I created an array of boxes and set positions to them in debugDrawer.drawLine = (from, to, color) => {}
. I run Ammo.js separately like it made in Three.js in this tutorial: Intro to JavaScript 3D Physics using Ammo.js and Three.js | by Blue Magnificent | Medium
2 Likes
I solved but with built-in features of pure Ammo.js. I cannot find how to draw colliders from text (without Babylon.js editor).