Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOOpenGLMatrixManager.m
Go to the documentation of this file.
1/*
2
3OOOpenGLMatrixManager.m
4
5Manages OpenGL Model, View, etc. matrices.
6
7Oolite
8Copyright (C) 2004-2014 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
29#import "MyOpenGLView.h"
30#import "Universe.h"
31#import "OOMacroOpenGL.h"
32
34{
35 "ooliteModelView",
36 "ooliteProjection",
37 "ooliteModelViewProjection",
38 "ooliteNormalMatrix",
39 "ooliteModelViewInverse",
40 "ooliteProjectionInverse",
41 "ooliteModelViewProjectionInverse",
42 "ooliteModelViewTranspose",
43 "ooliteProjectionTranspose",
44 "ooliteModelViewProjectionTranspose",
45 "ooliteModelViewInverseTranspose",
46 "ooliteProjectionInverseTranspose",
47 "ooliteModelViewProjectionInverseTranspose"
48};
49
50@implementation OOOpenGLMatrixStack
51
52- (id) init
53{
54 if ((self = [super init]))
55 {
56 stack = [[NSMutableArray alloc] init];
57 }
58 return self;
59}
60
61- (void) dealloc
62{
63 [stack release];
64 [super dealloc];
65}
66
67- (void) push: (OOMatrix) matrix
68{
69 [stack addObject: [NSValue valueWithBytes: &matrix objCType: @encode(OOMatrix)]];
70}
71
72- (OOMatrix) pop
73{
74 if ([stack count] == 0)
75 {
76 return kIdentityMatrix;
77 }
78 OOMatrix matrix;
79 [[stack lastObject] getValue: &matrix];
80 [stack removeLastObject];
81 return matrix;
82}
83
84- (NSUInteger) stackCount
85{
86 return [stack count];
87}
88
89
90@end
91
93
94- (void) updateModelView;
95- (void) updateProjection;
96
97@end
98
100
101- (void) updateModelView
102{
103 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION] = NO;
104 valid[OOLITE_GL_MATRIX_NORMAL] = NO;
105 valid[OOLITE_GL_MATRIX_MODELVIEW_INVERSE] = NO;
106 valid[OOLITE_GL_MATRIX_PROJECTION_INVERSE] = NO;
107 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE] = NO;
108 valid[OOLITE_GL_MATRIX_MODELVIEW_TRANSPOSE] = NO;
109 valid[OOLITE_GL_MATRIX_PROJECTION_TRANSPOSE] = NO;
110 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_TRANSPOSE] = NO;
111 valid[OOLITE_GL_MATRIX_MODELVIEW_INVERSE_TRANSPOSE] = NO;
112 valid[OOLITE_GL_MATRIX_PROJECTION_INVERSE_TRANSPOSE] = NO;
113 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE_TRANSPOSE] = NO;
114}
115
116- (void) updateProjection
117{
118 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION] = NO;
119 valid[OOLITE_GL_MATRIX_PROJECTION_INVERSE] = NO;
120 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE] = NO;
121 valid[OOLITE_GL_MATRIX_PROJECTION_TRANSPOSE] = NO;
122 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_TRANSPOSE] = NO;
123 valid[OOLITE_GL_MATRIX_PROJECTION_INVERSE_TRANSPOSE] = NO;
124 valid[OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE_TRANSPOSE] = NO;
125}
126
127@end
128
129@implementation OOOpenGLMatrixManager
130
131- (id) init
132{
133 if ((self = [super init]))
134 {
135 int i;
136 for (i = 0; i < OOLITE_GL_MATRIX_END; i++)
137 {
138 switch(i)
139 {
142 matrices[i] = kIdentityMatrix;
143 valid[i] = YES;
144 break;
145
146 default:
147 valid[i] = NO;
148 break;
149 }
150 }
151 modelViewStack = [[OOOpenGLMatrixStack alloc] init];
152 projectionStack = [[OOOpenGLMatrixStack alloc] init];
153 }
154 return self;
155}
156
157- (void) dealloc
158{
159 [modelViewStack release];
160 [projectionStack release];
161 [super dealloc];
162}
163
164- (void) loadModelView: (OOMatrix) matrix
165{
166 matrices[OOLITE_GL_MATRIX_MODELVIEW] = matrix;
167 [self updateModelView];
168 return;
169}
170
171- (void) resetModelView
172{
173 matrices[OOLITE_GL_MATRIX_MODELVIEW] = kIdentityMatrix;
174 [self updateModelView];
175}
176
177- (void) multModelView: (OOMatrix) matrix
178{
179 matrices[OOLITE_GL_MATRIX_MODELVIEW] = OOMatrixMultiply(matrix, matrices[OOLITE_GL_MATRIX_MODELVIEW]);
180 [self updateModelView];
181}
182
183- (void) translateModelView: (Vector) vector
184{
185 OOMatrix matrix = kIdentityMatrix;
186 matrix.m[3][0] = vector.x;
187 matrix.m[3][1] = vector.y;
188 matrix.m[3][2] = vector.z;
189 [self multModelView: matrix];
190}
191
192- (void) rotateModelView: (GLfloat) angle axis: (Vector) axis
193{
194 [self multModelView: OOMatrixForRotation(axis, angle)];
195}
196
197- (void) scaleModelView: (Vector) scale
198{
199 [self multModelView: OOMatrixForScale(scale.x, scale.y, scale.z)];
200}
201
202- (void) lookAtWithEye: (Vector) eye center: (Vector) center up: (Vector) up
203{
204 Vector k = vector_normal(vector_subtract(eye, center));
205 Vector i = cross_product(up, k);
206 Vector j = cross_product(k, i);
207 OOMatrix m1 = OOMatrixConstruct
208 (
209 i.x, j.x, k.x, 0.0,
210 i.y, j.y, k.y, 0.0,
211 i.z, j.z, k.z, 0.0,
212 -eye.x, -eye.y, -eye.z, 1.0
213 );
214 [self multModelView: m1];
215 return;
216}
217
218
219- (void) pushModelView
220{
221 [modelViewStack push: matrices[OOLITE_GL_MATRIX_MODELVIEW]];
222}
223
224- (OOMatrix) popModelView
225{
226 matrices[OOLITE_GL_MATRIX_MODELVIEW] = [modelViewStack pop];
227 [self updateModelView];
228 return matrices[OOLITE_GL_MATRIX_MODELVIEW];
229}
230
231- (OOMatrix) getModelView
232{
233 return matrices[OOLITE_GL_MATRIX_MODELVIEW];
234}
235
236- (NSUInteger) countModelView
237{
238 return [modelViewStack stackCount];
239}
240
241- (void) syncModelView
242{
244 OOGL(glMatrixMode(GL_MODELVIEW));
245 GLLoadOOMatrix([self getModelView]);
246 return;
247}
248
249- (void) loadProjection: (OOMatrix) matrix
250{
251 matrices[OOLITE_GL_MATRIX_PROJECTION] = matrix;
252 [self updateProjection];
253 return;
254}
255
256- (void) multProjection: (OOMatrix) matrix
257{
258 matrices[OOLITE_GL_MATRIX_PROJECTION] = OOMatrixMultiply(matrix, matrices[OOLITE_GL_MATRIX_PROJECTION]);
259 [self updateProjection];
260}
261
262- (void) translateProjection: (Vector) vector
263{
264 OOMatrix matrix = kIdentityMatrix;
265 matrix.m[0][3] = vector.x;
266 matrix.m[1][3] = vector.y;
267 matrix.m[2][3] = vector.z;
268 [self multProjection: matrix];
269}
270
271- (void) rotateProjection: (GLfloat) angle axis: (Vector) axis
272{
273 [self multProjection: OOMatrixForRotation(axis, angle)];
274}
275
276- (void) scaleProjection: (Vector) scale
277{
278 [self multProjection: OOMatrixForScale(scale.x, scale.y, scale.z)];
279}
280
281- (void) frustumLeft: (double) l right: (double) r bottom: (double) b top: (double) t near: (double) n far: (double) f
282{
283 if (l == r || t == b || n == f || n <= 0 || f <= 0) return;
284 [self multProjection: OOMatrixConstruct
285 (
286 2*n/(r-l), 0.0, 0.0, 0.0,
287 0.0, 2*n/(t-b), 0.0, 0.0,
288 (r+l)/(r-l), (t+b)/(t-b), -(f+n)/(f-n), -1.0,
289 0.0, 0.0, -2*f*n/(f-n), 0.0
290 )];
291}
292
293- (void) orthoLeft: (double) l right: (double) r bottom: (double) b top: (double) t near: (double) n far: (double) f
294{
295 if (l == r || t == b || n == f) return;
296 [self multProjection: OOMatrixConstruct
297 (
298 2/(r-l), 0.0, 0.0, 0.0,
299 0.0, 2/(t-b), 0.0, 0.0,
300 0.0, 0.0, 2/(n-f), 0.0,
301 (l+r)/(l-r), (b+t)/(b-t), (n+f)/(n-f), 1.0
302 )];
303}
304
305- (void) perspectiveFovy: (double) fovy aspect: (double) aspect zNear: (double) zNear zFar: (double) zFar
306{
307 if (aspect == 0.0 || zNear == zFar) return;
308 double f = 1.0/tan(M_PI * fovy / 360);
309 [self multProjection: OOMatrixConstruct
310 (
311 f/aspect, 0.0, 0.0, 0.0,
312 0.0, f, 0.0, 0.0,
313 0.0, 0.0, (zFar + zNear)/(zNear - zFar), -1.0,
314 0.0, 0.0, 2*zFar*zNear/(zNear - zFar), 0.0
315 )];
316}
317
318- (void) resetProjection
319{
320 matrices[OOLITE_GL_MATRIX_PROJECTION] = kIdentityMatrix;
321 [self updateProjection];
322}
323
324- (void) pushProjection
325{
326 [projectionStack push: matrices[OOLITE_GL_MATRIX_PROJECTION]];
327}
328
329- (OOMatrix) popProjection
330{
331 matrices[OOLITE_GL_MATRIX_PROJECTION] = [projectionStack pop];
332 [self updateProjection];
333 return matrices[OOLITE_GL_MATRIX_PROJECTION];
334}
335
336- (OOMatrix) getProjection
337{
338 return matrices[OOLITE_GL_MATRIX_PROJECTION];
339}
340
341- (void) syncProjection
342{
344 OOGL(glMatrixMode(GL_PROJECTION));
345 GLLoadOOMatrix([self getProjection]);
346 return;
347}
348
349- (OOMatrix) getMatrix: (int) which
350{
351 if (which < 0 || which >= OOLITE_GL_MATRIX_END) return kIdentityMatrix;
352 if (valid[which]) return matrices[which];
353 OOScalar d;
354 switch(which)
355 {
357 matrices[which] = OOMatrixMultiply(matrices[OOLITE_GL_MATRIX_MODELVIEW], matrices[OOLITE_GL_MATRIX_PROJECTION]);
358 break;
360 matrices[which] = matrices[OOLITE_GL_MATRIX_MODELVIEW];
361 matrices[which].m[3][0] = 0.0;
362 matrices[which].m[3][1] = 0.0;
363 matrices[which].m[3][2] = 0.0;
364 matrices[which].m[0][3] = 0.0;
365 matrices[which].m[1][3] = 0.0;
366 matrices[which].m[2][3] = 0.0;
367 matrices[which].m[3][3] = 1.0;
368 matrices[which] = OOMatrixTranspose(OOMatrixInverseWithDeterminant(matrices[which], &d));
369 if (d != 0.0)
370 {
371 d = powf(fabsf(d), 1.0/3);
372 for (int i = 0; i < 3; i++)
373 {
374 for (int j = 0; j < 3; j++)
375 {
376 matrices[which].m[i][j] /= d;
377 }
378 }
379 }
380 break;
382 matrices[which] = OOMatrixInverse(matrices[OOLITE_GL_MATRIX_MODELVIEW]);
383 break;
385 matrices[which] = OOMatrixInverse(matrices[OOLITE_GL_MATRIX_PROJECTION]);
386 break;
388 matrices[which] = OOMatrixInverse([self getMatrix: OOLITE_GL_MATRIX_MODELVIEW_PROJECTION]);
389 break;
391 matrices[which] = OOMatrixTranspose(matrices[OOLITE_GL_MATRIX_MODELVIEW]);
392 break;
394 matrices[which] = OOMatrixTranspose(matrices[OOLITE_GL_MATRIX_PROJECTION]);
395 break;
397 matrices[which] = OOMatrixTranspose([self getMatrix: OOLITE_GL_MATRIX_MODELVIEW_PROJECTION]);
398 break;
400 matrices[which] = OOMatrixTranspose([self getMatrix: OOLITE_GL_MATRIX_MODELVIEW_INVERSE]);
401 break;
403 matrices[which] = OOMatrixTranspose([self getMatrix: OOLITE_GL_MATRIX_PROJECTION_INVERSE]);
404 break;
406 matrices[which] = OOMatrixTranspose([self getMatrix: OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE]);
407 break;
408 }
409 valid[which] = YES;
410 return matrices[which];
411}
412
413- (NSArray*) standardMatrixUniformLocations: (GLhandleARB) program
414{
415 GLint location;
416 NSUInteger i;
417 NSMutableArray *locationSet = [[[NSMutableArray alloc] init] autorelease];
418
420
421 for (i = 0; i < OOLITE_GL_MATRIX_END; i++) {
422 location = glGetUniformLocationARB(program, ooliteStandardMatrixUniforms[i]);
423 if (location >= 0) {
425 {
426 [locationSet addObject:
427 [NSArray arrayWithObjects:
428 [NSNumber numberWithInt: location],
429 [NSNumber numberWithInteger: i],
430 @"mat3",
431 nil]];
432 }
433 else
434 {
435 [locationSet addObject:
436 [NSArray arrayWithObjects:
437 [NSNumber numberWithInt: location],
438 [NSNumber numberWithInteger: i],
439 @"mat4",
440 nil]];
441 }
442 }
443 }
444 return [[NSArray arrayWithArray: locationSet] retain];
445}
446
447@end
448
450{
451 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
452 [matrixManager pushModelView];
453 [matrixManager syncModelView];
454}
455
457{
458 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
459 OOMatrix matrix = [matrixManager popModelView];
460 [matrixManager syncModelView];
461 return matrix;
462}
463
465{
466 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
467 OOMatrix matrix = [matrixManager getModelView];
468 return matrix;
469}
470
472{
473 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
474 [matrixManager resetModelView];
475 [matrixManager syncModelView];
476}
477
478void OOGLLoadModelView(OOMatrix matrix)
479{
480 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
481 [matrixManager loadModelView: matrix];
482 [matrixManager syncModelView];
483}
484
485void OOGLMultModelView(OOMatrix matrix)
486{
487 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
488 [matrixManager multModelView: matrix];
489 [matrixManager syncModelView];
490}
491
492void OOGLTranslateModelView(Vector vector)
493{
494 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
495 [matrixManager translateModelView: vector];
496 [matrixManager syncModelView];
497}
498
499void OOGLRotateModelView(GLfloat angle, Vector axis)
500{
501 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
502 [matrixManager rotateModelView: angle axis: axis];
503 [matrixManager syncModelView];
504}
505
506void OOGLScaleModelView(Vector scale)
507{
508 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
509 [matrixManager scaleModelView: scale];
510 [matrixManager syncModelView];
511}
512
513void OOGLLookAt(Vector eye, Vector center, Vector up)
514{
515 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
516 [matrixManager lookAtWithEye: eye center: center up: up];
517 [matrixManager syncModelView];
518}
519
521{
522 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
523 [matrixManager resetProjection];
524 [matrixManager syncProjection];
525}
526
528{
529 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
530 [matrixManager pushProjection];
531 [matrixManager syncProjection];
532}
533
535{
536 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
537 OOMatrix matrix = [matrixManager popProjection];
538 [matrixManager syncProjection];
539 return matrix;
540}
541
543{
544 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
545 OOMatrix matrix = [matrixManager getProjection];
546 return matrix;
547}
548
549void OOGLLoadProjection(OOMatrix matrix)
550{
551 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
552 [matrixManager loadProjection: matrix];
553 [matrixManager syncProjection];
554}
555
556void OOGLMultProjection(OOMatrix matrix)
557{
558 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
559 [matrixManager multProjection: matrix];
560 [matrixManager syncProjection];
561}
562
563void OOGLTranslateProjection(Vector vector)
564{
565 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
566 [matrixManager translateProjection: vector];
567 [matrixManager syncProjection];
568}
569
570void OOGLRotateProjection(GLfloat angle, Vector axis)
571{
572 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
573 [matrixManager rotateProjection: angle axis: axis];
574 [matrixManager syncProjection];
575}
576
577void OOGLScaleProjection(Vector scale)
578{
579 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
580 [matrixManager scaleProjection: scale];
581 [matrixManager syncProjection];
582}
583
584void OOGLFrustum(double frleft, double frright, double frbottom, double frtop, double frnear, double frfar)
585{
586 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
587 [matrixManager frustumLeft: frleft right: frright bottom: frbottom top: frtop near: frnear far: frfar];
588 [matrixManager syncProjection];
589}
590
591void OOGLOrtho(double orleft, double orright, double orbottom, double ortop, double ornear, double orfar)
592{
593 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
594 [matrixManager orthoLeft: orleft right: orright bottom: orbottom top: ortop near: ornear far: orfar];
595 [matrixManager syncProjection];
596}
597
598void OOGLPerspective(double fovy, double aspect, double zNear, double zFar)
599{
600 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
601 [matrixManager perspectiveFovy: fovy aspect: aspect zNear: zNear zFar: zFar];
602 [matrixManager syncProjection];
603}
604
606{
607 OOOpenGLMatrixManager *matrixManager = [[UNIVERSE gameView] getOpenGLMatrixManager];
608 return [matrixManager getMatrix: OOLITE_GL_MATRIX_MODELVIEW_PROJECTION];
609}
610
#define OO_ENTER_OPENGL()
GLfloat OOScalar
Definition OOMaths.h:64
#define M_PI
Definition OOMaths.h:73
OOMatrix OOMatrixMultiply(OOMatrix a, OOMatrix b)
Definition OOMatrix.m:111
OOMatrix OOMatrixInverseWithDeterminant(OOMatrix M, OOScalar *d)
Definition OOMatrix.m:398
const OOMatrix kIdentityMatrix
Definition OOMatrix.m:31
OOMatrix OOMatrixInverse(OOMatrix M)
Definition OOMatrix.m:393
@ OOLITE_GL_MATRIX_MODELVIEW
@ OOLITE_GL_MATRIX_MODELVIEW_PROJECTION
@ OOLITE_GL_MATRIX_MODELVIEW_INVERSE
@ OOLITE_GL_MATRIX_MODELVIEW_INVERSE_TRANSPOSE
@ OOLITE_GL_MATRIX_PROJECTION
@ OOLITE_GL_MATRIX_PROJECTION_TRANSPOSE
@ OOLITE_GL_MATRIX_PROJECTION_INVERSE
@ OOLITE_GL_MATRIX_PROJECTION_INVERSE_TRANSPOSE
@ OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE_TRANSPOSE
@ OOLITE_GL_MATRIX_NORMAL
@ OOLITE_GL_MATRIX_END
@ OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_TRANSPOSE
@ OOLITE_GL_MATRIX_MODELVIEW_PROJECTION_INVERSE
@ OOLITE_GL_MATRIX_MODELVIEW_TRANSPOSE
const char * ooliteStandardMatrixUniforms[]
void OOGLLoadModelView(OOMatrix matrix)
OOMatrix OOGLGetModelView()
OOMatrix OOGLPopProjection()
void OOGLRotateProjection(GLfloat angle, Vector axis)
void OOGLTranslateProjection(Vector vector)
void OOGLRotateModelView(GLfloat angle, Vector axis)
void OOGLLookAt(Vector eye, Vector center, Vector up)
void OOGLLoadProjection(OOMatrix matrix)
void OOGLScaleProjection(Vector scale)
void OOGLScaleModelView(Vector scale)
void OOGLResetProjection()
void OOGLTranslateModelView(Vector vector)
OOMatrix OOGLGetProjection()
void OOGLMultProjection(OOMatrix matrix)
OOMatrix OOGLPopModelView()
void OOGLPushProjection()
void OOGLPerspective(double fovy, double aspect, double zNear, double zFar)
void OOGLMultModelView(OOMatrix matrix)
void OOGLOrtho(double orleft, double orright, double orbottom, double ortop, double ornear, double orfar)
void OOGLFrustum(double frleft, double frright, double frbottom, double frtop, double frnear, double frfar)
OOMatrix OOGLGetModelViewProjection()
void OOGLResetModelView()
const char * ooliteStandardMatrixUniforms[]
void OOGLPushModelView()
#define OOGL(statement)
Definition OOOpenGL.h:251
unsigned count
void frustumLeft:right:bottom:top:near:far:(double l,[right] double r,[bottom] double b,[top] double t,[near] double n,[far] double f)
void perspectiveFovy:aspect:zNear:zFar:(double fovy,[aspect] double aspect,[zNear] double zNear,[zFar] double zFar)
void multModelView:(OOMatrix matrix)
void loadProjection:(OOMatrix matrix)
void scaleProjection:(Vector scale)
void translateProjection:(Vector vector)
void rotateProjection:axis:(GLfloat angle,[axis] Vector axis)
void rotateModelView:axis:(GLfloat angle,[axis] Vector axis)
void translateModelView:(Vector vector)
void lookAtWithEye:center:up:(Vector eye,[center] Vector center,[up] Vector up)
void loadModelView:(OOMatrix matrix)
void orthoLeft:right:bottom:top:near:far:(double l,[right] double r,[bottom] double b,[top] double t,[near] double n,[far] double f)
void scaleModelView:(Vector scale)
void multProjection:(OOMatrix matrix)