From 83de08034a6063b8b969e4af0e37f83a6f55febe Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 5 Apr 2024 00:54:58 +0200 Subject: [PATCH] add "wants norotation" command to satellite and icarus --- src/actor.rs | 22 ++++++++++++++++++++++ src/commands.rs | 8 ++++++++ src/defs.txt | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/src/actor.rs b/src/actor.rs index 064bc7b..065b00d 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -1,5 +1,6 @@ use bevy::prelude::*; use bevy_xpbd_3d::prelude::*; +use bevy::math::DVec3; use crate::{actor, audio, chat, nature, settings}; pub const ENGINE_SPEED_FACTOR: f32 = 30.0; @@ -11,6 +12,7 @@ impl Plugin for ActorPlugin { fn build(&self, app: &mut App) { app.add_systems(FixedUpdate, ( update_physics_lifeforms, + handle_wants_norotation, )); app.add_systems(Update, ( handle_input, @@ -59,6 +61,7 @@ impl Default for Actor { #[derive(Component)] pub struct InConversationWithPlayer; #[derive(Component)] pub struct ActorEnteringVehicle; #[derive(Component)] pub struct ActorVehicleBeingEntered; +#[derive(Component)] pub struct WantsNoRotation; #[derive(Component)] pub struct LifeForm { @@ -294,3 +297,22 @@ fn handle_collisions( } } } + +fn handle_wants_norotation( + time: Res