本文整理汇总了C++中CCBone::update方法的典型用法代码示例。如果您正苦于以下问题:C++ CCBone::update方法的具体用法?C++ CCBone::update怎么用?C++ CCBone::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCBone
的用法示例。
在下文中一共展示了CCBone::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void CCBone::update(float delta)
{
if (m_pParentBone)
m_bBoneTransformDirty = m_bBoneTransformDirty || m_pParentBone->isTransformDirty();
if (m_bBoneTransformDirty)
{
if (m_pArmature->getArmatureData()->dataVersion >= VERSION_COMBINED)
{
CCTransformHelp::nodeConcat(*m_pTweenData, *m_pBoneData);
m_pTweenData->scaleX -= 1;
m_pTweenData->scaleY -= 1;
}
CCTransformHelp::nodeToMatrix(*m_pTweenData, m_tWorldTransform);
m_tWorldTransform = CCAffineTransformConcat(nodeToParentTransform(), m_tWorldTransform);
if(m_pParentBone)
{
m_tWorldTransform = CCAffineTransformConcat(m_tWorldTransform, m_pParentBone->m_tWorldTransform);
}
}
CCDisplayFactory::updateDisplay(this, m_pDisplayManager->getCurrentDecorativeDisplay(), delta, m_bBoneTransformDirty || m_pArmature->getArmatureTransformDirty());
CCObject *object = NULL;
CCARRAY_FOREACH(m_pChildren, object)
{
CCBone *childBone = (CCBone *)object;
childBone->update(delta);
}
示例2: update
void CCBone::update(float delta)
{
if (m_pParentBone)
m_bBoneTransformDirty = m_bBoneTransformDirty || m_pParentBone->isTransformDirty();
if (m_pArmatureParentBone && !m_bBoneTransformDirty)
{
m_bBoneTransformDirty = m_pArmatureParentBone->isTransformDirty();
}
if (m_bBoneTransformDirty)
{
if (m_fDataVersion >= VERSION_COMBINED)
{
CCTransformHelp::nodeConcat(*m_pTweenData, *m_pBoneData);
m_pTweenData->scaleX -= 1;
m_pTweenData->scaleY -= 1;
}
m_tWorldInfo->x = m_pTweenData->x + m_obPosition.x;
m_tWorldInfo->y = m_pTweenData->y + m_obPosition.y;
m_tWorldInfo->scaleX = m_pTweenData->scaleX * m_fScaleX;
m_tWorldInfo->scaleY = m_pTweenData->scaleY * m_fScaleY;
m_tWorldInfo->skewX = m_pTweenData->skewX + m_fSkewX + m_fRotationX;
m_tWorldInfo->skewY = m_pTweenData->skewY + m_fSkewY - m_fRotationY;
if(m_pParentBone)
{
applyParentTransform(m_pParentBone);
}
else
{
if (m_pArmatureParentBone)
{
applyParentTransform(m_pArmatureParentBone);
}
}
CCTransformHelp::nodeToMatrix(*m_tWorldInfo, m_tWorldTransform);
if (m_pArmatureParentBone)
{
m_tWorldTransform = CCAffineTransformConcat(m_tWorldTransform, m_pArmature->nodeToParentTransform());
}
}
CCDisplayFactory::updateDisplay(this, delta, m_bBoneTransformDirty || m_pArmature->getArmatureTransformDirty());
CCObject *object = NULL;
CCARRAY_FOREACH(m_pChildren, object)
{
CCBone *childBone = (CCBone *)object;
childBone->update(delta);
}