Página Principal   Hierarquia de Classes   Lista de Componentes   Lista de Arquivos   Componentes Membros  

Matrix.hpp

00001 /*      Matrix.hpp - Morpheous
00002  *
00003  *  $Header: /home/aldon/cvs/Morpheous/include/Matrix.hpp,v 1.3 2003/08/21 02:01:27 aldon Exp $
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 
00021 #ifndef __MATRIX_HPP__
00022 #define __MATRIX_HPP__
00023 
00024 
00025 #include "Vector.hpp"
00026 
00030 enum Axis{X_AXIS, Y_AXIS, Z_AXIS};
00031 
00032 
00036 class Matrix
00037 {
00038 private:
00042     float elements[4][4];
00043 
00047     float det() const;
00048 
00054     void elementaryOperation1(int i, int j);
00055 
00061     void elementaryOperation2(int row, float factor);
00062 
00069     void elementaryOperation3(int i, int j, float factor);
00070 
00071 public:
00072     
00079     float getElement(int i, int j) const;
00080 
00087     void setElement(int i, int j, float value);
00088     
00092     void identity();
00093     
00094     
00099     Vector operator*(const Vector& v) const;
00100 
00104     Matrix operator*(const Matrix& m) const;
00105     
00106 
00110     Matrix invert() const;
00111 
00112 
00119     static Matrix rotation(Axis axis, float angle);
00120 
00121 
00127     static Matrix translation(const Vector& v);
00128     
00134     static Matrix scale(const Vector& v);
00135 };
00136 
00137 
00138 #endif // __MATRIX_HPP__

Gerado em Sun Sep 21 20:18:44 2003 para Morpheous por doxygen1.2.13.1 escrito por Dimitri van Heesch, © 1997-2001