本文整理汇总了C++中CStudioHdr::numflexdesc方法的典型用法代码示例。如果您正苦于以下问题:C++ CStudioHdr::numflexdesc方法的具体用法?C++ CStudioHdr::numflexdesc怎么用?C++ CStudioHdr::numflexdesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStudioHdr
的用法示例。
在下文中一共展示了CStudioHdr::numflexdesc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetActorFlexesForScene
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_SceneEntity::ResetActorFlexesForScene()
{
int nActorCount = m_pScene->GetNumActors();
for( int iActor = 0; iActor < nActorCount; ++iActor )
{
CChoreoActor *pChoreoActor = m_pScene->GetActor( iActor );
if ( !pChoreoActor )
continue;
C_BaseFlex *pFlexActor = FindNamedActor( pChoreoActor );
if ( !pFlexActor )
continue;
CStudioHdr *pStudioHdr = pFlexActor->GetModelPtr();
if ( !pStudioHdr )
continue;
if ( pStudioHdr->numflexdesc() == 0 )
continue;
// Reset the flex weights to their starting position.
LocalFlexController_t iController;
for ( iController = LocalFlexController_t(0); iController < pStudioHdr->numflexcontrollers(); ++iController )
{
pFlexActor->SetFlexWeight( iController, 0.0f );
}
// Reset the prediction interpolation values.
pFlexActor->m_iv_flexWeight.Reset();
}
}
示例2: GetModelPtr
//-----------------------------------------------------------------------------
// Purpose: clear out any face/eye values stored in the material system
//-----------------------------------------------------------------------------
void C_HL2MPRagdoll::SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights )
{
BaseClass::SetupWeights( pBoneToWorld, nFlexWeightCount, pFlexWeights, pFlexDelayedWeights );
static float destweight[128];
static bool bIsInited = false;
CStudioHdr *hdr = GetModelPtr();
if ( !hdr )
return;
int nFlexDescCount = hdr->numflexdesc();
if ( nFlexDescCount )
{
Assert( !pFlexDelayedWeights );
memset( pFlexWeights, 0, nFlexWeightCount * sizeof(float) );
}
if ( m_iEyeAttachment > 0 )
{
matrix3x4_t attToWorld;
if (GetAttachment( m_iEyeAttachment, attToWorld ))
{
Vector local, tmp;
local.Init( 1000.0f, 0.0f, 0.0f );
VectorTransform( local, attToWorld, tmp );
modelrender->SetViewTarget( GetModelPtr(), GetBody(), tmp );
}
}
}
示例3: SetupWeights
//-----------------------------------------------------------------------------
// Purpose: clear out any face/eye values stored in the material system
//-----------------------------------------------------------------------------
void C_ServerRagdoll::SetupWeights( void )
{
BaseClass::SetupWeights( );
static float destweight[MAXSTUDIOFLEXDESC];
static bool bIsInited = false;
CStudioHdr *hdr = GetModelPtr();
if ( !hdr )
{
return;
}
if (hdr->numflexdesc() > 0)
{
if (!bIsInited)
{
int i;
for (i = 0; i < MAXSTUDIOFLEXDESC; i++)
{
destweight[i] = 0.0f;
}
bIsInited = true;
}
modelrender->SetFlexWeights( hdr->numflexdesc(), destweight );
}
if (m_iEyeAttachment > 0)
{
matrix3x4_t attToWorld;
if (GetAttachment( m_iEyeAttachment, attToWorld ))
{
Vector local, tmp;
local.Init( 1000.0f, 0.0f, 0.0f );
VectorTransform( local, attToWorld, tmp );
modelrender->SetViewTarget( tmp );
}
}
}