From de4a2dc652927772612aa90904dba84765581101 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 21 Nov 2023 19:11:33 -0800 Subject: [PATCH] reuse existing variables --- src/face_crawler.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/face_crawler.rs b/src/face_crawler.rs index b723c0c..19d9b86 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -66,10 +66,9 @@ enum Transition{ } } //test each vertex collision time, ignoring roots with zero or conflicting derivative - let n=mesh.edge_n(edge_id); - for (i,&vert_id) in mesh.edge_verts(edge_id).iter().enumerate(){ + for (i,&vert_id) in edge_verts.iter().enumerate(){ //vertex normal gets parity from vert index - let n=n*(1-2*(i as i64)); + let n=edge_n*(1-2*(i as i64)); 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);