summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/matrix_stack.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-04-02 21:45:33 +0800
committerchai <chaifix@163.com>2019-04-02 21:45:33 +0800
commitaf7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 (patch)
tree58611985001b78c5a76b78ae146fdb07dde31c1d /source/modules/asura-core/graphics/matrix_stack.cpp
parent250e30d73f09e9da2b5a81d0fbae63744ae12a73 (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/matrix_stack.cpp')
-rw-r--r--source/modules/asura-core/graphics/matrix_stack.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/source/modules/asura-core/graphics/matrix_stack.cpp b/source/modules/asura-core/graphics/matrix_stack.cpp
new file mode 100644
index 0000000..72ffb7d
--- /dev/null
+++ b/source/modules/asura-core/graphics/matrix_stack.cpp
@@ -0,0 +1,61 @@
+#include "matrix_stack.h"
+
+namespace AsuraEngine
+{
+ namespace Graphics
+ {
+
+ MatrixStack::MatrixStack()
+ : top(0)
+ {
+ // ջʼջô˱֤ջԶǿգȡֵ
+ mStack[top].SetIdentity();
+ }
+
+ MatrixStack::~MatrixStack()
+ {
+ }
+
+ void MatrixStack::LoadIdentity()
+ {
+ mStack[top].SetIdentity();
+ }
+
+ bool MatrixStack::Push()
+ {
+ if (top == ASURA_MAX_MATRIX_STACK_DEPTH - 1)
+ return false;
+ ++top;
+ mStack[top] = mStack[top - 1];
+ return true;
+ }
+
+ bool MatrixStack::Pop()
+ {
+ if (top == 0)
+ return false;
+ --top;
+ return true;
+ }
+
+ AEMath::Matrix44& MatrixStack::GetTop()
+ {
+ return mStack[top];
+ }
+
+ uint MatrixStack::GetTopIndex()
+ {
+ return top;
+ }
+
+ uint MatrixStack::GetCapacity()
+ {
+ return ASURA_MAX_MATRIX_STACK_DEPTH;
+ }
+
+ void MatrixStack::Ortho(float left, float right, float bottom, float top, float near, float far)
+ {
+ }
+
+ }
+} \ No newline at end of file