Carna  Version 3.3.2
Ray.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef RAY_H_6014714286
13 #define RAY_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/math.h>
17 
22 namespace Carna
23 {
24 
25 namespace base
26 {
27 
28 namespace math
29 {
30 
31 
32 
33 // ----------------------------------------------------------------------------------
34 // Ray
35 // ----------------------------------------------------------------------------------
36 
46 template< typename VectorType >
47 class Ray
48 {
49 
50 public:
51 
52  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
53 
57  typedef VectorType Vector;
58 
62  VectorType origin;
63 
67  VectorType direction;
68 
69 }; // Ray
70 
71 
72 
73 // ----------------------------------------------------------------------------------
74 // Ray3f
75 // ----------------------------------------------------------------------------------
76 
83 class CARNA_LIB Ray3f : public Ray< Vector3f >
84 {
85 
86 public:
87 
91  void fromEye
92  ( unsigned int frameX, unsigned int frameY
93  , const Viewport& vp
94  , const Matrix4f& inverseProjection
95  , const Matrix4f& inverseView );
96 
100  void fromEye
101  ( unsigned int frameX, unsigned int frameY
102  , const Viewport& vp
103  , const Camera& cam );
104 
105 }; // Ray3f
106 
107 
108 
109 } // namespace Carna :: base :: math
110 
111 } // namespace Carna :: base
112 
113 } // namespace Carna
114 
115 #endif // RAY_H_6014714286
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
VectorType Vector
Reflects the VectorType argument this class template was instantiated with.
Definition: Ray.h:57
VectorType origin
Holds the origin of this ray.
Definition: Ray.h:62
Defines ray in where is the Scalar type derived from VectorType and is dimension of VectorType...
Definition: Ray.h:47
Defines ray in .
Definition: Ray.h:83
VectorType direction
Holds the direction of this ray.
Definition: Ray.h:67
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
Represents the point-of-view and defines the 3D to 2D projection.
Definition: Camera.h:39