adjust exit distance to vehicle size
This commit is contained in:
parent
0142d6d77b
commit
8884999074
|
@ -125,9 +125,14 @@ fn manage_player_actor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (mut vis, mut pos, mut rot, mut v, mut angv) in &mut q_hiddenplayer {
|
for (mut vis, mut pos, mut rot, mut v, mut angv) in &mut q_hiddenplayer {
|
||||||
|
// If we are riding a vehicle, place the player at the position where
|
||||||
|
// it would be after exiting the vehicle.
|
||||||
|
// I would rather place it in the center of the vehicle, but at the time
|
||||||
|
// of writing, I couldn't set the position/rotation of the player *during*
|
||||||
|
// exiting the vehicle, so I'm doing it here instead, as a workaround.
|
||||||
*vis = Visibility::Hidden;
|
*vis = Visibility::Hidden;
|
||||||
if let Ok((ride_trans, ride_pos, ride_rot, ride_v, ride_angv)) = q_ride.get_single() {
|
if let Ok((ride_trans, ride_pos, ride_rot, ride_v, ride_angv)) = q_ride.get_single() {
|
||||||
pos.0 = ride_pos.0 + DVec3::from(ride_trans.rotation * Vec3::new(0.0, 0.0, 10.0));
|
pos.0 = ride_pos.0 + DVec3::from(ride_trans.rotation * Vec3::new(0.0, 0.0, ride_trans.scale.z * 2.0));
|
||||||
rot.0 = ride_rot.0 * DQuat::from_array([-1.0, 0.0, 0.0, 0.0]);
|
rot.0 = ride_rot.0 * DQuat::from_array([-1.0, 0.0, 0.0, 0.0]);
|
||||||
*v = ride_v.clone();
|
*v = ride_v.clone();
|
||||||
*angv = ride_angv.clone();
|
*angv = ride_angv.clone();
|
||||||
|
|
Loading…
Reference in a new issue