[−][src]Struct collision::Plane
A 3-dimensional plane formed from the equation: A*x + B*y + C*z - D = 0
.
Fields
n
: a unit vector representing the normal of the plane where:n.x
: corresponds toA
in the plane equationn.y
: corresponds toB
in the plane equationn.z
: corresponds toC
in the plane equation
d
: the distance value, corresponding toD
in the plane equation
Notes
The A*x + B*y + C*z - D = 0
form is preferred over the other common
alternative, A*x + B*y + C*z + D = 0
, because it tends to avoid
superfluous negations (see Real Time Collision Detection, p. 55).
Fields
n: Vector3<S>
Plane normal
d: S
Plane distance value
Methods
impl<S: BaseFloat> Plane<S>
[src]
pub fn new(n: Vector3<S>, d: S) -> Plane<S>
[src]
Construct a plane from a normal vector and a scalar distance. The
plane will be perpendicular to n
, and d
units offset from the
origin.
pub fn from_abcd(a: S, b: S, c: S, d: S) -> Plane<S>
[src]
Arguments
a
: thex
component of the normalb
: they
component of the normalc
: thez
component of the normald
: the plane's distance value
pub fn from_vector4(v: Vector4<S>) -> Plane<S>
[src]
Construct a plane from the components of a four-dimensional vector
pub fn from_vector4_alt(v: Vector4<S>) -> Plane<S>
[src]
Construct a plane from the components of a four-dimensional vector
Assuming alternative representation: A*x + B*y + C*z + D = 0
pub fn from_points(a: Point3<S>, b: Point3<S>, c: Point3<S>) -> Option<Plane<S>>
[src]
Constructs a plane that passes through the the three points a
, b
and c
pub fn from_point_normal(p: Point3<S>, n: Vector3<S>) -> Plane<S>
[src]
Construct a plane from a point and a normal vector.
The plane will contain the point p
and be perpendicular to n
.
pub fn normalize(&self) -> Option<Plane<S>>
[src]
Normalize a plane.
Trait Implementations
impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>
[src]
impl<S: BaseFloat> Continuous<Plane<S>> for Plane<S>
[src]
See Real-Time Collision Detection, p. 210
type Result = Ray3<S>
Result returned by the intersection test
fn intersection(&self, p2: &Plane<S>) -> Option<Ray3<S>>
[src]
impl<S: BaseFloat> Continuous<(Plane<S>, Plane<S>)> for Plane<S>
[src]
See Real-Time Collision Detection, p. 212 - 214
type Result = Point3<S>
Result returned by the intersection test
fn intersection(&self, planes: &(Plane<S>, Plane<S>)) -> Option<Point3<S>>
[src]
impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Plane<S>
[src]
fn intersects(&self, r: &Ray3<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<Plane<S>> for Plane<S>
[src]
fn intersects(&self, p2: &Plane<S>) -> bool
[src]
impl<S: BaseFloat> Discrete<(Plane<S>, Plane<S>)> for Plane<S>
[src]
impl<S: Copy> Copy for Plane<S>
[src]
impl<S: PartialEq> PartialEq<Plane<S>> for Plane<S>
[src]
impl<S: Clone> Clone for Plane<S>
[src]
fn clone(&self) -> Plane<S>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: BaseFloat> Debug for Plane<S>
[src]
impl<S: AbsDiffEq> AbsDiffEq<Plane<S>> for Plane<S> where
S::Epsilon: Copy,
S: BaseFloat,
[src]
S::Epsilon: Copy,
S: BaseFloat,
type Epsilon = S::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> S::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
[src]
default fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
The inverse of ApproxEq::abs_diff_eq
.
impl<S: RelativeEq> RelativeEq<Plane<S>> for Plane<S> where
S::Epsilon: Copy,
S: BaseFloat,
[src]
S::Epsilon: Copy,
S: BaseFloat,
fn default_max_relative() -> S::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon
) -> bool
default fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
impl<S: UlpsEq> UlpsEq<Plane<S>> for Plane<S> where
S::Epsilon: Copy,
S: BaseFloat,
[src]
S::Epsilon: Copy,
S: BaseFloat,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,