]> git.localhorst.tv Git - sdl-test8.git/blob - src/geometry/Ray2D.h
added collision engine, more or less stole gameplay from sdl-test7
[sdl-test8.git] / src / geometry / Ray2D.h
1 /*
2  * Ray2D.h
3  *
4  *  Created on: Apr 25, 2012
5  *      Author: holy
6  */
7
8 #ifndef GEOMETRY_RAY2D_H_
9 #define GEOMETRY_RAY2D_H_
10
11 #include "Vector2D.h"
12
13 namespace geometry {
14
15 template<typename Scalar>
16 class Ray2D {
17
18         public:
19                 explicit Ray2D(const Vector2D<Scalar> &directionUnit = Vector2D<Scalar>(), const Vector2D<Scalar> &origin = Vector2D<Scalar>())
20                                 : direction(directionUnit), origin(origin) { };
21
22         public:
23                 Vector2D<Scalar> &Direction(void) { return direction; };
24                 Vector2D<Scalar> &Origin(void) { return origin; };
25                 const Vector2D<Scalar> &Direction(void) const { return direction; };
26                 const Vector2D<Scalar> &Origin(void) const { return origin; };
27
28         private:
29                 Vector2D<Scalar> direction, origin;
30
31 };
32
33 }
34
35 #endif /* GEOMETRY_RAY2D_H_ */