0.0.55 • Published 4 years ago
simple-physics-engine v0.0.55
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?
0.0.55
4 years ago
0.0.54
4 years ago
0.0.51
4 years ago
0.0.52
4 years ago
0.0.53
4 years ago
0.0.50
4 years ago
0.0.48
4 years ago
0.0.49
4 years ago
0.0.47
4 years ago
0.0.45
4 years ago
0.0.46
4 years ago
0.0.44
4 years ago
0.0.41
4 years ago
0.0.42
4 years ago
0.0.3
4 years ago
0.0.43
4 years ago
0.0.4
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago
1.0.0
4 years ago