Compare commits
1 Commits
surf-bodge
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
ddc315365c
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4045,7 +4045,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "strafesnet_physics"
|
||||
version = "0.0.2-surf2"
|
||||
version = "0.0.2"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"glam",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "strafesnet_physics"
|
||||
version = "0.0.2-surf2"
|
||||
version = "0.0.2"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1359,7 +1359,7 @@ fn set_velocity_cull(body:&mut Body,touching:&mut TouchingState,models:&PhysicsM
|
||||
let mut culled=false;
|
||||
touching.contacts.retain(|convex_mesh_id,face_id|{
|
||||
let n=contact_normal(models,hitbox_mesh,convex_mesh_id,*face_id);
|
||||
let r=(n.dot(v)>>52).is_positive();
|
||||
let r=n.dot(v).is_positive();
|
||||
if r{
|
||||
culled=true;
|
||||
}
|
||||
|
||||
@@ -122,10 +122,11 @@ fn press_w(){
|
||||
instruction:strafesnet_common::physics::Instruction::SetControl(strafesnet_common::physics::SetControlInstruction::SetMoveForward(true)),
|
||||
});
|
||||
// wait 10 ms
|
||||
const SAMPLE_TIME:strafesnet_common::physics::Time=Time::from_millis(10);
|
||||
PhysicsContext::run_input_instruction(&mut physics,&physics_data,strafesnet_common::instruction::TimedInstruction{
|
||||
time:Time::from_millis(10),
|
||||
time:SAMPLE_TIME,
|
||||
instruction:strafesnet_common::physics::Instruction::Idle,
|
||||
});
|
||||
// observe current velocity
|
||||
assert_eq!(physics.body().velocity,vec3::raw_xyz(0,-1<<32,-0x2b3333333));
|
||||
assert_eq!(physics.camera_trajectory(&physics_data).extrapolated_velocity(SAMPLE_TIME),vec3::raw_xyz(0,-1<<32,-0x2b3333333));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user