Fix collider detection

This commit is contained in:
yinkaile 2013-06-09 13:34:48 +08:00
parent b1a8d48009
commit e7d5ac3211
1 changed files with 7 additions and 1 deletions

View File

@ -79,7 +79,13 @@ void CCDisplayFactory::updateDisplay(CCBone *bone, CCDecorativeDisplay *decoDisp
CCColliderDetector *detector = decoDisplay->getColliderDetector();
if (detector)
{
CCAffineTransform t = CCAffineTransformConcat(bone->nodeToArmatureTransform(), bone->getArmature()->nodeToWorldTransform());
CCNode *node = decoDisplay->getDisplay();
CCAffineTransform displayTransform = node->nodeToParentTransform();
CCPoint anchorPoint = node->getAnchorPointInPoints();
anchorPoint = CCPointApplyAffineTransform(anchorPoint, displayTransform);
displayTransform.tx = anchorPoint.x;
displayTransform.ty = anchorPoint.y;
CCAffineTransform t = CCAffineTransformConcat(displayTransform, bone->getArmature()->nodeToWorldTransform());
detector->updateTransform(t);
}
}