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