|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Bounding Sphere structure. More...
#include <frustum.hpp>
Public Member Functions | |
| BoundingSphere () | |
| Default constructor initializing an empty bounding sphere. | |
| BoundingSphere (const glm::vec3 ¢er, float radius) | |
| Parameterized constructor. | |
| BoundingSphere | transform (const glm::mat4 &matrix) const |
| Transform the bounding sphere with a matrix. | |
Static Public Member Functions | |
| static BoundingSphere | from_aabb (const AABB &aabb) |
| Create a bounding sphere from an AABB. | |
Public Attributes | |
| glm::vec3 | center |
| Center point of the bounding sphere. | |
| float | radius |
| Radius of the bounding sphere. | |
Bounding Sphere structure.
Represents a sphere defined by a center point and a radius. Provides methods for creating a bounding sphere from an AABB and for transforming the sphere with a matrix.
|
inline |
Default constructor initializing an empty bounding sphere.
Initializes center to zero vector and radius to zero.
|
inline |
Parameterized constructor.
Initializes the bounding sphere with specified center and radius.
| center | Center point of the sphere. |
| radius | Radius of the sphere. |
|
static |
Create a bounding sphere from an AABB.
Constructs a bounding sphere that encompasses the given AABB.
| aabb | The AABB to create the bounding sphere from. |
| BoundingSphere lmgl::scene::BoundingSphere::transform | ( | const glm::mat4 & | matrix | ) | const |
Transform the bounding sphere with a matrix.
Applies a transformation matrix to the bounding sphere and returns a new transformed sphere.
| matrix | Transformation matrix. |