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


C++ C_BaseAnimating::SetRenderMode方法代码示例

本文整理汇总了C++中C_BaseAnimating::SetRenderMode方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseAnimating::SetRenderMode方法的具体用法?C++ C_BaseAnimating::SetRenderMode怎么用?C++ C_BaseAnimating::SetRenderMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在C_BaseAnimating的用法示例。


在下文中一共展示了C_BaseAnimating::SetRenderMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ClientThink

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_EntityDissolve::ClientThink( void )
{
    C_BaseAnimating *pAnimating = GetMoveParent() ? GetMoveParent()->GetBaseAnimating() : NULL;
    if (!pAnimating)
        return;

    // NOTE: IsRagdoll means *client-side* ragdoll. We shouldn't be trying to fight
    // the server ragdoll (or any server physics) on the client
    if (( !m_pController ) && ( m_nDissolveType == ENTITY_DISSOLVE_NORMAL ) && pAnimating->IsRagdoll())
    {
        IPhysicsObject *ppList[VPHYSICS_MAX_OBJECT_LIST_COUNT];
        int nCount = pAnimating->VPhysicsGetObjectList( ppList, ARRAYSIZE(ppList) );
        if ( nCount > 0 )
        {
            m_pController = physenv->CreateMotionController( this );
            for ( int i = 0; i < nCount; ++i )
            {
                m_pController->AttachObject( ppList[i], true );
            }
        }
    }

    color32 color;

    color.r = color.g = color.b = ( 1.0f - GetFadeInPercentage() ) * 255.0f;
    color.a = GetModelFadeOutPercentage() * 255.0f;

    // Setup the entity fade
    pAnimating->SetRenderMode( kRenderTransColor );
    pAnimating->SetRenderColor( color.r, color.g, color.b );
    pAnimating->SetRenderAlpha( color.a );

    if ( GetModelFadeOutPercentage() <= 0.2f )
    {
        m_bCoreExplode = true;
    }

    // If we're dead, fade out
    if ( GetFadeOutPercentage() <= 0.0f )
    {
        // Do NOT remove from the client entity list. It'll confuse the local network backdoor, and the entity will never get destroyed
        // because when the server says to destroy it, the client won't be able to find it.
        // ClientEntityList().RemoveEntity( GetClientHandle() );

        partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );

        RemoveFromLeafSystem();

        //FIXME: Ick!
        //Adrian: I'll assume we don't need the ragdoll either so I'll remove that too.
        if ( m_bLinkedToServerEnt == false )
        {
            Release();

            C_ClientRagdoll *pRagdoll = dynamic_cast <C_ClientRagdoll *> ( pAnimating );

            if ( pRagdoll )
            {
                pRagdoll->ReleaseRagdoll();
            }
        }
    }
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:66,代码来源:c_entitydissolve.cpp


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