Expand description
Simple 2D Newtonian physics simulation for Bevy.
Structs§
- Angular
Velocity2 - 2D angular velocity. This is stored as a complex number pair, e.g. cos(theta), i sin(theta).
- Circle
Collider - Circle collider with a specified radius.
- Force2
- 2D linear force vector accumulated this frame. This is zeroed out each frame after being applied to Velocity2.
- Mass
- Mass per entity, which inhibits Torque2 and Force2.
- Physics
Material - Physics material defining common properties of the object.
- Physics
Plugin - Plugin for basic 2d physics.
- Position2
- 2D position (translation).
- Rotation2
- 2D Rotation. This is stored as a complex number pair, e.g. cos(theta), i sin(theta).
- Static
- Tags entity as unable to move.
- Torque2
- 2D torque. This is stored as a complex number pair, e.g. cos(theta), i sin(theta).
- Velocity2
- Linear 2D velocity vector.
Enums§
- Physics
Simulation State - Physics simulation state. Starts paused (for title screens etc.), so be sure to set it to running when your game begins.
- Physics
System - Set enum for the systems relating to transform propagation
Functions§
- fixed_
update - Integrate physics over time.
- fixed_
update_ angular - Integrate angular physics over time.
- fixed_
update_ children - For simulated objects that are parented, apply child forces on the parent. Update child velocity so it can be read elsewhere.
- update