From 86d45252c718720e0a6a8c2617c15e2373ebe078 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 1 Nov 2023 15:08:27 -0700 Subject: [PATCH] use edge_n instead of ambiguous face --- src/face_crawler.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/face_crawler.rs b/src/face_crawler.rs index 1a54506..60c47c7 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -61,8 +61,9 @@ impl State>{ } } //test each vertex collision time, ignoring roots with zero or conflicting derivative - for &(vert_id,test_face_id) in mesh.edge_verts(edge_id).iter(){ - let (n,d)=mesh.face_nd(test_face_id); + let n=mesh.edge_n(edge_id); + for &vert_id in mesh.edge_verts(edge_id).iter(){ + let d=n.dot(mesh.vert(vert_id)); for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){ let t=body.time+Time::from(t); if self.time State>{ } //if none: }, - &FEV::::Vert(vertex_id)=>{ + &FEV::::Vert(vert_id)=>{ //test each edge collision time, ignoring roots with zero or conflicting derivative - for &(edge_id,test_face_id) in mesh.vert_edges(vertex_id).iter(){ - let (n,d)=mesh.face_nd(test_face_id); + for &edge_id in mesh.vert_edges(vert_id).iter(){ + let n=mesh.edge_n(edge_id); + let d=n.dot(mesh.vert(vert_id)); for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){ let t=body.time+Time::from(t); if self.time