Heron
An ergonomic physics API for 2d and 3d bevy games. (powered by rapier)
What it looks like
use *;
use *;
// Define your physics layers
Installation
For a 2d game:
= { = "2.0.0", = ["2d"] }
For a 3d game:
= { = "2.0.0", = ["3d"] }
Supported Bevy Versions
| bevy | heron |
|---|---|
| 0.6 | 1 |
| 0.5 | 0.4 - 0.13 |
| 0.4 | 0.1 - 0.3 |
Design principles
- Use bevy types, resources and components when possible (
Vec3,Quat,Transform,Events, etc.) - Provide a single API that works for both 2d and 3d. (Like bevy does)
- Data oriented. Using this library should feel like its a part of bevy.
- Avoid asking the user to lookup in resources via handles. Data should be accessible and modifiable directly in components.
- Hide the actual physics engine. This is an implementation detail the user shouldn't have to worry about.
- But, allow advanced users to access the underlying rapier resources, so the user is never blocked by a missing element in the API of heron.
Feature flags
One must choose to use either 2d or 3d. If neither of the two features is enabled, the PhysicsPlugin won't be available.
collision-from-meshAdd a component to generate convex hull collision for a mesh.3dEnable simulation on the 3 axesx,y, andz.2dEnable simulation only on the first 2 axesxandy.debug-2dRender 2d collision shapes.enhanced-determinismEnable rapier's enhanced-determinism
How does this project compare to bevy_rapier?
bevy_rapier plugin is an excellent option and should definitely be considered.
Here are some key differences between the two projects:
herontries to provide a smaller, simpler API that is easier to use.bevy_rapieris more complete and powerful, but a bit more complex.heronmostly hides the underlying physics engine, so you don't have to use rapier directly nor nalgebra.bevy_rapierasks the user to deal directly withrapierandnalgebra.heronis focused on games only.bevy_rapiertargets all kind of physics simulation applications (incl. games).bevy_rapieris actively maintained by dimforge, the developer ofrapier.heronis also active, but cannot evolve as fast asbevy_rapiercan.
heron is probably more suited for simple games and game-jams, where the ease of learn/use is especially valuable and where the lack of advanced feature isn't problematic.
bevy_rapier is probably more suited for bigger/complex games and other types of physics simulations, where it may be better to learn/use a more exhaustive/complex API.
Contribute / Contact
You can open issues/discussions here or you can discuss with me (Jomag#2675) in the bevy discord