mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Hack custom gravity of 1G while gliding
This commit is contained in:
parent
dade686fbd
commit
c2b4f926c1
@ -668,6 +668,11 @@ impl<'a> PhysicsData<'a> {
|
|||||||
// to lag (as observed in the 0.9 release party).
|
// to lag (as observed in the 0.9 release party).
|
||||||
let dt = DeltaTime(read.dt.0.min(0.1));
|
let dt = DeltaTime(read.dt.0.min(0.1));
|
||||||
|
|
||||||
|
// Hack. FIXME: Implement gravity magic proper and/or set GRAVITY to 9.81.
|
||||||
|
let custom_gravity = character_state.and_then(|cs| match cs {
|
||||||
|
CharacterState::Glide(_) => Some(9.81),
|
||||||
|
_ => None,
|
||||||
|
});
|
||||||
match physics_state.in_fluid {
|
match physics_state.in_fluid {
|
||||||
None => {
|
None => {
|
||||||
vel.0.z -= dt.0 * GRAVITY;
|
vel.0.z -= dt.0 * GRAVITY;
|
||||||
@ -682,7 +687,7 @@ impl<'a> PhysicsData<'a> {
|
|||||||
density,
|
density,
|
||||||
mass,
|
mass,
|
||||||
&fluid,
|
&fluid,
|
||||||
GRAVITY,
|
custom_gravity.unwrap_or(GRAVITY),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user