diff options
Diffstat (limited to 'Runtime/Graphics/MatrixStack.h')
-rw-r--r-- | Runtime/Graphics/MatrixStack.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Runtime/Graphics/MatrixStack.h b/Runtime/Graphics/MatrixStack.h new file mode 100644 index 0000000..fe11a18 --- /dev/null +++ b/Runtime/Graphics/MatrixStack.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Runtime/Math/Matrix4x4.h" + + +class MatrixStack +{ +public: + enum { kStackDepth = 16 }; + +public: + MatrixStack() { Reset(); } + + void Reset(); + + void SetMatrix( const float matrix[16] ); + void SetCurrentIdentity(); + void MultMatrix( const float matrix[16] ); + const Matrix4x4f& GetMatrix() const; + + void Push(const float* matrix); + void Push(); + void Pop(); + + int GetCurrentDepth() const { return m_Depth; } + +private: + Matrix4x4f& GetMatrix4x4f (int index); + + Matrix4x4f m_Matrices[kStackDepth]; + int m_Depth; +}; |