rays 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. checksums.yaml +5 -5
  2. data/.doc/ext/rays/bitmap.cpp +22 -76
  3. data/.doc/ext/rays/bounds.cpp +95 -125
  4. data/.doc/ext/rays/color.cpp +224 -45
  5. data/.doc/ext/rays/color_space.cpp +137 -45
  6. data/.doc/ext/rays/defs.cpp +183 -0
  7. data/.doc/ext/rays/font.cpp +39 -21
  8. data/.doc/ext/rays/image.cpp +26 -37
  9. data/.doc/ext/rays/matrix.cpp +186 -29
  10. data/.doc/ext/rays/native.cpp +12 -6
  11. data/.doc/ext/rays/noise.cpp +53 -0
  12. data/.doc/ext/rays/painter.cpp +120 -308
  13. data/.doc/ext/rays/point.cpp +82 -77
  14. data/.doc/ext/rays/polygon.cpp +287 -0
  15. data/.doc/ext/rays/polygon_line.cpp +96 -0
  16. data/.doc/ext/rays/polyline.cpp +161 -0
  17. data/.doc/ext/rays/rays.cpp +0 -13
  18. data/.doc/ext/rays/shader.cpp +83 -9
  19. data/README.md +1 -1
  20. data/Rakefile +21 -9
  21. data/VERSION +1 -1
  22. data/ext/rays/bitmap.cpp +22 -80
  23. data/ext/rays/bounds.cpp +100 -128
  24. data/ext/rays/color.cpp +232 -51
  25. data/ext/rays/color_space.cpp +140 -46
  26. data/ext/rays/defs.cpp +183 -0
  27. data/ext/rays/defs.h +26 -2
  28. data/ext/rays/extconf.rb +1 -2
  29. data/ext/rays/font.cpp +39 -22
  30. data/ext/rays/image.cpp +27 -39
  31. data/ext/rays/matrix.cpp +198 -30
  32. data/ext/rays/native.cpp +12 -6
  33. data/ext/rays/noise.cpp +55 -0
  34. data/ext/rays/painter.cpp +129 -315
  35. data/ext/rays/point.cpp +89 -81
  36. data/ext/rays/polygon.cpp +301 -0
  37. data/ext/rays/polygon_line.cpp +99 -0
  38. data/ext/rays/polyline.cpp +170 -0
  39. data/ext/rays/rays.cpp +0 -14
  40. data/ext/rays/shader.cpp +84 -9
  41. data/include/rays.h +10 -2
  42. data/include/rays/bitmap.h +14 -26
  43. data/include/rays/bounds.h +21 -4
  44. data/include/rays/color.h +25 -14
  45. data/include/rays/color_space.h +11 -8
  46. data/include/rays/coord.h +114 -0
  47. data/include/rays/debug.h +22 -0
  48. data/include/rays/defs.h +3 -0
  49. data/include/rays/font.h +4 -4
  50. data/include/rays/image.h +11 -17
  51. data/include/rays/matrix.h +50 -24
  52. data/include/rays/noise.h +42 -0
  53. data/include/rays/opengl.h +2 -50
  54. data/include/rays/painter.h +57 -99
  55. data/include/rays/point.h +44 -51
  56. data/include/rays/polygon.h +164 -0
  57. data/include/rays/polyline.h +65 -0
  58. data/include/rays/rays.h +3 -0
  59. data/include/rays/ruby.h +7 -1
  60. data/include/rays/ruby/bounds.h +1 -1
  61. data/include/rays/ruby/color.h +1 -1
  62. data/include/rays/ruby/color_space.h +1 -1
  63. data/include/rays/ruby/font.h +1 -1
  64. data/include/rays/ruby/matrix.h +1 -1
  65. data/include/rays/ruby/point.h +1 -1
  66. data/include/rays/ruby/polygon.h +52 -0
  67. data/include/rays/ruby/polyline.h +41 -0
  68. data/include/rays/ruby/shader.h +1 -1
  69. data/include/rays/shader.h +36 -8
  70. data/lib/rays.rb +6 -1
  71. data/lib/rays/bitmap.rb +0 -15
  72. data/lib/rays/bounds.rb +17 -23
  73. data/lib/rays/color.rb +20 -47
  74. data/lib/rays/color_space.rb +13 -13
  75. data/lib/rays/image.rb +2 -6
  76. data/lib/rays/matrix.rb +28 -0
  77. data/lib/rays/module.rb +4 -19
  78. data/lib/rays/painter.rb +60 -97
  79. data/lib/rays/point.rb +13 -21
  80. data/lib/rays/polygon.rb +50 -0
  81. data/lib/rays/polygon_line.rb +36 -0
  82. data/lib/rays/polyline.rb +32 -0
  83. data/lib/rays/shader.rb +20 -1
  84. data/rays.gemspec +5 -7
  85. data/src/bitmap.h +36 -0
  86. data/src/bounds.cpp +74 -11
  87. data/src/color.cpp +58 -23
  88. data/src/color_space.cpp +50 -32
  89. data/src/color_space.h +22 -0
  90. data/src/coord.cpp +170 -0
  91. data/src/coord.h +35 -0
  92. data/src/font.cpp +118 -0
  93. data/src/font.h +64 -0
  94. data/src/frame_buffer.cpp +37 -71
  95. data/src/frame_buffer.h +4 -4
  96. data/src/image.cpp +171 -97
  97. data/src/image.h +25 -0
  98. data/src/ios/bitmap.mm +107 -105
  99. data/src/ios/font.mm +48 -60
  100. data/src/ios/helper.h +2 -2
  101. data/src/ios/opengl.mm +19 -4
  102. data/src/ios/rays.mm +3 -0
  103. data/src/matrix.cpp +111 -26
  104. data/src/matrix.h +30 -0
  105. data/src/noise.cpp +74 -0
  106. data/src/opengl.cpp +9 -27
  107. data/src/opengl.h +37 -0
  108. data/src/osx/bitmap.mm +111 -106
  109. data/src/osx/font.mm +48 -61
  110. data/src/osx/helper.h +2 -2
  111. data/src/osx/opengl.mm +19 -83
  112. data/src/osx/rays.mm +3 -0
  113. data/src/painter.cpp +780 -696
  114. data/src/painter.h +24 -0
  115. data/src/point.cpp +140 -119
  116. data/src/polygon.cpp +1100 -0
  117. data/src/polygon.h +32 -0
  118. data/src/polyline.cpp +158 -0
  119. data/src/polyline.h +67 -0
  120. data/src/render_buffer.cpp +11 -4
  121. data/src/render_buffer.h +2 -2
  122. data/src/shader.cpp +163 -106
  123. data/src/shader.h +38 -0
  124. data/src/shader_program.cpp +533 -0
  125. data/src/{program.h → shader_program.h} +28 -16
  126. data/src/shader_source.cpp +140 -0
  127. data/src/shader_source.h +52 -0
  128. data/src/texture.cpp +136 -160
  129. data/src/texture.h +65 -0
  130. data/src/win32/bitmap.cpp +62 -52
  131. data/src/win32/font.cpp +11 -13
  132. data/src/win32/font.h +24 -0
  133. data/src/win32/gdi.h +6 -6
  134. data/test/helper.rb +0 -3
  135. data/test/test_bitmap.rb +31 -7
  136. data/test/test_bounds.rb +36 -0
  137. data/test/test_color.rb +59 -19
  138. data/test/test_color_space.rb +95 -0
  139. data/test/test_image.rb +24 -20
  140. data/test/test_matrix.rb +106 -0
  141. data/test/test_painter.rb +92 -46
  142. data/test/test_painter_shape.rb +57 -0
  143. data/test/test_point.rb +21 -0
  144. data/test/test_polygon.rb +234 -0
  145. data/test/test_polygon_line.rb +167 -0
  146. data/test/test_polyline.rb +145 -0
  147. data/test/test_shader.rb +9 -9
  148. metadata +88 -67
  149. data/.doc/ext/rays/texture.cpp +0 -138
  150. data/ext/rays/texture.cpp +0 -149
  151. data/include/rays/ruby/texture.h +0 -41
  152. data/include/rays/texture.h +0 -71
  153. data/lib/rays/texture.rb +0 -24
  154. data/src/program.cpp +0 -648
  155. data/test/test_texture.rb +0 -27
@@ -1,7 +1,8 @@
1
1
  // -*- objc -*-
2
- #include "rays/font.h"
2
+ #include "../font.h"
3
3
 
4
4
 
5
+ #import <CoreGraphics/CGContext.h>
5
6
  #import <CoreText/CoreText.h>
6
7
  #include "rays/exception.h"
7
8
  #include "helper.h"
@@ -11,7 +12,7 @@ namespace Rays
11
12
  {
12
13
 
13
14
 
14
- struct Font::Data
15
+ struct RawFont::Data
15
16
  {
16
17
 
17
18
  CTFontRef font;
@@ -30,7 +31,7 @@ namespace Rays
30
31
  }
31
32
  }
32
33
 
33
- };// Font::Data
34
+ };// RawFont::Data
34
35
 
35
36
 
36
37
  static CTLineRef
@@ -64,29 +65,61 @@ namespace Rays
64
65
  }
65
66
 
66
67
 
67
- Font::Font ()
68
+ RawFont::RawFont ()
68
69
  {
69
70
  }
70
71
 
71
- Font::Font (const char* name, coord size)
72
+ RawFont::RawFont (const char* name, coord size)
72
73
  {
73
74
  self->font = name
74
75
  ? CTFontCreateWithName(cfstring(name).get(), size, NULL)
75
76
  : CTFontCreateUIFontForLanguage(kCTFontSystemFontType, size, NULL);
76
77
  }
77
78
 
78
- Font::~Font ()
79
+ RawFont::~RawFont ()
79
80
  {
80
81
  }
81
82
 
82
- Font
83
- Font::copy () const
83
+ void
84
+ RawFont::draw_string (
85
+ void* context_, coord context_height,
86
+ const char* str, coord x, coord y) const
84
87
  {
85
- return Font(name(), size());
88
+ CGContextRef context = (CGContextRef) context_;
89
+
90
+ if (!*this || !context || !str)
91
+ argument_error(__FILE__, __LINE__);
92
+
93
+ if (*str == '\0') return;
94
+
95
+ CTLineRef line = make_line(self->font, str);
96
+ if (!line)
97
+ rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
98
+
99
+ coord width = 0, height = 0, ascent = 0;
100
+ width = get_width(str);
101
+ height = get_height(&ascent);
102
+
103
+ height = ceil(height);
104
+ ascent = floor(ascent);
105
+
106
+ CGRect rect = CGRectMake(x, context_height - height - y, width, height);
107
+ CGContextClearRect(context, rect);
108
+ //CGContextSetRGBFillColor(context, 0, 0, 0, 1);
109
+ //CGContextFillRect(context, rect);
110
+ CGContextSetRGBFillColor(context, 1, 1, 1, 1);
111
+
112
+ CGContextSaveGState(context);
113
+ CGContextSetTextMatrix(context, CGAffineTransformIdentity);
114
+ CGContextSetTextPosition(context, x, context_height - ascent - y);
115
+ CTLineDraw(line, context);
116
+ CGContextRestoreGState(context);
117
+
118
+ CFRelease(line);
86
119
  }
87
120
 
88
121
  String
89
- Font::name () const
122
+ RawFont::name () const
90
123
  {
91
124
  if (!*this) return "";
92
125
 
@@ -102,14 +135,14 @@ namespace Rays
102
135
  }
103
136
 
104
137
  coord
105
- Font::size () const
138
+ RawFont::size () const
106
139
  {
107
140
  if (!*this) return 0;
108
141
  return CTFontGetSize(self->font);
109
142
  }
110
143
 
111
144
  coord
112
- Font::get_width (const char* str) const
145
+ RawFont::get_width (const char* str) const
113
146
  {
114
147
  if (!str)
115
148
  argument_error(__FILE__, __LINE__);
@@ -130,7 +163,7 @@ namespace Rays
130
163
  }
131
164
 
132
165
  coord
133
- Font::get_height (coord* ascent, coord* descent, coord* leading) const
166
+ RawFont::get_height (coord* ascent, coord* descent, coord* leading) const
134
167
  {
135
168
  if (!*this)
136
169
  invalid_state_error(__FILE__, __LINE__);
@@ -146,61 +179,16 @@ namespace Rays
146
179
  return asc + desc + lead;
147
180
  }
148
181
 
149
- Font::operator bool () const
182
+ RawFont::operator bool () const
150
183
  {
151
184
  return !!self->font;
152
185
  }
153
186
 
154
187
  bool
155
- Font::operator ! () const
188
+ RawFont::operator ! () const
156
189
  {
157
190
  return !operator bool();
158
191
  }
159
192
 
160
193
 
161
- const Font&
162
- default_font ()
163
- {
164
- static const Font FONT(NULL);
165
- return FONT;
166
- }
167
-
168
-
169
- void
170
- draw_string (
171
- CGContextRef context, coord context_height,
172
- const char* str, coord x, coord y, const Font& font)
173
- {
174
- if (!context || !str || !font)
175
- argument_error(__FILE__, __LINE__);
176
-
177
- if (*str == '\0') return;
178
-
179
- CTLineRef line = make_line(font.self->font, str);
180
- if (!line)
181
- rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
182
-
183
- coord width = 0, height = 0, ascent = 0;
184
- width = font.get_width(str);
185
- height = font.get_height(&ascent);
186
-
187
- height = ceil(height);
188
- ascent = floor(ascent);
189
-
190
- CGRect rect = CGRectMake(x, context_height - height - y, width, height);
191
- CGContextClearRect(context, rect);
192
- //CGContextSetRGBFillColor(context, 0, 0, 0, 1);
193
- //CGContextFillRect(context, rect);
194
- CGContextSetRGBFillColor(context, 1, 1, 1, 1);
195
-
196
- CGContextSaveGState(context);
197
- CGContextSetTextMatrix(context, CGAffineTransformIdentity);
198
- CGContextSetTextPosition(context, x, context_height - ascent - y);
199
- CTLineDraw(line, context);
200
- CGContextRestoreGState(context);
201
-
202
- CFRelease(line);
203
- }
204
-
205
-
206
194
  }// Rays
@@ -4,7 +4,7 @@
4
4
  #define __RAYS_SRC_OSX_HELPER_H__
5
5
 
6
6
 
7
- #include <boost/shared_ptr.hpp>
7
+ #include <memory>
8
8
  #include <CoreFoundation/CoreFoundation.h>
9
9
 
10
10
 
@@ -15,7 +15,7 @@ namespace Rays
15
15
  void safe_cfrelease (CFTypeRef ref);
16
16
 
17
17
 
18
- typedef boost::shared_ptr<const __CFString> CFString;
18
+ typedef std::shared_ptr<const __CFString> CFString;
19
19
 
20
20
  CFString cfstring (const char* str);
21
21
 
@@ -1,5 +1,5 @@
1
1
  // -*- objc -*-
2
- #include "rays/opengl.h"
2
+ #include "../opengl.h"
3
3
 
4
4
 
5
5
  #include <vector>
@@ -11,10 +11,25 @@ namespace Rays
11
11
 
12
12
 
13
13
  void
14
- init_offscreen_context ()
14
+ OpenGL_set_context (Context context)
15
15
  {
16
- EAGLContext* c = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES1];
17
- [EAGLContext setCurrentContext: c];
16
+ [EAGLContext setCurrentContext: (EAGLContext*) context];
17
+ }
18
+
19
+ Context
20
+ OpenGL_get_context ()
21
+ {
22
+ return [EAGLContext currentContext];
23
+ }
24
+
25
+
26
+ Context
27
+ get_offscreen_context ()
28
+ {
29
+ static Context context = NULL;
30
+ if (!context)
31
+ context = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES3];
32
+ return context;
18
33
  }
19
34
 
20
35
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  #import <Foundation/Foundation.h>
6
6
  #include "rays/exception.h"
7
+ #include "../opengl.h"
7
8
 
8
9
 
9
10
  namespace Rays
@@ -27,6 +28,8 @@ namespace Rays
27
28
  rays_error(__FILE__, __LINE__, "Rays::init(): already initialized.");
28
29
 
29
30
  global::pool = [[NSAutoreleasePool alloc] init];
31
+
32
+ OpenGL_set_context(get_offscreen_context());
30
33
  }
31
34
 
32
35
  void
@@ -1,25 +1,33 @@
1
- #include "rays/matrix.h"
1
+ #include "matrix.h"
2
+
3
+
4
+ #include <glm/mat4x4.hpp>
5
+ #include <glm/gtc/matrix_transform.hpp>
6
+ #include "xot/util.h"
7
+ #include "rays/exception.h"
8
+ #include "rays/point.h"
9
+ #include "coord.h"
2
10
 
3
11
 
4
12
  namespace Rays
5
13
  {
6
14
 
7
15
 
8
- Matrix::Matrix (float value)
16
+ Matrix::Matrix (coord value)
9
17
  {
10
18
  reset(value);
11
19
  }
12
20
 
13
21
  Matrix::Matrix (
14
- float a1, float a2, float a3, float a4,
15
- float b1, float b2, float b3, float b4,
16
- float c1, float c2, float c3, float c4,
17
- float d1, float d2, float d3, float d4)
22
+ coord x0, coord x1, coord x2, coord x3,
23
+ coord y0, coord y1, coord y2, coord y3,
24
+ coord z0, coord z1, coord z2, coord z3,
25
+ coord w0, coord w1, coord w2, coord w3)
18
26
  {
19
- reset(a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4);
27
+ reset(x0, x1, x2, x3, y0, y1, y2, y3, z0, z1, z2, z3, w0, w1, w2, w3);
20
28
  }
21
29
 
22
- Matrix::Matrix (const float* elements, size_t size)
30
+ Matrix::Matrix (const coord* elements, size_t size)
23
31
  {
24
32
  reset(elements, size);
25
33
  }
@@ -31,7 +39,7 @@ namespace Rays
31
39
  }
32
40
 
33
41
  Matrix&
34
- Matrix::reset (float value)
42
+ Matrix::reset (coord value)
35
43
  {
36
44
  return reset(
37
45
  value, 0, 0, 0,
@@ -42,50 +50,127 @@ namespace Rays
42
50
 
43
51
  Matrix&
44
52
  Matrix::reset (
45
- float a1, float a2, float a3, float a4,
46
- float b1, float b2, float b3, float b4,
47
- float c1, float c2, float c3, float c4,
48
- float d1, float d2, float d3, float d4)
49
- {
50
- this->a1 = a1; this->a2 = a2; this->a3 = a3; this->a4 = a4;
51
- this->b1 = b1; this->b2 = b2; this->b3 = b3; this->b4 = b4;
52
- this->c1 = c1; this->c2 = c2; this->c3 = c3; this->c4 = c4;
53
- this->d1 = d1; this->d2 = d2; this->d3 = d3; this->d4 = d4;
53
+ coord x0, coord x1, coord x2, coord x3,
54
+ coord y0, coord y1, coord y2, coord y3,
55
+ coord z0, coord z1, coord z2, coord z3,
56
+ coord w0, coord w1, coord w2, coord w3)
57
+ {
58
+ this->x0 = x0; this->x1 = x1; this->x2 = x2; this->x3 = x3;
59
+ this->y0 = y0; this->y1 = y1; this->y2 = y2; this->y3 = y3;
60
+ this->z0 = z0; this->z1 = z1; this->z2 = z2; this->z3 = z3;
61
+ this->w0 = w0; this->w1 = w1; this->w2 = w2; this->w3 = w3;
62
+ return *this;
63
+ }
64
+
65
+ Matrix&
66
+ Matrix::reset (const coord* elements, size_t size)
67
+ {
68
+ if (size != 16)
69
+ argument_error(__FILE__, __LINE__);
70
+
71
+ const coord* e = elements;
72
+ x0 = e[ 0]; x1 = e[ 1]; x2 = e[ 2]; x3 = e[ 3];
73
+ y0 = e[ 4]; y1 = e[ 5]; y2 = e[ 6]; y3 = e[ 7];
74
+ z0 = e[ 8]; z1 = e[ 9]; z2 = e[10]; z3 = e[11];
75
+ w0 = e[12]; w1 = e[13]; w2 = e[14]; w3 = e[15];
76
+ return *this;
77
+ }
78
+
79
+ Matrix&
80
+ Matrix::translate (coord x, coord y, coord z)
81
+ {
82
+ to_glm(*this) = glm::translate(to_glm(*this), Vec3(x, y, z));
83
+ return *this;
84
+ }
85
+
86
+ Matrix&
87
+ Matrix::translate (const Coord3& translate)
88
+ {
89
+ to_glm(*this) = glm::translate(to_glm(*this), to_glm(translate));
90
+ return *this;
91
+ }
92
+
93
+ Matrix&
94
+ Matrix::scale (coord x, coord y, coord z)
95
+ {
96
+ to_glm(*this) = glm::scale(to_glm(*this), Vec3(x, y, z));
97
+ return *this;
98
+ }
99
+
100
+ Matrix&
101
+ Matrix::scale (const Coord3& scale)
102
+ {
103
+ to_glm(*this) = glm::scale(to_glm(*this), to_glm(scale));
104
+ return *this;
105
+ }
106
+
107
+ Matrix&
108
+ Matrix::rotate (float degree, coord x, coord y, coord z)
109
+ {
110
+ to_glm(*this) = glm::rotate(
111
+ to_glm(*this), (float) Xot::deg2rad(degree), Vec3(x, y, z));
54
112
  return *this;
55
113
  }
56
114
 
57
115
  Matrix&
58
- Matrix::reset (const float* elements, size_t size)
116
+ Matrix::rotate (float degree, const Coord3& axis)
59
117
  {
60
- if (size != 16) return *this;
61
- float* e = array;
62
- for (int i = 0; i < 16; ++i) *e++ = *elements++;
118
+ to_glm(*this) = glm::rotate(
119
+ to_glm(*this), (float) Xot::deg2rad(degree), to_glm(axis));
63
120
  return *this;
64
121
  }
65
122
 
66
- float&
123
+ coord&
67
124
  Matrix::at (int row, int column)
68
125
  {
69
126
  return array[column * 4 + row];
70
127
  }
71
128
 
72
- float
129
+ coord
73
130
  Matrix::at (int row, int column) const
74
131
  {
75
132
  return const_cast<Matrix*>(this)->at(row, column);
76
133
  }
77
134
 
78
- float&
135
+ String
136
+ Matrix::inspect () const
137
+ {
138
+ return Xot::stringf(
139
+ "%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f",
140
+ x0, x1, x2, x3, y0, y1, y2, y3, z0, z1, z2, z3, w0, w1, w2, w3);
141
+ }
142
+
143
+ coord&
79
144
  Matrix::operator [] (int index)
80
145
  {
81
146
  return array[index];
82
147
  }
83
148
 
84
- float
149
+ coord
85
150
  Matrix::operator [] (int index) const
86
151
  {
87
152
  return const_cast<Matrix*>(this)->operator[](index);
88
153
  }
89
154
 
155
+ Matrix&
156
+ Matrix::operator *= (const Matrix& rhs)
157
+ {
158
+ to_glm(*this) *= to_glm(rhs);
159
+ return *this;
160
+ }
161
+
162
+ Point
163
+ Matrix::operator * (const Point& rhs) const
164
+ {
165
+ Vec4 v = to_glm(*this) * Vec4(rhs.x, rhs.y, rhs.z, 1);
166
+ return to_rays<Point>(Vec3(v));
167
+ }
168
+
169
+ Matrix
170
+ Matrix::operator * (const Matrix& rhs) const
171
+ {
172
+ return to_rays(to_glm(*this) * to_glm(rhs));
173
+ }
174
+
90
175
 
91
176
  }// Rays
@@ -0,0 +1,30 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __RAYS_SRC_MATRIX_H__
4
+ #define __RAYS_SRC_MATRIX_H__
5
+
6
+
7
+ #include <glm/mat4x4.hpp>
8
+ #include <rays/matrix.h>
9
+
10
+
11
+ namespace Rays
12
+ {
13
+
14
+
15
+ typedef glm::tmat4x4<coord> Mat4;
16
+
17
+
18
+ inline Mat4& to_glm ( Matrix& val) {return *( Mat4*) &val;}
19
+
20
+ inline const Mat4& to_glm (const Matrix& val) {return *(const Mat4*) &val;}
21
+
22
+ inline Matrix& to_rays ( Mat4& val) {return *( Matrix*) &val;}
23
+
24
+ inline const Matrix& to_rays (const Mat4& val) {return *(const Matrix*) &val;}
25
+
26
+
27
+ }// Rays
28
+
29
+
30
+ #endif//EOH