40 if (std::abs(denom) <= 1e-6f)
45 if (t > i.
t || t <= 0)
67 throw std::invalid_argument(
"Input vectors can't be collinear!");
Represents a geometric ray in 3D space.
vec3 PointAtParameter(float t) const
Computes a point along the ray based on the given parameter.
constexpr vec3 const & origin() const noexcept
Retrieves the ray's origin (const version).
constexpr vec3 const & direction() const noexcept
Retrieves the ray's direction (const version).
Provides functionalities to represent and handle intersections in 3D space.
Contains mathematical utility functions and classes.
constexpr T length(qua< T > const &q) noexcept
Computes the length (or magnitude) of a quaternion.
constexpr T dot(qua< T > const &left, qua< U > const &right) noexcept
Computes the dot product of two quaternions.
constexpr qua< T > normalize(qua< T > const &q) noexcept
Normalizes a quaternion.
constexpr vec< 3, T > cross(qua< T > const &left, vec< 3, U > const &right) noexcept
Cross product between quaternion and vector.
Contains the definition of the Ray class.
Represents the data of a ray's intersection with an object.
float t
The intersection parameter.
vec3 point
The 3D point of intersection.
vec3 normal
The 3D normal at the point of intersection.
Represents a plane in 3D space defined by its normal and two vectors.
void update_plane(vec3 const &first, vec3 const &second)
Updates the plane's vectors and normal based on two new vectors.
vec3 w
The other vector defining the plane.
vec3 normal
The normal to the plane.
bool Intersect(Intersection &i, Ray const &ray) const
Checks for the intersection of the plane with a given ray.
vec3 v
One of the vectors defining the plane.