pub struct Plane<S> {
pub n: Vector3<S>,
pub d: S,
}
Expand description
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
Implementations§
Source§impl<S: BaseFloat> Plane<S>
impl<S: BaseFloat> Plane<S>
Sourcepub fn new(n: Vector3<S>, d: S) -> Plane<S>
pub fn new(n: Vector3<S>, d: S) -> Plane<S>
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.
Sourcepub fn from_abcd(a: S, b: S, c: S, d: S) -> Plane<S>
pub fn from_abcd(a: S, b: S, c: S, d: S) -> Plane<S>
§Arguments
a
: thex
component of the normalb
: they
component of the normalc
: thez
component of the normald
: the plane’s distance value
Sourcepub fn from_vector4(v: Vector4<S>) -> Plane<S>
pub fn from_vector4(v: Vector4<S>) -> Plane<S>
Construct a plane from the components of a four-dimensional vector
Sourcepub fn from_vector4_alt(v: Vector4<S>) -> Plane<S>
pub fn from_vector4_alt(v: Vector4<S>) -> Plane<S>
Construct a plane from the components of a four-dimensional vector
Assuming alternative representation: A*x + B*y + C*z + D = 0
Sourcepub fn from_points(a: Point3<S>, b: Point3<S>, c: Point3<S>) -> Option<Plane<S>>
pub fn from_points(a: Point3<S>, b: Point3<S>, c: Point3<S>) -> Option<Plane<S>>
Constructs a plane that passes through the the three points a
, b
and c
Sourcepub fn from_point_normal(p: Point3<S>, n: Vector3<S>) -> Plane<S>
pub fn from_point_normal(p: Point3<S>, n: Vector3<S>) -> Plane<S>
Construct a plane from a point and a normal vector.
The plane will contain the point p
and be perpendicular to n
.
Trait Implementations§
Source§impl<S> AbsDiffEq for Plane<S>
impl<S> AbsDiffEq for Plane<S>
Source§fn default_epsilon() -> S::Epsilon
fn default_epsilon() -> S::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool
Source§impl<S: BaseFloat> Continuous<(Plane<S>, Plane<S>)> for Plane<S>
See Real-Time Collision Detection, p. 212 - 214
impl<S: BaseFloat> Continuous<(Plane<S>, Plane<S>)> for Plane<S>
See Real-Time Collision Detection, p. 212 - 214
Source§impl<S: BaseFloat> Continuous<Plane<S>> for Plane<S>
See Real-Time Collision Detection, p. 210
impl<S: BaseFloat> Continuous<Plane<S>> for Plane<S>
See Real-Time Collision Detection, p. 210