Three.js 018Physics

Summary

  • Simple physics demo using cannon (npm install --save cannon)
  • CANNON.World, CANNON.SAPBroadphase, world.gravity, CANNON.Material, friction, restitution (bounce), addContactMaterial, and world.step in animation loop
  • Two controls in dat.GUI can be used to spawn additional boxes and spheres
  • New boxes and spheres will fall down and play a hit sound effect upon collision

Loading...

Open example in a new tab.

Links