Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
OOOpenGLMatrixManager.h
Go to the documentation of this file.
1/*
2
3OOOpenGLMatrixManager.h
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
27#import "OOMaths.h"
28
29extern const char* ooliteStandardMatrixUniforms[];
30
31enum
32{
47};
48
49@interface OOOpenGLMatrixStack: NSObject
50{
51@private
52 NSMutableArray *stack;
53}
54
55- (id) init;
56- (void) dealloc;
57- (void) push: (OOMatrix) matrix;
58- (OOMatrix) pop;
59- (NSUInteger) stackCount;
60
61@end
62
63@interface OOOpenGLMatrixManager: NSObject
64{
65@private
66 OOMatrix matrices[OOLITE_GL_MATRIX_END];
67 BOOL valid[OOLITE_GL_MATRIX_END];
70}
71
72- (id) init;
73- (void) dealloc;
74- (void) loadModelView: (OOMatrix) matrix;
75- (void) resetModelView;
76- (void) multModelView: (OOMatrix) matrix;
77- (void) translateModelView: (Vector) vector;
78- (void) rotateModelView: (GLfloat) angle axis: (Vector) axis;
79- (void) scaleModelView: (Vector) scale;
80- (void) lookAtWithEye: (Vector) eye center: (Vector) center up: (Vector) up;
81- (void) pushModelView;
82- (OOMatrix) popModelView;
83- (OOMatrix) getModelView;
84- (NSUInteger) countModelView;
85- (void) syncModelView;
86- (void) loadProjection: (OOMatrix) matrix;
87- (void) multProjection: (OOMatrix) matrix;
88- (void) translateProjection: (Vector) vector;
89- (void) rotateProjection: (GLfloat) angle axis: (Vector) axis;
90- (void) scaleProjection: (Vector) scale;
91- (void) frustumLeft: (double) l right: (double) r bottom: (double) b top: (double) t near: (double) n far: (double) f;
92- (void) orthoLeft: (double) l right: (double) r bottom: (double) b top: (double) t near: (double) n far: (double) f;
93- (void) perspectiveFovy: (double) fovy aspect: (double) aspect zNear: (double) zNear zFar: (double) zFar;
94- (void) resetProjection;
95- (void) pushProjection;
96- (OOMatrix) popProjection;
97- (OOMatrix) getProjection;
98- (void) syncProjection;
99- (OOMatrix) getMatrix: (int) which;
100- (NSArray*) standardMatrixUniformLocations: (GLhandleARB) program;
101
102@end
103
104void OOGLPushModelView(void);
105OOMatrix OOGLPopModelView(void);
106OOMatrix OOGLGetModelView(void);
107void OOGLResetModelView(void);
108void OOGLLoadModelView(OOMatrix matrix);
109void OOGLMultModelView(OOMatrix matrix);
110void OOGLTranslateModelView(Vector vector);
111void OOGLRotateModelView(GLfloat angle, Vector axis);
112void OOGLScaleModelView(Vector scale);
113void OOGLLookAt(Vector eye, Vector center, Vector up);
114
115void OOGLResetProjection(void);
116void OOGLPushProjection(void);
117OOMatrix OOGLPopProjection(void);
118OOMatrix OOGLGetProjection(void);
119void OOGLLoadProjection(OOMatrix matrix);
120void OOGLMultProjection(OOMatrix matrix);
121void OOGLTranslateProjection(Vector vector);
122void OOGLRotateProjection(GLfloat angle, Vector axis);
123void OOGLScaleProjection(Vector scale);
124void OOGLFrustum(double left, double right, double bottom, double top, double near, double far);
125void OOGLOrtho(double left, double right, double bottom, double top, double near, double far);
126void OOGLPerspective(double fovy, double aspect, double zNear, double zFar);
127
128OOMatrix OOGLGetModelViewProjection(void);
129
void OOGLLoadModelView(OOMatrix matrix)
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)
OOMatrix OOGLGetModelView(void)
void OOGLScaleModelView(Vector scale)
void OOGLPushModelView(void)
void OOGLPushProjection(void)
void OOGLResetModelView(void)
void OOGLTranslateModelView(Vector vector)
void OOGLMultProjection(OOMatrix matrix)
OOMatrix OOGLGetProjection(void)
void OOGLFrustum(double left, double right, double bottom, double top, double near, double far)
void OOGLPerspective(double fovy, double aspect, double zNear, double zFar)
void OOGLMultModelView(OOMatrix matrix)
OOMatrix OOGLGetModelViewProjection(void)
OOMatrix OOGLPopModelView(void)
void OOGLResetProjection(void)
void OOGLOrtho(double left, double right, double bottom, double top, double near, double far)
@ 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[]
OOMatrix OOGLPopProjection(void)
OOMatrix matrices[OOLITE_GL_MATRIX_END]
OOOpenGLMatrixStack * projectionStack
OOOpenGLMatrixStack * modelViewStack
BOOL valid[OOLITE_GL_MATRIX_END]