From 1c23861ec42b89742c3c89db2cb0f62bdae0c54c Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 19 Mar 2024 16:18:52 +0100 Subject: [PATCH] implement drifting --- src/actor.rs | 1 + src/world.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actor.rs b/src/actor.rs index 9a1cc7b..2cce813 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -128,6 +128,7 @@ pub fn update_physics_actors( ) { for (actor, mut transform) in q_actors.iter_mut() { transform.rotate(actor.angular_momentum); + transform.translation += actor.v; } } diff --git a/src/world.rs b/src/world.rs index 13432d4..047a5cc 100644 --- a/src/world.rs +++ b/src/world.rs @@ -194,7 +194,10 @@ pub fn setup( // Add alien commands.spawn(( - actor::Actor::default(), + actor::Actor { + v: Vec3::new(-0.005, 0.01, 0.015), + ..default() + }, actor::Talker { conv: "Hello World!".to_string() }, SceneBundle { transform: Transform {