Ray2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: Ray2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Class for 2-D ray.
6 > Created Time: 2017/03/21
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_RAY2_H
10 #define CUBBYFLOW_RAY2_H
11 
12 #include <Core/Ray/Ray.h>
13 #include <Core/Vector/Vector2.h>
14 
15 namespace CubbyFlow
16 {
22  template <typename T>
23  class Ray<T, 2> final
24  {
25  public:
26  static_assert(std::is_floating_point<T>::value, "Ray only can be instantiated with floating point types");
27 
30 
33 
35  Ray();
36 
38  Ray(const Vector2<T>& newOrigin, const Vector2<T>& newDirection);
39 
41  Ray(const Ray& other);
42 
44  Vector2<T> PointAt(T t) const;
45  };
46 
48  template <typename T> using Ray2 = Ray<T, 2>;
49 
51  using Ray2F = Ray2<float>;
52 
55 }
56 
57 #include <Core/Ray/Ray2-Impl.h>
58 
59 #endif
Class for ray.
Definition: Ray.h:23
Class for 2-D ray.
Definition: Ray2.h:23
Vector2< T > origin
The origin of the ray.
Definition: Ray2.h:26
Vector2< T > direction
The direction of the ray.
Definition: Ray2.h:32
Definition: pybind11Utils.h:24
2-D vector class.
Definition: Vector2.h:26