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);
|
rich.economy = Some(economy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ServerGeneral::WindUpdate(vel) => {
|
ServerGeneral::WindUpdate(v) => {
|
||||||
println!("Windupdate {}", vel);
|
println!("Windupdate {}", v);
|
||||||
let player_entity = self.entity();
|
let player_entity = self.entity();
|
||||||
self.state
|
self.state
|
||||||
.ecs_mut()
|
.ecs_mut()
|
||||||
.write_storage::<PhysicsState>()
|
.write_storage::<PhysicsState>()
|
||||||
.get_mut(player_entity)
|
.get_mut(player_entity)
|
||||||
.map(|physics_state| {
|
.map(|physics_state| {
|
||||||
physics_state.in_fluid = physics_state
|
if let Fluid::Air { vel, elevation } =
|
||||||
.in_fluid
|
physics_state.in_fluid.unwrap_or_default()
|
||||||
.filter(|fluid| matches!(fluid, Fluid::Water { .. }))
|
{
|
||||||
.or(Some(Fluid::Air {
|
physics_state.in_fluid = Some(Fluid::Air {
|
||||||
elevation: 0.0,
|
vel: Vel(Lerp::lerp(
|
||||||
vel: Vel(vel),
|
vel.0,
|
||||||
}));
|
v,
|
||||||
|
0.2,
|
||||||
|
)),
|
||||||
|
elevation,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_ => unreachable!("Not a in_game message"),
|
_ => unreachable!("Not a in_game message"),
|
||||||
|
Loading…
Reference in New Issue
Block a user