edit jumped_velocity garbage
This commit is contained in:
parent
9396623f0c
commit
efdb4c97be
@ -1196,11 +1196,6 @@ fn get_walk_state(move_state:&MoveState)->Option<&WalkState>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn jumped_velocity(models:&PhysicsModels,style:&StyleModifiers,hitbox_mesh:&HitboxMesh,jump_dir:Planar64Vec3,v:&mut Planar64Vec3){
|
|
||||||
//bro what even is this function
|
|
||||||
*v=*v+jump_dir*(style.jump.get_jump_deltav()/jump_dir.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
fn contact_normal(models:&PhysicsModels,hitbox_mesh:&HitboxMesh,contact:&ContactCollision)->Planar64Vec3{
|
fn contact_normal(models:&PhysicsModels,hitbox_mesh:&HitboxMesh,contact:&ContactCollision)->Planar64Vec3{
|
||||||
let model_mesh=models.mesh(contact.convex_mesh_id);
|
let model_mesh=models.mesh(contact.convex_mesh_id);
|
||||||
let minkowski=model_physics::MinkowskiMesh::minkowski_sum(model_mesh,hitbox_mesh.transformed_mesh());
|
let minkowski=model_physics::MinkowskiMesh::minkowski_sum(model_mesh,hitbox_mesh.transformed_mesh());
|
||||||
@ -1406,10 +1401,13 @@ fn run_teleport_behaviour(wormhole:&Option<gameplay_attributes::Wormhole>,models
|
|||||||
None=>(),
|
None=>(),
|
||||||
}
|
}
|
||||||
let calc_move=if state.style.get_control(Controls::Jump,state.input_state.controls){
|
let calc_move=if state.style.get_control(Controls::Jump,state.input_state.controls){
|
||||||
if let Some(walk_state)=get_walk_state(&state.move_state){
|
state.style.jump.is_some_and(|jump_settings|{
|
||||||
jumped_velocity(&data.models,&state.style,&data.hitbox_mesh,walk_state.jump_direction.direction(&data.models,&data.hitbox_mesh,&walk_state.contact),&mut v);
|
get_walk_state(&state.move_state).is_some_and(|walk_state|{
|
||||||
|
let jump_dir=walk_state.jump_direction.direction(&data.models,&data.hitbox_mesh,&walk_state.contact);
|
||||||
|
v=jump_settings.jumped_velocity(&state.style,jump_dir,v);
|
||||||
set_velocity_cull(&mut state.body,&mut state.touching,&data.models,&data.hitbox_mesh,v)
|
set_velocity_cull(&mut state.body,&mut state.touching,&data.models,&data.hitbox_mesh,v)
|
||||||
}else{false}
|
})
|
||||||
|
})
|
||||||
}else{false};
|
}else{false};
|
||||||
match &general.trajectory{
|
match &general.trajectory{
|
||||||
Some(trajectory)=>{
|
Some(trajectory)=>{
|
||||||
@ -1512,12 +1510,14 @@ fn run_teleport_behaviour(wormhole:&Option<gameplay_attributes::Wormhole>,models
|
|||||||
PhysicsInputInstruction::SetJump(s)=>{
|
PhysicsInputInstruction::SetJump(s)=>{
|
||||||
state.input_state.set_control(Controls::Jump,s);
|
state.input_state.set_control(Controls::Jump,s);
|
||||||
if let Some(walk_state)=get_walk_state(&state.move_state){
|
if let Some(walk_state)=get_walk_state(&state.move_state){
|
||||||
let mut v=state.body.velocity;
|
if let Some(jump_settings)=&state.style.jump{
|
||||||
jumped_velocity(&data.models,&state.style,&data.hitbox_mesh,walk_state.jump_direction.direction(&data.models,&data.hitbox_mesh,&walk_state.contact),&mut v);
|
let jump_dir=walk_state.jump_direction.direction(&data.models,&data.hitbox_mesh,&walk_state.contact);
|
||||||
if set_velocity_cull(&mut state.body,&mut state.touching,&data.models,&data.hitbox_mesh,v){
|
let jumped_velocity=jump_settings.jumped_velocity(&state.style,jump_dir,state.body.velocity);
|
||||||
|
if set_velocity_cull(&mut state.body,&mut state.touching,&data.models,&data.hitbox_mesh,jumped_velocity){
|
||||||
(state.move_state,state.body.acceleration)=state.touching.get_move_state(&state.body,&data.models,&state.style,&data.hitbox_mesh,&state.camera,&state.input_state,state.time);
|
(state.move_state,state.body.acceleration)=state.touching.get_move_state(&state.body,&data.models,&state.style,&data.hitbox_mesh,&state.camera,&state.input_state,state.time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
b_refresh_walk_target=false;
|
b_refresh_walk_target=false;
|
||||||
},
|
},
|
||||||
PhysicsInputInstruction::SetZoom(s)=>{
|
PhysicsInputInstruction::SetZoom(s)=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user