Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

m_matrix.cpp

Go to the documentation of this file.
00001 // OMICRON ENGINE HEADER FILE
00002 //
00003 // --------------------------------------------------------------------------
00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de>
00005 //
00006 // This file is part of the Omicron Engine.
00007 //
00008 // The Omicron Engine is free software; you can redistribute it and/or modify
00009 // it under the terms of the  GNU General Public License  as published by the
00010 // Free Software Foundation;  either version  2  of the License,  or (at your
00011 // option) any later version.
00012 //
00013 // The Omicron Engine  is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015 // or  FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License
00016 // for more details.
00017 //
00018 // You should have  received a copy of the  GNU General Public License  along
00019 // with The Omicron Engine;  if not,  write to the  Free Software Foundation,
00020 // Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
00021 //
00022 // --------------------------------------------------------------------------
00023 // Last modified:       $Date: 2002/12/07 19:02:06 $
00024 // By           :       $Author: kolrabi $
00025 // $Id: m_matrix.cpp,v 1.1.1.1 2002/12/07 19:02:06 kolrabi Exp $ 
00026 
00027 /*
00028 
00029   $Log: m_matrix.cpp,v $
00030   Revision 1.1.1.1  2002/12/07 19:02:06  kolrabi
00031   initial release
00032 
00033 
00034 */
00035 
00043 #include            "omicron/internal.h"
00044 #include            <math.h>
00045 
00046 /****************************************************************************
00047  ****************************************************************************
00048  * MATRIX ROUTINES **********************************************************
00049  ****************************************************************************
00050  ****************************************************************************/ 
00051 
00052 /****************************************************************************
00053  * _matrix3_mult                                      multiply two matrices *
00054  ****************************************************************************/
00055 void matrix3_mult( const matrix3_t in1, const matrix3_t in2, matrix3_t out )
00056 {
00057     AssertReturn3(in1, in2, out);
00058 
00059     out[0][0] = in1[0][0] * in2[0][0] + 
00060                 in1[0][1] * in2[1][0] +
00061                 in1[0][2] * in2[2][0];
00062 
00063     out[0][1] = in1[0][0] * in2[0][1] + 
00064                 in1[0][1] * in2[1][1] +
00065                 in1[0][2] * in2[2][1];
00066 
00067     out[0][2] = in1[0][0] * in2[0][2] + 
00068                 in1[0][1] * in2[1][2] +
00069                 in1[0][2] * in2[2][2];
00070 
00071     out[1][0] = in1[1][0] * in2[0][0] + 
00072                 in1[1][1] * in2[1][0] +
00073                 in1[1][2] * in2[2][0];
00074 
00075     out[1][1] = in1[1][0] * in2[0][1] + 
00076                 in1[1][1] * in2[1][1] +
00077                 in1[1][2] * in2[2][1];
00078 
00079     out[1][2] = in1[1][0] * in2[0][2] + 
00080                 in1[1][1] * in2[1][2] +
00081                 in1[1][2] * in2[2][2];
00082 
00083     out[2][0] = in1[2][0] * in2[0][0] + 
00084                 in1[2][1] * in2[1][0] +
00085                 in1[2][2] * in2[2][0];
00086 
00087     out[2][1] = in1[2][0] * in2[0][1] + 
00088                 in1[2][1] * in2[1][1] +
00089                 in1[2][2] * in2[2][1];
00090 
00091     out[2][2] = in1[2][0] * in2[0][2] +
00092                 in1[2][1] * in2[1][2] +
00093                 in1[2][2] * in2[2][2];
00094 }
00095 
00096 // do you think, that's air you're breathing?

Generated on Wed Dec 18 15:48:46 2002 for omicron engine by doxygen1.2.18