From 33cc2e1a45d7b1398b1916a2f017710d6d1258b9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 25 Jul 2024 13:53:45 -0700 Subject: [PATCH] update common --- src/model_physics.rs | 52 ++++++++++++++++++++++---------------------- src/physics.rs | 4 ++-- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/model_physics.rs b/src/model_physics.rs index 66ef198..7ca4256 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -137,22 +137,22 @@ impl PhysicsMesh{ //go go gadget debug print mesh let data=PhysicsMeshData{ faces:vec![ - Face{normal:Planar64Vec3::raw( 4294967296, 0, 0),dot:Planar64::raw(4294967296)}, - Face{normal:Planar64Vec3::raw( 0, 4294967296, 0),dot:Planar64::raw(4294967296)}, - Face{normal:Planar64Vec3::raw( 0, 0, 4294967296),dot:Planar64::raw(4294967296)}, - Face{normal:Planar64Vec3::raw(-4294967296, 0, 0),dot:Planar64::raw(4294967296)}, - Face{normal:Planar64Vec3::raw( 0,-4294967296, 0),dot:Planar64::raw(4294967296)}, - Face{normal:Planar64Vec3::raw( 0, 0,-4294967296),dot:Planar64::raw(4294967296)} + Face{normal:Planar64Vec3::raw_xyz( 4294967296, 0, 0),dot:Planar64::raw(4294967296)}, + Face{normal:Planar64Vec3::raw_xyz( 0, 4294967296, 0),dot:Planar64::raw(4294967296)}, + Face{normal:Planar64Vec3::raw_xyz( 0, 0, 4294967296),dot:Planar64::raw(4294967296)}, + Face{normal:Planar64Vec3::raw_xyz(-4294967296, 0, 0),dot:Planar64::raw(4294967296)}, + Face{normal:Planar64Vec3::raw_xyz( 0,-4294967296, 0),dot:Planar64::raw(4294967296)}, + Face{normal:Planar64Vec3::raw_xyz( 0, 0,-4294967296),dot:Planar64::raw(4294967296)} ], verts:vec![ - Vert(Planar64Vec3::raw( 4294967296,-4294967296,-4294967296)), - Vert(Planar64Vec3::raw( 4294967296, 4294967296,-4294967296)), - Vert(Planar64Vec3::raw( 4294967296, 4294967296, 4294967296)), - Vert(Planar64Vec3::raw( 4294967296,-4294967296, 4294967296)), - Vert(Planar64Vec3::raw(-4294967296, 4294967296,-4294967296)), - Vert(Planar64Vec3::raw(-4294967296, 4294967296, 4294967296)), - Vert(Planar64Vec3::raw(-4294967296,-4294967296, 4294967296)), - Vert(Planar64Vec3::raw(-4294967296,-4294967296,-4294967296)) + Vert(Planar64Vec3::raw_xyz( 4294967296,-4294967296,-4294967296)), + Vert(Planar64Vec3::raw_xyz( 4294967296, 4294967296,-4294967296)), + Vert(Planar64Vec3::raw_xyz( 4294967296, 4294967296, 4294967296)), + Vert(Planar64Vec3::raw_xyz( 4294967296,-4294967296, 4294967296)), + Vert(Planar64Vec3::raw_xyz(-4294967296, 4294967296,-4294967296)), + Vert(Planar64Vec3::raw_xyz(-4294967296, 4294967296, 4294967296)), + Vert(Planar64Vec3::raw_xyz(-4294967296,-4294967296, 4294967296)), + Vert(Planar64Vec3::raw_xyz(-4294967296,-4294967296,-4294967296)) ] }; let mesh_topology=PhysicsMeshTopology{ @@ -167,17 +167,17 @@ impl PhysicsMesh{ FaceRefs{edges:vec![SubmeshDirectedEdgeId(4),SubmeshDirectedEdgeId(0),SubmeshDirectedEdgeId((9223372036854775819u64-(1<<63)+(1<<31)) as u32),SubmeshDirectedEdgeId(9)]} ], edge_topology:vec![ - EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(5)],verts:[SubmeshVertId(0),SubmeshVertId(1)]}, - EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(1)],verts:[SubmeshVertId(1),SubmeshVertId(2)]}, - EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(2)],verts:[SubmeshVertId(2),SubmeshVertId(3)]}, - EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(0)],verts:[SubmeshVertId(0),SubmeshVertId(3)]}, - EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(5)],verts:[SubmeshVertId(1),SubmeshVertId(4)]}, - EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(3)],verts:[SubmeshVertId(4),SubmeshVertId(5)]}, - EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(1)],verts:[SubmeshVertId(2),SubmeshVertId(5)]}, - EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(2)],verts:[SubmeshVertId(3),SubmeshVertId(6)]}, - EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(3)],verts:[SubmeshVertId(5),SubmeshVertId(6)]}, - EdgeRefs{faces:[SubmeshFaceId(3),SubmeshFaceId(5)],verts:[SubmeshVertId(4),SubmeshVertId(7)]}, - EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(3)],verts:[SubmeshVertId(6),SubmeshVertId(7)]}, + EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(5)],verts:[SubmeshVertId(0),SubmeshVertId(1)]}, + EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(1)],verts:[SubmeshVertId(1),SubmeshVertId(2)]}, + EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(2)],verts:[SubmeshVertId(2),SubmeshVertId(3)]}, + EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(0)],verts:[SubmeshVertId(0),SubmeshVertId(3)]}, + EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(5)],verts:[SubmeshVertId(1),SubmeshVertId(4)]}, + EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(3)],verts:[SubmeshVertId(4),SubmeshVertId(5)]}, + EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(1)],verts:[SubmeshVertId(2),SubmeshVertId(5)]}, + EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(2)],verts:[SubmeshVertId(3),SubmeshVertId(6)]}, + EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(3)],verts:[SubmeshVertId(5),SubmeshVertId(6)]}, + EdgeRefs{faces:[SubmeshFaceId(3),SubmeshFaceId(5)],verts:[SubmeshVertId(4),SubmeshVertId(7)]}, + EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(3)],verts:[SubmeshVertId(6),SubmeshVertId(7)]}, EdgeRefs{faces:[SubmeshFaceId(5),SubmeshFaceId(4)],verts:[SubmeshVertId(0),SubmeshVertId(7)]} ], vert_topology:vec![ @@ -961,4 +961,4 @@ fn test_is_empty_volume(){ fn build_me_a_cube(){ let mesh=PhysicsMesh::unit_cube(); //println!("mesh={:?}",mesh); -} \ No newline at end of file +} diff --git a/src/physics.rs b/src/physics.rs index 7739c9f..c4fdca2 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1161,7 +1161,7 @@ impl PhysicsContext{ aabb.inflate(data.hitbox_mesh.halfsize); //common body let relative_body=VirtualBody::relative(&Body::default(),&state.body).body(state.time); - data.bvh.the_tester(&aabb,&mut |convex_mesh_id|{ + data.bvh.the_tester(&aabb,&mut |&convex_mesh_id|{ //no checks are needed because of the time limits. let model_mesh=data.models.mesh(convex_mesh_id); let minkowski=model_physics::MinkowskiMesh::minkowski_sum(model_mesh,data.hitbox_mesh.transformed_mesh()); @@ -1763,4 +1763,4 @@ mod test{ Time::ZERO ),None); } -} \ No newline at end of file +}