A simple 2D physics library for Haxe with a focus on easy integration into any game engine or framework.
Echo is a 2D physics library written in Haxe that provides robust collision detection and physics simulation with a straightforward API. It is designed for easy integration into various Haxe-based engines and frameworks like Heaps, OpenFL, and Kha, requiring only an update loop to function. The library solves the problem of adding performant and flexible physics to Haxe projects without being tightly coupled to a specific engine.
Haxe developers building 2D games or simulations who need a physics engine that works across multiple Haxe frameworks like Heaps, OpenFL, Kha, HaxeFlixel, and HaxePunk. It is also suitable for developers who prioritize a simple API and easy integration into existing codebases.
Developers choose Echo for its engine-agnostic design, allowing seamless use with various Haxe math libraries and game engines via compiler flags. Its straightforward API, built-in features like physics state history with undo/redo, and extensible debug drawing provide a balance of performance, flexibility, and ease of use compared to more rigid alternatives.
Simple Physics Library written in Haxe
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates seamlessly with multiple Haxe frameworks like Heaps, OpenFL, and Kha via compiler flags, avoiding tight coupling and allowing reuse across projects.
Uses Separating Axis Theorem (SAT) for reliable collision detection between rectangles, circles, and convex polygons, ensuring precise physics interactions.
Features physics state management with undo/redo functionality, a rare inclusion that simplifies debugging and state reverts in simulations.
Implements a quadtree for broadphase collision querying, optimizing performance in dense scenes by reducing unnecessary checks.
Provides on_move and on_rotate callbacks and a build macro for adding custom fields to bodies, streamlining synchronization with game entities without boilerplate.
Only supports convex polygons currently, with concave polygons deferred to the roadmap, restricting collision scenarios for complex shapes.
Tied exclusively to the Haxe ecosystem, making it unsuitable for projects using other languages or engines without Haxe bindings, reducing cross-platform appeal.
Requires specific compiler flags and setup for different math libraries (e.g., hxmath, vector-math), which can be cumbersome and error-prone for newcomers.
The compiler flag to reduce inlined functions sacrifices performance for smaller file size, forcing a compromise that may not suit all use cases.