当前位置: 首页>>代码示例>>C++>>正文


C++ CCBone::update方法代码示例

本文整理汇总了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);
    }
开发者ID:boosheng,项目名称:cocos2d-x-1,代码行数:32,代码来源:CCBone.cpp

示例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);
    }
开发者ID:2youyou2,项目名称:cocos2d-x,代码行数:54,代码来源:CCBone.cpp


注:本文中的CCBone::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。