eulerjs examples

Each example is one short file in src/; src/stage.ts holds the three.js boilerplate they share.

  1. hello: a world, a body bound to a mesh, and the render loop.
  2. tumbling: exact inertia from meshes, and why the gyroscopic term matters.
  3. springs: writing your own Behavior and Plugin.
  4. chain: links pinned together with DistanceJoints.
  5. collisions: a pyramid of crates, and balls to throw at it.
  6. floating: cork, pine and oak afloat on a spectral sea with @eulerjs/marine.
  7. joints: hinges with limits and motors, a slider servo, a cone-twist joint, and fixed joints that break.
  8. queries: ray casts, shape casts and overlap tests.
  9. sensors: trigger zones and contact events.
  10. terrain: heightfield terrain, cylinders and cones, and a triangle mesh with @eulerjs/bvh.
  11. solvers: XPBD and soft step side by side.

For full games built on the same API, see examples/sailboat (buoyancy, sails, a boat hitting rocks and floating crates) and examples/city (a car, ragdoll pedestrians with joint limits, and a city of props).