Take changes into account for the convex polyhedron manifold generator.
@@ -258,8 +258,8 @@ impl<N: Real> ConvexPolyhedronConvexPolyhedronManifoldGenerator<N> {
let n2 = self.manifold2.normal.as_ref().unwrap().unwrap();
let p2 = &self.manifold2.vertices[0];
- let toi2 =
- ray_internal::plane_toi_with_line(p2, &n2, &origin, &normal.unwrap());
+ if let Some(toi2) =
+ ray_internal::plane_toi_with_line(p2, &n2, &origin, &normal.unwrap()) {
let world2 = origin + normal.unwrap() * toi2;
let world1 = self.manifold1.vertices[i];
let f2 = self.manifold2.feature_id;
@@ -272,6 +272,7 @@ impl<N: Real> ConvexPolyhedronConvexPolyhedronManifoldGenerator<N> {
}
}
}
+ }
if self.clip_cache.poly1.len() > 2 {
for i in 0..self.clip_cache.poly2.len() {
@@ -282,8 +283,8 @@ impl<N: Real> ConvexPolyhedronConvexPolyhedronManifoldGenerator<N> {
let n1 = self.manifold1.normal.as_ref().unwrap().unwrap();
let p1 = &self.manifold1.vertices[0];
- let toi1 =
- ray_internal::plane_toi_with_line(p1, &n1, &origin, &normal.unwrap());
+ if let Some(toi1) =
+ ray_internal::plane_toi_with_line(p1, &n1, &origin, &normal.unwrap()) {
let world1 = origin + normal.unwrap() * toi1;
let world2 = self.manifold2.vertices[i];
let f1 = self.manifold1.feature_id;
@@ -296,6 +297,7 @@ impl<N: Real> ConvexPolyhedronConvexPolyhedronManifoldGenerator<N> {
}
}
}
+ }
let nedges1 = self.manifold1.nedges();
let nedges2 = self.manifold2.nedges();
