Set rotation directly for now.

This commit is contained in:
Nolan Darilek 2024-03-24 16:12:11 -05:00
parent 0a28702b2a
commit 91166359e2

View File

@ -147,7 +147,7 @@ fn controls(
Option<&BackwardMovementFactor>,
Option<&ForwardMovementFactor>,
Option<&StrafeMovementFactor>,
&Transform,
&mut Transform,
Option<&mut KinematicCharacterController>,
)>,
exploration_focused: Query<Entity, With<ExplorationFocused>>,
@ -161,7 +161,7 @@ fn controls(
backward_movement_factor,
forward_movement_factor,
strafe_movement_factor,
transform,
mut transform,
character_controller,
) in &mut query
{
@ -208,7 +208,6 @@ fn controls(
} else {
// println!("{entity:?}: SetLinearVelocity: {velocity:?}");
actions.press(&NavigationAction::SetLinearVelocity);
actions
.action_data_mut_or_default(&NavigationAction::SetLinearVelocity)
.axis_pair = Some(DualAxisData::from_xy(velocity));
@ -271,7 +270,11 @@ fn controls(
.value = 0.;
}
if actions.pressed(&NavigationAction::SetAngularVelocity) {
velocity.angvel = actions.value(&NavigationAction::SetAngularVelocity);
// velocity.angvel =
// actions.value(&NavigationAction::SetAngularVelocity);
transform.rotation *= Quat::from_rotation_z(
actions.value(&NavigationAction::SetAngularVelocity) * time.delta_seconds(),
);
} else if actions.just_released(&NavigationAction::SetAngularVelocity) {
actions
.action_data_mut_or_default(&NavigationAction::SetAngularVelocity)