Merge pull request #7442 from pandamicro/ArmatureTrans

Fixed #5724: Fix armature bone's transform issue
This commit is contained in:
minggo 2014-07-15 14:37:02 +08:00
commit d830580dc3
1 changed files with 7 additions and 6 deletions

View File

@ -160,6 +160,7 @@ void Skin::updateTransform()
//
// calculate the Quad based on the Affine Matrix
//
Mat4 transform = getNodeToParentTransform();
Size &size = _rect.size;
@ -169,13 +170,13 @@ void Skin::updateTransform()
float x2 = x1 + size.width;
float y2 = y1 + size.height;
float x = _transform.m[12];
float y = _transform.m[13];
float x = transform.m[12];
float y = transform.m[13];
float cr = _transform.m[0];
float sr = _transform.m[1];
float cr2 = _transform.m[5];
float sr2 = -_transform.m[4];
float cr = transform.m[0];
float sr = transform.m[1];
float cr2 = transform.m[5];
float sr2 = -transform.m[4];
float ax = x1 * cr - y1 * sr2 + x;
float ay = x1 * sr + y1 * cr2 + y;