mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Basic (frame-dependent!) client-side lerp of wind velocity
This commit is contained in:
parent
ba12d784ed
commit
dc491eead5
@ -1984,21 +1984,26 @@ impl Client {
|
||||
rich.economy = Some(economy);
|
||||
}
|
||||
},
|
||||
ServerGeneral::WindUpdate(vel) => {
|
||||
println!("Windupdate {}", vel);
|
||||
ServerGeneral::WindUpdate(v) => {
|
||||
println!("Windupdate {}", v);
|
||||
let player_entity = self.entity();
|
||||
self.state
|
||||
.ecs_mut()
|
||||
.write_storage::<PhysicsState>()
|
||||
.get_mut(player_entity)
|
||||
.map(|physics_state| {
|
||||
physics_state.in_fluid = physics_state
|
||||
.in_fluid
|
||||
.filter(|fluid| matches!(fluid, Fluid::Water { .. }))
|
||||
.or(Some(Fluid::Air {
|
||||
elevation: 0.0,
|
||||
vel: Vel(vel),
|
||||
}));
|
||||
if let Fluid::Air { vel, elevation } =
|
||||
physics_state.in_fluid.unwrap_or_default()
|
||||
{
|
||||
physics_state.in_fluid = Some(Fluid::Air {
|
||||
vel: Vel(Lerp::lerp(
|
||||
vel.0,
|
||||
v,
|
||||
0.2,
|
||||
)),
|
||||
elevation,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
_ => unreachable!("Not a in_game message"),
|
||||
|
Loading…
Reference in New Issue
Block a user