A simple 2D Verlet physics engine written in Haxe and Kha. Port of verlet-js.
Haxe

README.md

VerletKha

A simple Verlet (pronounced 'ver-ley') physics engine written in Haxe and Kha. Port of verlet-js with some references taken from verlet-js-unity

Forces Collision

Particles, distance constraints, and angular constraints are all supported. From these primitives it is possible to construct just about anything you can imagine.

How to use

Add to your Kha project's Libraries folder via cloning, adding as a submodule, or downloading directly. I usually go with

git submodule add https://github.com/Devination/VerletKha.git Libraries/verlet/

Then when I need to update the submodule I'll use

git submodule foreach --recursive git checkout master && git submodule foreach --recursive git pull origin master

Documentation forthcoming. In the mean time, check out the Demos and their source code below.

Demos

All demos and preview gifs can be found here

  1. Shapes (VerletKha Hello world) - Source Code
  2. Primitive Colliders - Source Code
  3. Polygon Colliders - Source Code
  4. Force Volumes - Source Code

TODO

Check out the list on Trello

License

You may use VerletKha under the terms of the MIT License (See LICENSE).