JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q9632F
  • License ISC

A physics engine made in javascript that supports polygon to polygon and polygon to circle collisions, with spring physics and stuff.

Package Exports

  • js-physics-engine
  • js-physics-engine/Index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-physics-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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.