Collision Detection & Response in JavaScript
JavaScript HTML CSS
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


GoblinPhysics is an open source physics engine written from the ground up in JavaScript. It aims to provide a fast and dependable physics simulation regardless of platform (desktop vs. mobile, browser vs. nodejs).



  • Rigid body simulation
  • Sphere, Box, Cone, Cylinder, Plane, Convex, Mesh, and Compound shapes
  • Weld, Slider, and Point constraints
  • Basic event callback system
  • Ray tracing
  • Example scripts
  • Test suite


See Building below for how to generate documentation. Hosted version available at


Non-exhaustive list of planned features

  • Sweep & Prune broad phase
  • More event callbacks
  • More constraints
  • Internal object re-use (framework for this is in place, need to actually use it)
  • Island solver
  • Box-Box detection for better performance and stability
  • Force generators



gulp is used to build the library and generate documentation. Follow gulp's getting started page for a quick setup. To install the packages necessary to build GoblinPhysics, run npm install in the git checkout directory. Once all of the packages have been downloaded you can build by running gulp default. To generate documenation, run gulp docs.


GoblinPhysics is distributed under the zlib license. This means you can use the library to do whatever you want, free of charge, with or without giving attribution (although attribution is always appreciated). Three.js and Stats.js, used in GoblinPhysics' examples and tests, are distributed under the MIT license which requires attribution if used.