diff --git a/src/integer.rs b/src/integer.rs index 95deefa..4bf2a36 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -415,6 +415,7 @@ impl Planar64{ pub const ZERO:Self=Self(0); pub const ONE:Self=Self(1<<32); pub const MAX:Self=Self(i64::MAX); + pub const MIN:Self=Self(i64::MIN); #[inline] pub const fn int(num:i32)->Self{ Self(Self::ONE.0*num as i64) diff --git a/src/model_physics.rs b/src/model_physics.rs index 6044b63..832feb6 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -244,6 +244,19 @@ impl TransformedMesh<'_>{ normal_transform, } } + fn farthest_vert(&self,dir:Planar64Vec3)->VertId{ + let best_dot=Planar64::MIN; + let best_vert; + for (i,vert) in self.mesh.verts.iter().enumerate(){ + let p=self.transform.transform_point3(vert.0); + let d=dir.dot(p); + if best_dotCow>{ self.mesh.vert_directed_edges(vert_id) @@ -321,6 +334,9 @@ impl MinkowskiMesh<'_>{ mesh1, } } + fn farthest_vert(&self,dir:Planar64Vec3)->MinkowskiVert{ + MinkowskiVert::VertVert(self.mesh0.farthest_vert(dir),self.mesh1.farthest_vert(-dir)) + } fn closest_fev(&self,point:Planar64Vec3)->FEV{ //put some genius code right here instead of this //assume that point is outside the mesh and nonzero