Ray2-Impl.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: Ray2-Impl.h
3 > Project Name: CubbyFlow
4 > Author: Dongmin Kim
5 > Purpose: Class for 2-D ray.
6 > Created Time: 2017/03/25
7 > Copyright (c) 2018, Dongmin Kim
8 *************************************************************************/
9 #ifndef CUBBYFLOW_RAY2_IMPL_H
10 #define CUBBYFLOW_RAY2_IMPL_H
11 
12 namespace CubbyFlow
13 {
14  template <typename T>
16  Ray(Vector2<T>(), Vector2<T>(1, 0))
17  {
18  // Do nothing
19  }
20 
21  template <typename T>
22  Ray<T, 2>::Ray(const Vector2<T>& newOrigin, const Vector2<T>& newDirection) :
23  origin(newOrigin), direction(newDirection.Normalized())
24  {
25  // Do nothing
26  }
27 
28  template <typename T>
29  Ray<T, 2>::Ray(const Ray& other) :
30  origin(other.origin), direction(other.direction)
31  {
32  // Do nothing
33  }
34 
35  template <typename T>
37  {
38  return origin + t * direction;
39  }
40 }
41 
42 #endif
Class for ray.
Definition: Ray.h:23
Definition: pybind11Utils.h:24
2-D vector class.
Definition: Vector2.h:26