New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-physics-engine

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-physics-engine

A library containing algorithms & abstract classes for building animations/games, regardless of the platform.

latest
Source
npmnpm
Version
0.0.55
Version published
Maintainers
1
Created
Source

Simple Physics Engine

A library containing algorithms & abstract classes for building animations/games, regardless of the platform.

This package is currently being developed and is not finished or tested.

Example Usage

Using the physics engine and adding a Bird character

import { AbstractPhysics, RigidBody } from 'simple-physics-engine'

class Bird extends RigidBody {
  constructor(pos, options) {
    super(pos, options)
    // other constructor logic
  }

  // other extensions
}

class Physics extends AbstractPhysics {
  // implement abstract init() method
  function init() {
    addCharacter(bird)
    // other init logic
  }

  // implement abstract update() method
  function update(dt) {
    // your update logic
  }

  // other extensions
}

Supported Algorithms

  • A* Search
  • Uniform Cost Search (Dijkstra's Algorithm)
  • Probabilistic Roadmap (PRM) Generation

Supported Classes

Math

  • Vector

Global Logic

  • Physics (Abstract Class)

Objects

All of these objects are abstract classes and are meant to be inherited from. For example, you could create a "Car" class by inheriting from "Agent"

Object Hierarchy

TODO: Add picture of hierarchy

Object Reference

NameDescription
SpatialRoot of all objects, just holds a position
CollisionObjectBase collision object, holds some type of extent to check for collisions
StaticBodyAn extension of CollisionObject that is incapable of moving
RigidBodyAn extension of CollisionObject that supports movement and can receive forces
AgentAn extension of RigidBody that holds a goal and a path towards that goal

TODO

  • Write Particle and ParticleSystem classes
  • Make sure BoundingSphere collision detection is robust, add bounce handling if time
  • Implement kd-tree to make collision detection quicker
  • Write abstract Camera class?

FAQs

Package last updated on 12 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts