Plane
Construction
Constructors
Plane() constexpr
Constructs a plane from a normal and distance.
cpp
Plane::Plane(const Vector3& normal, float distance);| Parameter | Description |
|---|---|
| normal | Plane normal. |
| distance | Signed distance from the origin along the normal. |
Properties
distance float
Signed distance from the origin to the plane along the normal.
cpp
float distance {0.0f};Functions
DistanceToPoint() float
Computes the signed distance from the plane to a point.
Positive values are on the side pointed to by the normal, negative values are behind the plane, and zero lies on the plane.
cpp
float Plane::DistanceToPoint(const Vector3& point) const;| Parameter | Description |
|---|---|
| point | Point to test. |
DistanceToSphere() float
Computes the signed distance from the plane to a sphere surface.
The value is the distance from the plane to the closest point on the sphere. A negative value means the sphere penetrates the plane.
cpp
float Plane::DistanceToSphere(const Sphere& sphere) const;| Parameter | Description |
|---|---|
| sphere | Sphere to test. |