actually implement this function
This commit is contained in:
parent
619049c11f
commit
865c086f14
@ -491,17 +491,23 @@ impl MoveState{
|
|||||||
//clip according to contacts
|
//clip according to contacts
|
||||||
touching.constrain_acceleration(models,hitbox_mesh,&mut a);
|
touching.constrain_acceleration(models,hitbox_mesh,&mut a);
|
||||||
//something
|
//something
|
||||||
|
set_acceleration(body,touching,models,hitbox_mesh,a);
|
||||||
},
|
},
|
||||||
MoveState::Water=>(),
|
MoveState::Water=>(),
|
||||||
MoveState::Fly=>{
|
MoveState::Fly=>{
|
||||||
//set velocity according to current control state
|
//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
|
//clip velocity according to current touching state
|
||||||
|
touching.constrain_velocity(models,hitbox_mesh,&mut v);
|
||||||
//apply to body
|
//apply to body
|
||||||
|
set_velocity(body,touching,models,hitbox_mesh,v);
|
||||||
},
|
},
|
||||||
MoveState::Walk(walk_state)
|
MoveState::Walk(walk_state)
|
||||||
|MoveState::Ladder(walk_state)
|
|MoveState::Ladder(walk_state)
|
||||||
=>{
|
=>{
|
||||||
//accelerate towards walk target or do nothing
|
//accelerate towards walk target or do nothing
|
||||||
|
let a=walk_state.target.acceleration();
|
||||||
|
set_acceleration(body,touching,models,hitbox_mesh,a);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user