00001 #ifndef GLT_MATRIX_H
00002 #define GLT_MATRIX_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00039 #include <glt/gl.h>
00040
00041 #include <math/vector3.h>
00042
00043
00044
00045
00046
00057 class GltPushMatrix
00058 {
00059 public:
00061 GltPushMatrix(const bool enable = true);
00063 ~GltPushMatrix();
00064
00065 private:
00066 const bool _enable;
00067 };
00068
00069
00070
00071
00072
00077 inline void glTranslate(const Vector &tr) { glTranslated(tr.x(),tr.y(),tr.z()); }
00078
00079
00080
00081
00082
00087 inline void glScale(const Vector &sf) { glScaled(sf.x(),sf.y(),sf.z()); }
00088
00093 inline void glScale(const GLdouble sf) { glScaled(sf,sf,sf); }
00094
00099 inline void glScale(const GLfloat sf) { glScalef(sf,sf,sf); }
00100
00105 inline void glScale(const GLint sf) { const GLfloat _s = (const GLfloat) sf; glScalef(_s,_s,_s); }
00106
00111 inline void glScale(const GLuint sf) { const GLfloat _s = (const GLfloat) sf; glScalef(_s,_s,_s); }
00112
00113
00114
00115
00116
00122 inline void glRotateX(const GLdouble angle,const Vector &axis)
00123 {
00124 glRotated(angle,axis.x(),axis.y(),axis.z());
00125 }
00126
00131 inline void glRotateX(const GLdouble angle) { glRotated(angle,1.0,0.0,0.0); }
00132
00137 inline void glRotateX(const GLfloat angle) { glRotatef(angle,1.0,0.0,0.0); }
00138
00143 inline void glRotateX(const GLint angle) { glRotatef(GLfloat(angle),1.0,0.0,0.0); }
00144
00149 inline void glRotateX(const GLuint angle) { glRotatef(GLfloat(angle),1.0,0.0,0.0); }
00150
00155 inline void glRotateY(const GLdouble angle) { glRotated(angle,0.0,1.0,0.0); }
00156
00161 inline void glRotateY(const GLfloat angle) { glRotatef(angle,0.0,1.0,0.0); }
00162
00167 inline void glRotateY(const GLint angle) { glRotatef(GLfloat(angle),0.0,1.0,0.0); }
00168
00173 inline void glRotateY(const GLuint angle) { glRotatef(GLfloat(angle),0.0,1.0,0.0); }
00174
00179 inline void glRotateZ(const GLdouble angle) { glRotated(angle,0.0,0.0,1.0); }
00180
00185 inline void glRotateZ(const GLfloat angle) { glRotatef(angle,0.0,0.0,1.0); }
00186
00191 inline void glRotateZ(const GLint angle) { glRotatef(GLfloat(angle),0.0,0.0,1.0); }
00192
00197 inline void glRotateZ(const GLuint angle) { glRotatef(GLfloat(angle),0.0,0.0,1.0); }
00198
00199 #endif