1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
use na::{Real, Unit};

use crate::math::{Isometry, Point, Vector};
use crate::shape::SupportMap;

pub struct ConstantOrigin;

impl<N: Real> SupportMap<N> for ConstantOrigin {
    fn support_point(&self, _: &Isometry<N>, _: &Vector<N>) -> Point<N> {
        Point::origin()
    }

    /// Same as `self.support_point` except that `dir` is normalized.
    fn support_point_toward(&self, _: &Isometry<N>, _: &Unit<Vector<N>>) -> Point<N> {
        Point::origin()
    }
}