MCPcopy Create free account
hub / github.com/Seldom-SE/seldom_state / fall

Function fall

examples/input.rs:103–109  ·  view source on GitHub ↗
(mut fallings: Query<(&mut Transform, &mut Falling)>, time: Res<Time>)

Source from the content-addressed store, hash-verified

101const GRAVITY: f32 = -1000.;
102
103fn fall(mut fallings: Query<(&mut Transform, &mut Falling)>, time: Res<Time>) {
104 for (mut transform, mut falling) in &mut fallings {
105 let dt = time.delta_secs();
106 falling.velocity += dt * GRAVITY;
107 transform.translation.y += dt * falling.velocity;
108 }
109}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected