mirror of https://github.com/axmolengine/axmol.git
remove kmMat4 in Armature
This commit is contained in:
parent
7af4d558c6
commit
866c4ad735
|
@ -113,11 +113,11 @@ void DisplayFactory::updateDisplay(Bone *bone, float dt, bool dirty)
|
||||||
CC_BREAK_IF(!detector->getBody());
|
CC_BREAK_IF(!detector->getBody());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
kmMat4 displayTransform = display->getNodeToParentTransform();
|
Matrix displayTransform = display->getNodeToParentTransform();
|
||||||
Point anchorPoint = display->getAnchorPointInPoints();
|
Point anchorPoint = display->getAnchorPointInPoints();
|
||||||
anchorPoint = PointApplyTransform(anchorPoint, displayTransform);
|
anchorPoint = PointApplyTransform(anchorPoint, displayTransform);
|
||||||
displayTransform.mat[12] = anchorPoint.x;
|
displayTransform.m[12] = anchorPoint.x;
|
||||||
displayTransform.mat[13] = anchorPoint.y;
|
displayTransform.m[13] = anchorPoint.y;
|
||||||
Matrix t = TransformConcat( bone->getArmature()->getNodeToParentTransform(),displayTransform);
|
Matrix t = TransformConcat( bone->getArmature()->getNodeToParentTransform(),displayTransform);
|
||||||
detector->updateTransform(t);
|
detector->updateTransform(t);
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,20 +208,20 @@ Matrix Skin::getNodeToWorldTransform() const
|
||||||
|
|
||||||
Matrix Skin::getNodeToWorldTransformAR() const
|
Matrix Skin::getNodeToWorldTransformAR() const
|
||||||
{
|
{
|
||||||
kmMat4 displayTransform = _transform;
|
Matrix displayTransform = _transform;
|
||||||
Point anchorPoint = _anchorPointInPoints;
|
Point anchorPoint = _anchorPointInPoints;
|
||||||
|
|
||||||
anchorPoint = PointApplyTransform(anchorPoint, displayTransform);
|
anchorPoint = PointApplyTransform(anchorPoint, displayTransform);
|
||||||
|
|
||||||
displayTransform.mat[12] = anchorPoint.x;
|
displayTransform.m[12] = anchorPoint.x;
|
||||||
displayTransform.mat[13] = anchorPoint.y;
|
displayTransform.m[13] = anchorPoint.y;
|
||||||
|
|
||||||
return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(),displayTransform);
|
return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(),displayTransform);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skin::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated)
|
void Skin::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated)
|
||||||
{
|
{
|
||||||
kmMat4 mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
Matrix mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||||
|
|
||||||
//TODO implement z order
|
//TODO implement z order
|
||||||
_quadCommand.init(_globalZOrder, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv);
|
_quadCommand.init(_globalZOrder, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv);
|
||||||
|
|
Loading…
Reference in New Issue