pub struct Plane {
pub a: Vector3,
pub n: Vector3,
pub d: f64,
}Expand description
A plane in 3D space.
Fields§
§a: Vector3§n: Vector3§d: f64Implementations§
Trait Implementations§
Source§impl Shape for Plane
impl Shape for Plane
Source§fn normal(&self, _point: &Vector3) -> Vector3
fn normal(&self, _point: &Vector3) -> Vector3
Returns the normal (normalized) of the plane at a given point.
Source§fn intersects(&self, line: &Line3) -> List<f64>
fn intersects(&self, line: &Line3) -> List<f64>
Returns the intersection of the plane with a line. If the line is parallel to the plane, it returns an empty list. If the line is in the plane, it returns an empty list as a convention (because really, all lambdas fulfill). If the line intersects the plane, it returns a list with the lambda value. The lambda value is used to calculate the point of intersection with the line.calc_point(lambda).
Source§fn closest_intersection(&self, line: &Line3) -> Option<Intersection>
fn closest_intersection(&self, line: &Line3) -> Option<Intersection>
Returns the intersection of the plane with a line. If the line is parallel to the plane, it returns Option None. If the line is in the plane, it returns Option None as a convention (because really, all lambdas fulfill). If the line intersects the plane, it returns the lambda value. The lambda value is used to calculate the point of intersection with the line.calc_point(lambda).