mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Make results of wind simulation push the player
This commit is contained in:
parent
63f2105c84
commit
766897ce65
@ -27,8 +27,9 @@ use common::{
|
||||
invite::{InviteKind, InviteResponse},
|
||||
skills::Skill,
|
||||
slot::Slot,
|
||||
ChatMode, ControlAction, ControlEvent, Controller, ControllerInputs, GroupManip, InputKind,
|
||||
InventoryAction, InventoryEvent, InventoryUpdateEvent, UtteranceKind,
|
||||
ChatMode, ControlAction, ControlEvent, Controller, ControllerInputs, Fluid, GroupManip,
|
||||
InputKind, InventoryAction, InventoryEvent, InventoryUpdateEvent, PhysicsState,
|
||||
UtteranceKind, Vel,
|
||||
},
|
||||
event::{EventBus, LocalEvent},
|
||||
grid::Grid,
|
||||
@ -1985,6 +1986,20 @@ impl Client {
|
||||
},
|
||||
ServerGeneral::WindUpdate(vel) => {
|
||||
println!("Windupdate {}", vel);
|
||||
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),
|
||||
}));
|
||||
});
|
||||
},
|
||||
_ => unreachable!("Not a in_game message"),
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ impl<'a> System<'a> for Sys {
|
||||
let wind_sources: Vec<(Pos, Vel)> = vec![(
|
||||
Pos(Vec3 {
|
||||
x: 9999.0,
|
||||
y: 9999.0,
|
||||
y: 9599.0,
|
||||
z: 200.0,
|
||||
}),
|
||||
Vel(Vec3 {
|
||||
x: 100.0,
|
||||
y: 100.0,
|
||||
z: 100.0,
|
||||
z: 500.0,
|
||||
}),
|
||||
)];
|
||||
windsim.tick(wind_sources, &dt);
|
||||
|
Loading…
Reference in New Issue
Block a user