Giter VIP home page Giter VIP logo

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

Search

  • 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

Name Description
Spatial Root of all objects, just holds a position
CollisionObject Base collision object, holds some type of extent to check for collisions
StaticBody An extension of CollisionObject that is incapable of moving
RigidBody An extension of CollisionObject that supports movement and can receive forces
Agent An 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?

Rafi Barash's Projects

config icon config

My configurations for mac, iTerm2, vim, etc.

docker-node icon docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:

galaga icon galaga

Galaga Remake with Three.js. Play online now!

instapuller icon instapuller

sample app for cloud build and cloud run (copied from Josh B.)

ml-setup icon ml-setup

Quickly set up a local machine learning environment in python

simple-physics-engine icon simple-physics-engine

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.