|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
#include <frustum.hpp>
Public Member Functions | |
| Plane () | |
| Default constructor initializing a horizontal plane at the origin. | |
| Plane (const glm::vec3 &normal, float distance) | |
| Parameterized constructor. | |
| Plane (const glm::vec3 &point, const glm::vec3 &normal) | |
| Construct a plane from a point and a normal vector. | |
| float | distance_to_point (const glm::vec3 &point) const |
| Calculate the distance from a point to the plane. | |
| void | normalize () |
| Normalize the plane equation. | |
Public Attributes | |
| glm::vec3 | normal |
| Normal vector of the plane. | |
| float | distance |
| Distance from the origin to the plane along the normal. | |
Plane structure.
Represents a plane in 3D space defined by a normal vector and a distance from the origin. Provides methods for calculating the distance from a point to the plane and for normalizing the plane equation.
|
inline |
Default constructor initializing a horizontal plane at the origin.
Initializes the normal to (0, 1, 0) and distance to 0.
|
inline |
Parameterized constructor.
Initializes the plane with specified normal and distance.
| normal | Normal vector of the plane. |
| distance | Distance from the origin to the plane. |
|
inline |
Construct a plane from a point and a normal vector.
Initializes the plane such that it passes through the given point with the specified normal vector.
| point | A point on the plane. |
| normal | Normal vector of the plane. |
|
inline |
Calculate the distance from a point to the plane.
Computes the signed distance from the specified point to the plane.
| point | The point to measure the distance to. |
| void lmgl::scene::Plane::normalize | ( | ) |
Normalize the plane equation.
Normalizes the plane's normal vector and adjusts the distance accordingly.