Plane
A plane defined by a normal vector and a distance from the origin.
The plane equation is defined as: dot(normal, point) + distance = 0. Used in collision tests, frustum culling, and geometry classification.
Properties
distance float
cpp
float distance { 0.0f }
The signed distance from the origin to the plane along the normal.
The normal vector of the plane, pointing outward.
Functions
DistanceToPoint() auto
cpp
auto vglx::Plane::DistanceToPoint(const Vector3 &point) const
Parameter | Description |
---|---|
point | The point to measure. |
Returns the signed distance from a point to the plane. Positive values mean the point is in front of the plane (in the direction of the normal), negative values mean it's behind.
DistanceToSphere() auto
cpp
auto vglx::Plane::DistanceToSphere(const Sphere &sphere) const
Parameter | Description |
---|---|
sphere | The sphere to measure. |
Returns the signed distance from a sphere to the plane. A negative result means the sphere intersects or is behind the plane.
Normalize() auto
cpp
auto vglx::Plane::Normalize()
Normalizes the plane equation. Ensures the normal is unit length and adjusts the distance accordingly.