sandbox
Loading...
Searching...
No Matches
ray.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
22#ifndef LIBSBX_MATH_RAY_HPP_
23#define LIBSBX_MATH_RAY_HPP_
24
25#include <libsbx/math/vector3.hpp>
26
27namespace sbx::math {
28
37class ray {
38
39public:
40
46 ray();
47
56 ray(const vector3& origin, const vector3& direction);
57
63 auto origin() const -> const vector3&;
64
70 auto direction() const -> const vector3&;
71
79 auto point_at(const std::float_t t) const -> vector3;
80
81private:
82
83 vector3 _origin;
84 vector3 _direction;
85
86}; // class ray
87
88} // namespace sbx::math
89
90#endif // LIBSBX_MATH_RAY_HPP_
Definition: vector3.hpp:23
3D ray with normalized direction.
Definition: ray.hpp:37
auto direction() const -> const vector3 &
Returns the ray direction.
Definition: ray.cpp:18
auto point_at(const std::float_t t) const -> vector3
Computes a point along the ray at parameter t.
Definition: ray.cpp:22
ray()
Constructs a default ray.
Definition: ray.cpp:6
auto origin() const -> const vector3 &
Returns the ray origin.
Definition: ray.cpp:14