add camera reset key

This commit is contained in:
Joe Ardent 2025-03-29 16:04:37 -07:00
parent bb3aeae0bf
commit 7d28281781
2 changed files with 7 additions and 4 deletions

View file

@ -68,7 +68,7 @@ fn spawn_bike(
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
) { ) {
let pos = Vec3::new(0.0, 14.0, 0.0); let pos = Vec3::new(0.0, 5.0, 0.0);
let xform = Transform::from_translation(pos); //.with_rotation(Quat::from_rotation_z(0.0)); let xform = Transform::from_translation(pos); //.with_rotation(Quat::from_rotation_z(0.0));
let body_collider = let body_collider =
@ -84,9 +84,9 @@ fn spawn_bike(
SleepingDisabled, SleepingDisabled,
CyberBikeBody, CyberBikeBody,
CatControllerState::default(), CatControllerState::default(),
ColliderDensity(0.5), ColliderDensity(0.6),
AngularDamping(0.9), AngularDamping(0.2),
LinearDamping(0.2), //LinearDamping(0.2),
// LinearVelocity::ZERO, // LinearVelocity::ZERO,
// AngularVelocity::ZERO, // AngularVelocity::ZERO,
ExternalForce::ZERO.with_persistence(false), ExternalForce::ZERO.with_persistence(false),

View file

@ -48,6 +48,9 @@ fn update_camera_pos(mut offset: ResMut<DebugCamOffset>, mut keys: ResMut<Button
offset.dist += 0.5; offset.dist += 0.5;
} }
} }
KeyCode::KeyR => {
*offset = DebugCamOffset::default();
}
_ => continue, _ => continue,
} }
} }