Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

glt/matrix.h

Go to the documentation of this file.
00001 #ifndef GLT_MATRIX_H
00002 #define GLT_MATRIX_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit      
00007   Copyright (C) 2000-2002 Nigel Stewart
00008   Email: nigels.com@gmail.com   WWW: http://www.nigels.com/glt/
00009 
00010   This library is free software; you can redistribute it and/or
00011   modify it under the terms of the GNU Lesser General Public
00012   License as published by the Free Software Foundation; either
00013   version 2.1 of the License, or (at your option) any later version.
00014 
00015   This library is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018   Lesser General Public License for more details.
00019 
00020   You should have received a copy of the GNU Lesser General Public
00021   License along with this library; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // TRANSLATE
00071 //
00072 
00077 inline void glTranslate(const Vector &tr) { glTranslated(tr.x(),tr.y(),tr.z()); }
00078 
00079 //
00080 // SCALE
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 // ROTATE
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

Generated on Tue Nov 5 11:11:03 2002 for GLT by doxygen1.2.18