diff --git a/src/physics.rs b/src/physics.rs index a21d5bf..0661365 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -491,17 +491,23 @@ impl MoveState{ //clip according to contacts touching.constrain_acceleration(models,hitbox_mesh,&mut a); //something + set_acceleration(body,touching,models,hitbox_mesh,a); }, MoveState::Water=>(), MoveState::Fly=>{ //set velocity according to current control state + let mut v=style.get_propulsion_control_dir(camera,input_state.controls)*80; //clip velocity according to current touching state + touching.constrain_velocity(models,hitbox_mesh,&mut v); //apply to body + set_velocity(body,touching,models,hitbox_mesh,v); }, MoveState::Walk(walk_state) |MoveState::Ladder(walk_state) =>{ //accelerate towards walk target or do nothing + let a=walk_state.target.acceleration(); + set_acceleration(body,touching,models,hitbox_mesh,a); }, } }