GoblinPhysics
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).
Examples
- Mesh Shape
- Boxes
- Box Stack
- Sphere Stack
- Shapes
- Compound Shapes
- Infinite Boxes
- Point Constraint
- Slider Constraint
- Weld Constraint
- Ray Traycer
Features
- 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
Documentation
See Building
below for how to generate documentation. Hosted version available at http://www.goblinphysics.com/documentation.
Roadmap
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
Tests
- Balance
- Box-Sphere
- GJK-Boxes
- GJK-Spheres
- Gravity
- Ray Tracing
- Restitution
- Sphere-Sphere
- Support Points
Building
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
.
License
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.