|
mal-math
C++20 mathematics library.
|
A geometric representation of a sphere in 3D space. More...
#include "sphere.hpp"
Public Member Functions | |
| bool | Intersect (Intersection &i, Ray const &ray) const |
| Determines if a Ray intersects with the Sphere. | |
Static Public Member Functions | |
| static constexpr float | Hit (Ray const &r, vec3 const ¢er, float radius) noexcept |
| Determines the intersection point of a Ray with the Sphere. | |
Public Attributes | |
| vec3 | position { 0 } |
| Position of the sphere's center in 3D space. | |
| float | radius { 1 } |
| Radius of the sphere. | |
A geometric representation of a sphere in 3D space.
Definition at line 17 of file sphere.hpp.
|
inlinestaticconstexprnoexcept |
Determines the intersection point of a Ray with the Sphere.
| r | The ray used for the intersection. |
| center | The center of the sphere. |
| radius | The radius of the sphere. |
Definition at line 27 of file sphere.hpp.
|
inline |
Determines if a Ray intersects with the Sphere.
| i | Contains intersection information that will be updated if an intersection occurs. |
| ray | The ray used for the intersection. |
Definition at line 59 of file sphere.hpp.
| vec3 mal_math::Sphere::position { 0 } |
Position of the sphere's center in 3D space.
Definition at line 74 of file sphere.hpp.
| float mal_math::Sphere::radius { 1 } |
Radius of the sphere.
Definition at line 75 of file sphere.hpp.