VedaMachineDreamcast/MatrixModel.h

Go to the documentation of this file.
00001 /*! \file
00002     \author victorien ferry & www.m4nkind.com
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_MatrixModel_H
00006 #define COM_M4NKIND_MatrixModel_H
00007 
00008 
00009 typedef struct {
00010     float v[4][4];
00011 } sMatrix;
00012 
00013 /*!
00014     \class  MatrixModel
00015     \brief
00016 */
00017 
00018 class MatrixModel
00019 {
00020 /*==================================================================
00021                                 PUBLIC
00022 ==================================================================*/
00023 public:
00024     /*!
00025         \brief  Constructor.
00026     */
00027     MatrixModel(void);
00028     /*!
00029         \brief  Destructor. not virt.
00030     */
00031     ~MatrixModel(void);
00032 
00033     inline  sMatrix *GetMatrix(){ return m_pStack + m_currentIndex; };
00034 
00035     void    LoadId( unsigned int _enum );
00036     void    Translate(float _x,float _y,float _z);
00037     void    Rotate( float _angle,float _x,float _y,float _z);
00038     void    Scale(float _sx,float _sy,float _sz);
00039     void    Push();
00040     void    Pop();
00041 
00042 protected:
00043     static const unsigned int   m_MaximumStackDepth=32;
00044     // we alloc the stack here to manage memory alignment.
00045     unsigned char *pStackAlloc;
00046     // the matrix must be 32 byte memery aligned in soome implementation (SH4 proc)
00047     sMatrix     *m_pStack; //[m_MaximumStackDepth];
00048     //! current valid index in the stack
00049     int m_currentIndex;
00050 };
00051 
00052 
00053 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/