Loading...
Searching...
No Matches
Ray.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_RAY_HPP
12#define CUBBYFLOW_RAY_HPP
13
15
16namespace CubbyFlow
17{
24template <typename T, size_t N>
25class Ray final
26{
27 public:
28 static_assert(N > 0, "Dimension should be greater than 0");
29 static_assert(std::is_floating_point<T>::value,
30 "Ray only can be instantiated with floating point types");
31
33
36
39
41 Ray();
42
44 Ray(const VectorType& newOrigin, const VectorType& newDirection);
45
47 ~Ray() = default;
48
50 Ray(const Ray& other);
51
53 Ray(Ray&& other) noexcept;
54
56 Ray& operator=(const Ray& other);
57
59 Ray& operator=(Ray&& other) noexcept;
60
62 [[nodiscard]] VectorType PointAt(T t) const;
63};
64
65template <typename T>
67
68template <typename T>
70
72
74
76
78} // namespace CubbyFlow
79
81
82#endif
Definition Matrix.hpp:30
Class for N-D ray.
Definition Ray.hpp:26
VectorType direction
The direction of the ray.
Definition Ray.hpp:38
~Ray()=default
Default destructor.
VectorType origin
The origin of the ray.
Definition Ray.hpp:35
Ray & operator=(const Ray &other)
Copy assignment operator.
Definition Ray-Impl.hpp:44
VectorType PointAt(T t) const
Returns a point on the ray at distance t.
Definition Ray-Impl.hpp:60
Ray()
Constructs an empty ray that points (1, 0, ...) from (0, 0, ...).
Definition Ray-Impl.hpp:17
Definition pybind11Utils.hpp:21