diff --git a/src/model_physics.rs b/src/model_physics.rs index 79aea53..6925e36 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -487,7 +487,7 @@ impl TransformedMesh<'_>{ SubmeshVertId::new( self.view.topology.verts.iter() .enumerate() - .min_by_key(|(_,vert_id)| + .max_by_key(|(_,&vert_id)| dir.dot(self.transform.vertex.transform_point3(self.view.data.verts[vert_id.get() as usize].0)) ) //assume there is more than zero vertices.