本文整理汇总了C++中C_BaseAnimating::DontRecordInTools方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseAnimating::DontRecordInTools方法的具体用法?C++ C_BaseAnimating::DontRecordInTools怎么用?C++ C_BaseAnimating::DontRecordInTools使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseAnimating
的用法示例。
在下文中一共展示了C_BaseAnimating::DontRecordInTools方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupModel
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CModelPanel::SetupModel( void )
{
if ( !m_pModelInfo )
return;
MDLCACHE_CRITICAL_SECTION();
// remove any current models we're using
DeleteModelData();
const char *pszModelName = GetModelName();
if ( !pszModelName || !pszModelName[0] )
return;
// create the new model
CModelPanelModel *pEnt = new CModelPanelModel;
if ( !pEnt )
return;
if ( pEnt->InitializeAsClientEntity( pszModelName, false ) == false )
{
// we failed to initialize this entity so just return gracefully
pEnt->Remove();
return;
}
// setup the handle
m_hModel = pEnt;
pEnt->DontRecordInTools();
pEnt->AddEffects( EF_NODRAW ); // don't let the renderer draw the model normally
if ( m_pModelInfo->m_nSkin >= 0 )
{
pEnt->SetSkin( m_pModelInfo->m_nSkin );
}
// do we have any animation information?
if ( m_pModelInfo->m_Animations.Count() > 0 && m_pModelInfo->m_Animations.IsValidIndex( m_iDefaultAnimation ) )
{
CModelPanelModelAnimation *pAnim = m_pModelInfo->m_Animations[ m_iDefaultAnimation ];
int sequence = ACT_INVALID;
if ( pAnim->m_pszActivity && pAnim->m_pszActivity[0] )
{
Activity activity = (Activity)ActivityList_IndexForName( pAnim->m_pszActivity );
sequence = pEnt->SelectWeightedSequence( activity );
}
else if ( pAnim->m_pszSequence && pAnim->m_pszSequence[0] )
{
sequence = pEnt->LookupSequence( pAnim->m_pszSequence );
}
if ( sequence != ACT_INVALID )
{
pEnt->ResetSequence( sequence );
pEnt->SetCycle( 0 );
if ( pAnim->m_pPoseParameters )
{
for ( KeyValues *pData = pAnim->m_pPoseParameters->GetFirstSubKey(); pData != NULL; pData = pData->GetNextKey() )
{
const char *pName = pData->GetName();
float flValue = pData->GetFloat();
pEnt->SetPoseParameter( pName, flValue );
}
}
pEnt->m_flAnimTime = gpGlobals->curtime;
}
}
// setup any attached models
for ( int i = 0 ; i < m_pModelInfo->m_AttachedModelsInfo.Count() ; i++ )
{
CModelPanelAttachedModelInfo *pInfo = m_pModelInfo->m_AttachedModelsInfo[i];
C_BaseAnimating *pTemp = new C_BaseAnimating;
if ( pTemp )
{
if ( pTemp->InitializeAsClientEntity( pInfo->m_pszModelName, false ) == false )
{
// we failed to initialize this model so just skip it
pTemp->Remove();
continue;
}
pTemp->DontRecordInTools();
pTemp->AddEffects( EF_NODRAW ); // don't let the renderer draw the model normally
pTemp->FollowEntity( m_hModel.Get() ); // attach to parent model
if ( pInfo->m_nSkin >= 0 )
{
pTemp->SetSkin( pInfo->m_nSkin );
}
pTemp->m_flAnimTime = gpGlobals->curtime;
//.........这里部分代码省略.........