From 096284ea60270724ed0280f3938acfff9e8c8519 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 22 Nov 2023 19:26:52 -0800 Subject: [PATCH] wrong --- src/model_physics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model_physics.rs b/src/model_physics.rs index 7300980..c87db5a 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -391,13 +391,13 @@ impl MinkowskiMesh<'_>{ let edge_n=self.edge_n(edge_id); let edge_verts=self.edge_verts(edge_id); for (i,&face_id) in self.edge_faces(edge_id).iter().enumerate(){ - let face_n=self.face_nd(face_id).0; + let (face_n,face_d)=self.face_nd(face_id); //edge-face boundary nd, n facing out of the face towards the edge let boundary_n=edge_n.cross(face_n)*((i as i64)*4-2); let boundary_d=boundary_n.dot(self.vert(edge_verts[0]))+boundary_n.dot(self.vert(edge_verts[1])); if point.dot(boundary_n)<=boundary_d{ //must be normalized to compare distances - let d=point.dot(face_n); + let d=point.dot(face_n)-face_d; let dd=d*d/face_n.dot(face_n); if dd