js-physics-engine
v0.0.6
Published
A physics engine made in javascript that supports polygon to polygon and polygon to circle collisions, with spring physics and stuff.
Downloads
20
Readme
js-physics-engine
A physics engine made in javascript.
Structure
This module is distributed in classes, and mainly in this version there are
- Collisions class
- RigidBody class
- RigidBodyBox class
- Vector2 class
The collisions class have all the methods related to collision handling.
The vector2 class allows to create 2-Dimensional vectors with a bunch of handy functions
The RigidBodyBox and RigidBody classes are used to make polygons. The main difference in RigidBody and RigidBodyBox is that, when using RigidBody you enter the points of the polygon, and when using RigidbodyBox, it asks for the x, y, width, and height so it's only suitable for making squares and rectangles.