ncollide3d/query/closest_points/
closest_points.rs1use crate::math::Point;
2use na::RealField;
3use std::mem;
4
5#[derive(Debug, PartialEq, Clone, Copy)]
7#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8pub enum ClosestPoints<N: RealField + Copy> {
9 Intersecting,
11 WithinMargin(Point<N>, Point<N>),
13 Disjoint,
15}
16
17impl<N: RealField + Copy> ClosestPoints<N> {
18 pub fn flip(&mut self) {
20 if let ClosestPoints::WithinMargin(ref mut p1, ref mut p2) = *self {
21 mem::swap(p1, p2)
22 }
23 }
24}