Bounce

by Perplex
Premium 3D Physics for the Web

Bounce is a fast and determinstic 3D physics library for Typescript and Javascript projects

Fully-featured contraints-based physical simulation
Free & Open Source
Powerful but simple & readable API
Tiny: 69kb gzipped in production
Highly configurable and ready for gaming, animation and robotics
Powerful spatial queries: fast raycasting, sweep and intersection tests
Works with any 3D renderer, and even without rendering, e.g. on NodeJs
See All Features »
Prev
Next
Grab
API
Bounce has a clean and intuitive API. Here's a simple example:
// create a bounce world
const world = new World({
  gravity: { x: 0, y: -9.81, z: 0 },
});

// add a box-shaped body for the ground
const groundShape = world.createBox({
  width: 10,
  height: 2,
  depth: 10,
});

const ground = world.createStaticBody({
  shape: groundShape,

  // the center of the ground box
  position: { x: 0, y: -1, z: 0 },

  // both euler and quaternion are accepted
  // if w is omitted, input is assumed to be euler
  orientation: { x: 0, y: 0, z: 0, w: 1 },

  friction: 0.4,
  restitution: 0.3,
});

// add a sphere-shaped body
const ballShape = world.createSphere({ radius: 0.5 });

const ball = world.createDynamicBody({
  shape: ballShape,
  // vec3s and quats can be input as arrays too
  position: [0, -1, 0],
  orientation: [0, Math.PI, 0],
  friction: 0.4,
  restitution: 0.3,
  mass: 0.5,
});

// simulate 10 seconds of time passing
const timeStepSizeSeconds = 1 / 60;
for (let i = 0; i < 600; i++) {
  world.takeOneStep(timeStepSizeSeconds);
}
More API Examples »
Documentation on codeberg.org »
Contact
Social Media
Business inquiries,
questions or say hello!
Perplex is the trade name for the business registered as 9547-3732 Québec inc.
with headquarters in Montréal, Québec, Canada
©2025 Perplex aka "9547-3732 Québec inc.". All Rights Reserved.