ncollide3d/shape/
plane.rs

1//! Support mapping based Plane shape.
2use crate::math::Vector;
3use na::{RealField, Unit};
4
5/// SupportMap description of a plane.
6#[derive(PartialEq, Debug, Clone)]
7#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8pub struct Plane<N: RealField + Copy> {
9    /// The plane normal.
10    pub normal: Unit<Vector<N>>,
11}
12
13impl<N: RealField + Copy> Plane<N> {
14    /// Builds a new plane from its center and its normal.
15    #[inline]
16    pub fn new(normal: Unit<Vector<N>>) -> Plane<N> {
17        Plane { normal }
18    }
19
20    /// The plane normal.
21    #[inline]
22    #[deprecated(note = "use the `self.normal` public field directly.")]
23    pub fn normal(&self) -> &Unit<Vector<N>> {
24        &self.normal
25    }
26}