Compare commits

..

1 Commits

Author SHA1 Message Date
ddc315365c it: fix test 2026-03-31 12:59:40 -07:00
4 changed files with 6 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -4045,7 +4045,7 @@ dependencies = [
[[package]]
name = "strafesnet_physics"
version = "0.0.2-surf2"
version = "0.0.2"
dependencies = [
"arrayvec",
"glam",

View File

@@ -1,6 +1,6 @@
[package]
name = "strafesnet_physics"
version = "0.0.2-surf2"
version = "0.0.2"
edition = "2024"
[dependencies]

View File

@@ -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;
}

View File

@@ -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));
}