parry3d/query/intersection_test/
intersection_test_halfspace_support_map.rs1use crate::math::Pose;
2use crate::shape::HalfSpace;
3use crate::shape::SupportMap;
4
5pub fn intersection_test_halfspace_support_map<G: ?Sized + SupportMap>(
7 pos12: &Pose,
8 halfspace: &HalfSpace,
9 other: &G,
10) -> bool {
11 let deepest = other.support_point_toward(pos12, -halfspace.normal);
12 halfspace.normal.dot(deepest) <= 0.0
13}
14
15pub fn intersection_test_support_map_halfspace<G: ?Sized + SupportMap>(
17 pos12: &Pose,
18 other: &G,
19 halfspace: &HalfSpace,
20) -> bool {
21 intersection_test_halfspace_support_map(&pos12.inverse(), halfspace, other)
22}