Mercurial > hg > Game > Cerium
annotate Renderer/Engine/Camera.cc @ 1293:82dc8a041cfe draft
refactoring matrix_test.cc
author | Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 02 Dec 2011 15:03:54 +0900 |
parents | 90efd2aac2cb |
children | ab9b7d21b32b |
rev | line source |
---|---|
539 | 1 #include <math.h> |
2 #include "SceneGraphRoot.h" | |
3 #include "Camera.h" | |
1050 | 4 #include "matrix_calc.h" |
539 | 5 #include "Scheduler.h" |
6 #include "TaskManager.h" | |
7 | |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
8 //static SceneGraphRoot *sgroot; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
9 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
10 #if 1 |
539 | 11 static void |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
12 camera_move(SceneGraphPtr _node, void *sgroot_, int screen_w, int screen_h) |
539 | 13 { |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
14 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; |
539 | 15 Pad *pad = sgroot->getController(); |
16 CameraPtr node = (CameraPtr)_node; | |
17 | |
18 #if 0 | |
19 if (pad->right.isHold()) { | |
20 node->xyz[0] += 10.0f; | |
21 } else if (pad->left.isHold()) { | |
22 node->xyz[0] -= 10.0f; | |
23 } | |
24 | |
25 if (pad->up.isPush() || pad->up.isHold()) { | |
26 node->xyz[1] -= 2.0f; | |
27 } else if (pad->down.isPush() || pad->down.isHold()) { | |
28 node->xyz[1] += 2.0f; | |
29 } | |
30 #endif | |
31 | |
32 /* | |
33 * ここに show_dma_wait 表示をいれようか | |
34 */ | |
35 | |
36 /* | |
37 if (pad->r1.isPush()) { | |
38 show_time(manager); | |
39 } | |
40 */ | |
41 | |
42 if (pad->r1.isPush() || pad->r1.isHold()) { | |
43 node->xyz[2] += 10.0f; | |
44 } else if (pad->l1.isPush() || pad->l1.isHold()) { | |
45 node->xyz[2] -= 10.0f; | |
46 } | |
47 | |
48 if (pad->r2.isHold()) { | |
49 if (node->zd[0] <= 1.0f) { | |
50 node->zd[0] += 0.02f; | |
51 } | |
52 if (node->zd[2] >= 0.0f) { | |
53 node->zd[2] -= 0.02f; | |
54 } | |
55 } else if (pad->l2.isHold()) { | |
56 if (node->zd[0] > -1.0f) { | |
57 node->zd[0] -= -0.02f; | |
58 } | |
59 if (node->zd[2] >= 0.0f) { | |
60 node->zd[2] -= 0.02f; | |
61 } | |
62 } else { | |
63 node->zd[0] = 0.0f; | |
64 node->zd[2] = 1.0f; | |
65 } | |
66 | |
67 } | |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
68 #endif |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
69 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
70 #if 0 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
71 static void |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
72 Camera::camera_move(SceneGraphPtr _node, int screen_w, int screen_h) |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
73 { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
74 Pad *pad = sgroot->getController(); |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
75 CameraPtr node = (CameraPtr)_node; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
76 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
77 if (pad->r1.isPush() || pad->r1.isHold()) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
78 node->xyz[2] += 10.0f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
79 } else if (pad->l1.isPush() || pad->l1.isHold()) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
80 node->xyz[2] -= 10.0f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
81 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
82 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
83 if (pad->r2.isHold()) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
84 if (node->zd[0] <= 1.0f) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
85 node->zd[0] += 0.02f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
86 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
87 if (node->zd[2] >= 0.0f) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
88 node->zd[2] -= 0.02f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
89 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
90 } else if (pad->l2.isHold()) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
91 if (node->zd[0] > -1.0f) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
92 node->zd[0] -= -0.02f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
93 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
94 if (node->zd[2] >= 0.0f) { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
95 node->zd[2] -= 0.02f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
96 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
97 } else { |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
98 node->zd[0] = 0.0f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
99 node->zd[2] = 1.0f; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
100 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
101 |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
102 } |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
103 #endif |
539 | 104 |
105 static void | |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
106 camera_collision(SceneGraphPtr node, void *sgroot_,int screen_w, int screen_h, |
539 | 107 SceneGraphPtr tree) |
108 { | |
109 } | |
110 | |
111 /** | |
112 * @param w Width of screen | |
113 * @param h Height of screen | |
114 */ | |
1143 | 115 Camera::Camera(float w, float h, SceneGraphRoot *sgroot_, TaskManager *manager) : SceneGraph(manager) |
539 | 116 { |
1129 | 117 |
539 | 118 name = (char*)"Camera"; |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
119 sgroot = sgroot_; |
539 | 120 |
121 fov = 60.0f; | |
1292
90efd2aac2cb
add matrix test and debug light vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1277
diff
changeset
|
122 near = 100.0f; |
90efd2aac2cb
add matrix test and debug light vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1277
diff
changeset
|
123 far = 1000.0f; |
539 | 124 |
125 zd[0] = 0.0f; | |
126 zd[1] = 0.0f; | |
127 zd[2] = 1.0f; | |
128 zd[3] = 1.0f; | |
129 | |
130 yd[0] = 0.0f; | |
131 yd[1] = 1.0f; | |
132 yd[2] = 0.0f; | |
133 yd[3] = 1.0f; | |
134 | |
135 // Screen の真ん中を初期値とする | |
136 xyz[0] = w/2.0f; | |
137 xyz[1] = h/2.0f; | |
138 | |
139 // min(w, h) がちょうど一杯見えるような z の位置の計算 | |
140 xyz[2] = -(((xyz[1] < xyz[0]) ? xyz[1] : xyz[0])/tanf((fov/2.0f)*M_PI/180.0f)); | |
141 //xyz[2] = -200.0f; | |
142 xyz[3] = 1.0f; | |
143 | |
144 m_view = new float[16]; | |
145 m_pers = new float[16]; | |
146 m_screen = new float[16]; | |
1143 | 147 |
148 //matrix = (float*)malloc(sizeof(float)*16); | |
149 //real_matrix = (float*)malloc(sizeof(float)*16); | |
150 //texture_info = (texture_list*)malloc(sizeof(texture_list)); | |
539 | 151 |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
152 this->set_move_collision(camera_move, camera_collision, (void *)sgroot); |
747 | 153 |
154 for(int i = 0; i < 16; i++) { | |
155 real_matrix[i] = 0; | |
156 if (i % 5 == 0) { | |
157 real_matrix[i] = 1; | |
158 } | |
1140
3975c384ff93
SceneGraph initalize... can worked on Mac OS X. not check Cell arch.
Yutaka_Kinjyo
parents:
1139
diff
changeset
|
159 } |
1129 | 160 |
747 | 161 |
1047
f87218eed9fc
broken texure ( h/w != 2^n ) protection
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
909
diff
changeset
|
162 update(w,h); // to make matrix[] |
539 | 163 } |
164 | |
165 Camera::~Camera(void) | |
166 { | |
167 delete [] m_view; | |
168 delete [] m_pers; | |
169 delete [] m_screen; | |
170 } | |
171 | |
172 void | |
173 Camera::updateView(void) | |
174 { | |
175 float radx,rady,radz; | |
176 float cx[4], cy[4], cz[4], p[4]; | |
177 float tm[16]; | |
178 | |
1254 | 179 radx = angle[0]*M_PI/180; |
180 rady = angle[1]*M_PI/180; | |
181 radz = angle[2]*M_PI/180; | |
539 | 182 |
183 float sinx = sin(radx); | |
184 float cosx = cos(radx); | |
185 float siny = sin(rady); | |
186 float cosy = cos(rady); | |
187 float sinz = sin(radz); | |
188 float cosz = cos(radz); | |
189 | |
190 /* View Transform */ | |
191 tm[0] = cosz*cosy+sinz*sinx*siny; | |
192 tm[1] = sinz*cosx; | |
193 tm[2] = -cosz*siny+sinz*sinx*cosy; | |
194 tm[3] = 0.0f; | |
195 tm[4] = -sinz*cosy+cosz*sinx*siny; | |
196 tm[5] = cosz*cosx; | |
197 tm[6] = sinz*siny+cosz*sinx*cosy; | |
198 tm[7] = 0.0f; | |
199 tm[8] = cosx*siny; | |
200 tm[9] = -sinx; | |
201 tm[10] = cosx*cosy; | |
202 tm[11] = 0.0f; | |
203 tm[12] = 0.0f; | |
204 tm[13] = 0.0f; | |
205 tm[14] = 0.0f; | |
206 tm[15] = 1.0f; | |
207 | |
1276
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
208 /* transform */ |
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
209 |
539 | 210 applyMatrix(cz, tm, zd); |
211 applyMatrix(cy, tm, yd); | |
212 applyMatrix(p, tm, xyz); | |
213 | |
1276
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
214 /* define view axis of coordinates */ |
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
215 |
539 | 216 outerProduct(cx, cy, cz); |
217 normalize(cx, cx); | |
218 normalize(cz, cz); | |
219 outerProduct(cy, cz, cx); | |
220 | |
221 m_view[ 0] = cx[0]; | |
222 m_view[ 1] = cy[0]; | |
223 m_view[ 2] = cz[0]; | |
224 m_view[ 3] = 0.0f; | |
225 | |
226 m_view[ 4] = cx[1]; | |
227 m_view[ 5] = cy[1]; | |
228 m_view[ 6] = cz[1]; | |
229 m_view[ 7] = 0.0f; | |
230 m_view[ 8] = cx[2]; | |
231 m_view[ 9] = cy[2]; | |
232 m_view[10] = cz[2]; | |
233 m_view[11] = 0.0f; | |
234 | |
235 m_view[12] = innerProduct(xyz, cx)*(-1); | |
236 m_view[13] = innerProduct(xyz, cy)*(-1); | |
237 m_view[14] = innerProduct(xyz, cz)*(-1); | |
238 m_view[15] = 1.0f; | |
239 } | |
240 | |
241 void | |
242 Camera::updatePerspective(float w, float h) | |
243 { | |
244 float sx, sy, sz; | |
245 float aspect = w/h; | |
246 | |
247 sy = (1.0f/tanf((fov/2.0f)*M_PI/180.0f)); | |
248 sx = sy/aspect; | |
249 //sz = far/(far+near); | |
250 sz = far/(far-near); | |
251 | |
252 m_pers[ 0] = sx; | |
253 m_pers[ 1] = 0.0f; | |
254 m_pers[ 2] = 0.0f; | |
255 m_pers[ 3] = 0.0f; | |
256 | |
257 m_pers[ 4] = 0.0f; | |
258 m_pers[ 5] = sy; | |
259 m_pers[ 6] = 0.0f; | |
260 m_pers[ 7] = 0.0f; | |
261 | |
262 m_pers[ 8] = 0.0f; | |
263 m_pers[ 9] = 0.0f; | |
264 m_pers[10] = sz; | |
265 m_pers[11] = 1.0f; | |
266 | |
267 m_pers[12] = 0.0f; | |
268 m_pers[13] = 0.0f; | |
269 m_pers[14] = -near*sz; | |
270 m_pers[15] = 0.0f; | |
271 } | |
272 | |
273 void | |
274 Camera::updateScreen(float _w, float _h) | |
275 { | |
276 float w = _w/2.0f; | |
277 float h = _h/2.0f; | |
278 | |
279 m_screen[ 0] = w; | |
280 m_screen[ 1] = 0.0f; | |
281 m_screen[ 2] = 0.0f; | |
282 m_screen[ 3] = 0.0f; | |
283 | |
284 m_screen[ 4] = 0.0f; | |
285 m_screen[ 5] = h; | |
286 m_screen[ 6] = 0.0f; | |
287 m_screen[ 7] = 0.0f; | |
288 | |
289 m_screen[ 8] = 0.0f; | |
290 m_screen[ 9] = 0.0f; | |
291 m_screen[10] = 1.0f; | |
292 m_screen[11] = 0.0f; | |
293 | |
294 m_screen[12] = w; | |
295 m_screen[13] = h; | |
296 m_screen[14] = 0.0f; | |
297 m_screen[15] = 1.0f; | |
298 } | |
299 | |
300 void | |
301 Camera::setCamera(float *pose) | |
302 { | |
303 //memcpy(xyz, &pose[12], sizeof(float)*4); | |
304 } | |
305 | |
306 void | |
307 Camera::update(float w, float h) | |
308 { | |
309 #if 1 | |
310 float tmp[16]; | |
311 | |
312 updateView(); | |
313 updatePerspective(w, h); | |
314 updateScreen(w, h); | |
1292
90efd2aac2cb
add matrix test and debug light vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1277
diff
changeset
|
315 |
539 | 316 matrix4x4(tmp, this->m_pers, this->m_screen); |
317 matrix4x4(this->matrix, this->m_view, tmp); | |
1292
90efd2aac2cb
add matrix test and debug light vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1277
diff
changeset
|
318 |
1276
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
319 /* 法線ベクトル、光源ベクトル に使うビュー座標変換までの行列 */ |
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
320 for (int i = 0; i < 16; i++) this->real_matrix[i] = this->m_view[i]; |
e92f00ed2fc0
apply view matrix to normal vector
Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
1143
diff
changeset
|
321 |
539 | 322 #else |
323 get_matrix(matrix, angle, xyz, NULL); | |
324 #endif | |
325 } |