From 192fb617ff0cb11a835b0a3d83209da4371fc0c8 Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Sun, 18 Aug 2024 23:57:14 +0200 Subject: [PATCH] Wire up some stuff --- src/interaction/hold/on_hold.rs | 15 ++----------- src/interaction/hold/simulate.rs | 19 ++++++----------- src/interaction/hold/update.rs | 36 ++++++++++++++++++++++++-------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/interaction/hold/on_hold.rs b/src/interaction/hold/on_hold.rs index 2a1fd31..ef62375 100644 --- a/src/interaction/hold/on_hold.rs +++ b/src/interaction/hold/on_hold.rs @@ -8,13 +8,7 @@ pub(super) fn on_hold( trigger: Trigger, mut commands: Commands, mut q_actor: Query<(&mut AvianPickupActorState, &mut GrabParams, &Holding)>, - mut q_prop: Query<( - Option<&PreferredPickupRotation>, - Option<&PreferredPickupDistance>, - Option<&PickupMass>, - &mut Mass, - &Rotation, - )>, + mut q_prop: Query<(Option<&PickupMass>, &mut Mass)>, ) { let actor = trigger.entity(); let (mut state, mut grab, holding) = q_actor.get_mut(actor).unwrap(); @@ -22,12 +16,7 @@ pub(super) fn on_hold( *state = AvianPickupActorState::Holding(prop); // Safety: All props are rigid bodies, so they are guaranteed to have a // `Rotation` and `Rotation`. - let (preferred_rotation, preferred_distance, pickup_mass, mut mass, rotation) = - q_prop.get_mut(prop).unwrap(); - let target_rotation = preferred_rotation - .map(|preferred| preferred.0) - .unwrap_or(rotation.0); - let target_distance = preferred_distance.copied().unwrap_or_default().0; + let (pickup_mass, mut mass) = q_prop.get_mut(prop).unwrap(); let new_mass = pickup_mass.copied().unwrap_or_default().0; commands.entity(prop).insert(NonPickupMass(mass.0)); mass.0 = new_mass; diff --git a/src/interaction/hold/simulate.rs b/src/interaction/hold/simulate.rs index 60e6539..c28e52d 100644 --- a/src/interaction/hold/simulate.rs +++ b/src/interaction/hold/simulate.rs @@ -1,32 +1,25 @@ use super::{GrabParams, ShadowParams}; -use crate::prelude::*; +use crate::{prelude::*, verb::Holding}; /// Basically GrabController::Simulate pub(super) fn simulate( time: Res