matrix.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Copyright (C) 2005 Michael Liebscher <johnnycanuck@users.sourceforge.net>
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. /*
  16. * matrix.h: Matrix math routines.
  17. *
  18. * Author: Michael Liebscher <johnnycanuck@users.sourceforge.net>
  19. *
  20. */
  21. #ifndef __MATRIX_H__
  22. #define __MATRIX_H__
  23. #include "vector.h"
  24. typedef float mat3_t[ 9 ]; // 3x3 matrix
  25. typedef float mat4_t[ 16 ]; // 4x4 matrix
  26. extern void Matrix3x3Multiply( mat3_t in1, mat3_t in2, mat3_t out ) ;
  27. extern void MatrixIdentity( mat4_t matrix );
  28. extern void MatrixInvert( mat4_t in, mat4_t out );
  29. extern void VectorMatrixMultiply( vec3_t vecIn, mat4_t m, vec3_t vecOut );
  30. extern void VectorMatrix3x3Multiply( vec3_t vecIn, mat4_t m, vec3_t vecOut );
  31. #endif /* __MATRIX_H__ */