A simple Verlet (pronounced 'ver-ley') physics engine written in javascript.
Particles, distance constraints, and angular constraints are all supported by verlet-js. From these primitives it is possible to construct just about anything you can imagine.
You may use verlet-js under the terms of the MIT License (See LICENSE).
- js/verlet-js/vec2.js: 2d vector implementation
- js/verlet-js/constraint/: constraint code
- js/verlet-js/verlet.js: verlet-js engine
- js/verlet-js/objects.js: shapes and objects (triangles, circles, tires..)
npm run build
for automated building
npm run watch-build-test
- Line/intersects#28 - I can compile the maxes and minimums before hand
- any file that is named cachable can make lazy and store the information after
- changing loops in verlet.js from
for( in )
towhile(i--)
- Problem: Constraints are applied after other constraints get applied
- Solution: make each constraint only return a transform and apply them after all others do
- Problem: Constraints that will force the particle in the same direction get applied ontop of eachother
- Solution: Create a Governer Constraint that creates an average of all transforms done to each particle
- Problem: Area Constraints cannot detect negative area
- Solution: ??
- Problem: Particles May tunnel
- Solution: Make the Collision solver equation based
- Problem: Collisions don't account for accelleration when solving the points new position
- Solution: Make the collision solver equation based
- Problem: Collisions don't solve lateral collisions (p goes behind ab)
- Solution: look for when the lines intersect
- Problem: Collision Solving only solves found collisions in timestep
- Solution: Collision solver goes backward in time to first collision then searches
- Problem: Collisions don't account for area behind a surface area
- Solution: ??
- Problem: points never rest
- Solution: ??