Compare commits
1 Commits
physics-bu
...
bedbug
| Author | SHA1 | Date | |
|---|---|---|---|
|
673602516f
|
29
.zed/debug.json
Normal file
29
.zed/debug.json
Normal file
@@ -0,0 +1,29 @@
|
||||
// Project-local debug tasks
|
||||
//
|
||||
// For more documentation on how to configure debug tasks,
|
||||
// see: https://zed.dev/docs/debugger
|
||||
[
|
||||
{
|
||||
"label": "Strafe Client",
|
||||
"adapter": "CodeLLDB",
|
||||
"program": "target/debug/strafe-client",
|
||||
"args": [
|
||||
"tools/bhop_maps/5692113331.snfm"
|
||||
],
|
||||
"request": "launch",
|
||||
"build": {
|
||||
"command": "cargo",
|
||||
"args": ["build","-p strafe-client"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Integration Testing",
|
||||
"adapter": "CodeLLDB",
|
||||
"program": "target/release/integration-testing",
|
||||
"request": "launch",
|
||||
"build": {
|
||||
"command": "cargo",
|
||||
"args": ["test","-p integration-testing"]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -28,7 +28,6 @@ pub enum InternalInstruction{
|
||||
CollisionStart(Collision,model_physics::GigaTime),
|
||||
CollisionEnd(Collision,model_physics::GigaTime),
|
||||
StrafeTick,
|
||||
// TODO: add GigaTime to ReachWalkTargetVelocity
|
||||
ReachWalkTargetVelocity,
|
||||
// Water,
|
||||
}
|
||||
@@ -1682,14 +1681,17 @@ fn collision_end_intersect(
|
||||
}
|
||||
fn atomic_internal_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedInstruction<InternalInstruction,Time>){
|
||||
state.time=ins.time;
|
||||
match ins.instruction{
|
||||
// collisions advance the body precisely
|
||||
let (should_advance_body,goober_time)=match ins.instruction{
|
||||
InternalInstruction::CollisionStart(_,dt)
|
||||
|InternalInstruction::CollisionEnd(_,dt)=>state.body.advance_time_ratio_dt(dt),
|
||||
// this advances imprecisely
|
||||
InternalInstruction::ReachWalkTargetVelocity=>state.body.advance_time(state.time),
|
||||
// strafe tick decides for itself whether to advance the body.
|
||||
InternalInstruction::StrafeTick=>(),
|
||||
|InternalInstruction::CollisionEnd(_,dt)=>(true,Some(dt)),
|
||||
InternalInstruction::StrafeTick
|
||||
|InternalInstruction::ReachWalkTargetVelocity=>(true,None),
|
||||
};
|
||||
if should_advance_body{
|
||||
match goober_time{
|
||||
Some(dt)=>state.body.advance_time_ratio_dt(dt),
|
||||
None=>state.body.advance_time(state.time),
|
||||
}
|
||||
}
|
||||
match ins.instruction{
|
||||
InternalInstruction::CollisionStart(collision,_)=>{
|
||||
@@ -1736,8 +1738,6 @@ fn atomic_internal_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:Tim
|
||||
let masked_controls=strafe_settings.mask(controls);
|
||||
let control_dir=state.style.get_control_dir(masked_controls);
|
||||
if control_dir!=vec3::ZERO{
|
||||
// manually advance time
|
||||
state.body.advance_time(state.time);
|
||||
let camera_mat=state.camera.simulate_move_rotation_y(state.input_state.lerp_delta(state.time).x);
|
||||
if let Some(ticked_velocity)=strafe_settings.tick_velocity(state.body.velocity,(camera_mat*control_dir).with_length(Planar64::ONE).divide().wrap_1()){
|
||||
//this is wrong but will work ig
|
||||
|
||||
Reference in New Issue
Block a user