Here’s an update on the physics debug visualization classes. I’ve converted to TypeScript, and toiled through quite a few errors. I’ve gone all-in on GreasedLineMesh, but not sure about the amount of perFrame updates on all the velocity and contact lines. Something was causing the WebGL context to be lost.
Although context loss seems to be gone at the moment, there are still weird freezes when there are lots of moving objects (about 3 seconds of smooth followed by 6 seconds of freeze, repeating). I’m testing with about 56 bouncing dice in a box. Here’s a preview with just a few.
-
DebugBodies - wireframe or boundingbox, active (green) inactive (red), center of mass, local axes, velocity linear
-
ContactLines - shows collision lines along the normal, scalable by impulse. Color indicates starting (red) or continuing (yellow).
-
ContactPoints - shows temporary dots (lasting 250 milliseconds) at contact points
/* Example usage: * new ContactLines({width:0.005,propertyName:"impulse",scale:2e6},hk,scene).enable(); * new ContactPoints({duration:1000,diameter:0.01},hk,scene).enable(); * new DebugBodies({}, hk, scene).enable(); * */ // example: // new DebugBodies({showAxes:true,velocityScale:.2,velocityLineWidth:0.01,},hk,scene).enable();