Skip to main content

Crate bevy_newtonian2d

Crate bevy_newtonian2d 

Source
Expand description

Simple 2D Newtonian physics simulation for Bevy.

Structs§

AngularVelocity2
2D angular velocity. This is stored as a complex number pair, e.g. cos(theta), i sin(theta).
CircleCollider
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.
PhysicsMaterial
Physics material defining common properties of the object.
PhysicsPlugin
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§

PhysicsSimulationState
Physics simulation state. Starts paused (for title screens etc.), so be sure to set it to running when your game begins.
PhysicsSystem
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