mirror of https://github.com/axmolengine/axmol.git
add loadIdentityMatrix in Director
This commit is contained in:
parent
106a0da87b
commit
78eea4a735
|
@ -461,6 +461,26 @@ void Director::popMatrix(MATRIX_STACK_TYPE type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Director::loadIdentityMatrix(MATRIX_STACK_TYPE type)
|
||||||
|
{
|
||||||
|
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)
|
||||||
|
{
|
||||||
|
kmMat4Identity(&_modelViewMatrixStack.top());
|
||||||
|
}
|
||||||
|
else if(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION == type)
|
||||||
|
{
|
||||||
|
kmMat4Identity(&_projectionMatrixStack.top());
|
||||||
|
}
|
||||||
|
else if(MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE == type)
|
||||||
|
{
|
||||||
|
kmMat4Identity(&_textureMatrixStack.top());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCASSERT(false, "unknow matrix stack type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Director::loadMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat)
|
void Director::loadMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat)
|
||||||
{
|
{
|
||||||
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)
|
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)
|
||||||
|
|
|
@ -84,15 +84,15 @@ and when to execute the Scenes.
|
||||||
- GL_COLOR_ARRAY is enabled
|
- GL_COLOR_ARRAY is enabled
|
||||||
- GL_TEXTURE_COORD_ARRAY is enabled
|
- GL_TEXTURE_COORD_ARRAY is enabled
|
||||||
*/
|
*/
|
||||||
|
enum class MATRIX_STACK_TYPE
|
||||||
|
{
|
||||||
|
MATRIX_STACK_MODELVIEW,
|
||||||
|
MATRIX_STACK_PROJECTION,
|
||||||
|
MATRIX_STACK_TEXTURE
|
||||||
|
};
|
||||||
|
|
||||||
class CC_DLL Director : public Ref
|
class CC_DLL Director : public Ref
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
enum class MATRIX_STACK_TYPE
|
|
||||||
{
|
|
||||||
MATRIX_STACK_MODELVIEW,
|
|
||||||
MATRIX_STACK_PROJECTION,
|
|
||||||
MATRIX_STACK_TEXTURE
|
|
||||||
};
|
|
||||||
private:
|
private:
|
||||||
std::stack<kmMat4> _modelViewMatrixStack;
|
std::stack<kmMat4> _modelViewMatrixStack;
|
||||||
std::stack<kmMat4> _projectionMatrixStack;
|
std::stack<kmMat4> _projectionMatrixStack;
|
||||||
|
@ -102,6 +102,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
void pushMatrix(MATRIX_STACK_TYPE type);
|
void pushMatrix(MATRIX_STACK_TYPE type);
|
||||||
void popMatrix(MATRIX_STACK_TYPE type);
|
void popMatrix(MATRIX_STACK_TYPE type);
|
||||||
|
void loadIdentityMatrix(MATRIX_STACK_TYPE type);
|
||||||
void loadMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
|
void loadMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
|
||||||
void multiplyMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
|
void multiplyMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
|
||||||
kmMat4 getMatrix(MATRIX_STACK_TYPE type);
|
kmMat4 getMatrix(MATRIX_STACK_TYPE type);
|
||||||
|
|
Loading…
Reference in New Issue