WIP stop key

This commit is contained in:
yuni 2024-03-29 01:40:58 +01:00
parent b96eb701ab
commit 65c843f55f

View file

@ -119,17 +119,22 @@ fn run_camera_controller(
engine.current_warmup = (engine.current_warmup - dt / engine.warmup_seconds).clamp(0.0, 1.0);
}
let forward = *transform.forward() * engine.current_warmup * (if axis_input.z > 0.0 {
let forward = *transform.forward();
let right = *transform.right();
let up = *transform.up();
let forward_factor = engine.current_warmup * (if axis_input.z > 0.0 {
engine.thrust_forward
} else {
engine.thrust_back
});
let right = *transform.right() * engine.thrust_sideways * engine.current_warmup;
let up = *transform.up() * engine.thrust_sideways * engine.current_warmup;
let right_factor = engine.thrust_sideways * engine.current_warmup;
let up_factor = engine.thrust_sideways * engine.current_warmup;
let acceleration_global
= acceleration_camera.x * right
+ acceleration_camera.y * up
+ acceleration_camera.z * forward;
= acceleration_camera.x * right * right_factor
+ acceleration_camera.y * up * up_factor
+ acceleration_camera.z * forward * forward_factor;
let speed_multiplier = 30.0;
actor.v += speed_multiplier * dt * acceleration_global;