From 9f948744d4615330a8f9be2482b15789416ce740 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 1 Nov 2023 15:08:12 -0700 Subject: [PATCH] add edge_n to MeshQuery --- src/model_physics.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model_physics.rs b/src/model_physics.rs index eb2a004..b275a2b 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -156,8 +156,12 @@ impl From<&crate::model::IndexedModel> for PhysicsMesh{ pub trait MeshQuery{ fn closest_fev(&self,point:Planar64Vec3)->FEV; - fn face_nd(&self,face_id:FACE)->(Planar64Vec3,Planar64); + fn edge_n(&self,edge_id:EDGE)->Planar64Vec3{ + let verts=self.edge_verts(edge_id); + self.vert(verts[1])-self.vert(verts[0]) + } fn vert(&self,vert_id:VERT)->Planar64Vec3; + fn face_nd(&self,face_id:FACE)->(Planar64Vec3,Planar64); fn face_edges(&self,face_id:FACE)->Cow>; fn edge_faces(&self,edge_id:EDGE)->Cow<[FACE;2]>; fn edge_verts(&self,edge_id:EDGE)->Cow<[VERT;2]>;