本文整理汇总了C++中EHANDLE::GetBaseAnimating方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::GetBaseAnimating方法的具体用法?C++ EHANDLE::GetBaseAnimating怎么用?C++ EHANDLE::GetBaseAnimating使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EHANDLE
的用法示例。
在下文中一共展示了EHANDLE::GetBaseAnimating方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientThink
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_NPC_Puppet::ClientThink( void )
{
if ( m_hAnimationTarget == NULL )
return;
C_BaseAnimating *pTarget = m_hAnimationTarget->GetBaseAnimating();
if ( pTarget == NULL )
return;
int nTargetSequence = pTarget->GetSequence();
const char *pSequenceName = pTarget->GetSequenceName( nTargetSequence );
int nSequence = LookupSequence( pSequenceName );
if ( nSequence >= 0 )
{
if ( nSequence != GetSequence() )
{
SetSequence( nSequence );
UpdateVisibility();
}
SetCycle( pTarget->GetCycle() );
SetPlaybackRate( pTarget->GetPlaybackRate() );
}
}
示例2: AccumulateLayers
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_NPC_Puppet::AccumulateLayers( CStudioHdr *hdr, Vector pos[], Quaternion q[], float poseparam[], float currentTime, int boneMask )
{
if ( m_hAnimationTarget == NULL )
return;
C_BaseAnimatingOverlay *pTarget = dynamic_cast<C_BaseAnimatingOverlay *>( m_hAnimationTarget->GetBaseAnimating() );
if ( pTarget == NULL )
return;
// resort the layers
int layer[MAX_OVERLAYS];
int i;
for (i = 0; i < MAX_OVERLAYS; i++)
{
layer[i] = MAX_OVERLAYS;
}
for (i = 0; i < pTarget->m_AnimOverlay.Count(); i++)
{
if (pTarget->m_AnimOverlay[i].m_nOrder < MAX_OVERLAYS)
{
layer[pTarget->m_AnimOverlay[i].m_nOrder] = i;
}
}
int j;
for (j = 0; j < MAX_OVERLAYS; j++)
{
i = layer[ j ];
if (i < pTarget->m_AnimOverlay.Count())
{
float fWeight = pTarget->m_AnimOverlay[i].m_flWeight;
if (fWeight > 0)
{
const char *pSequenceName = pTarget->GetSequenceName( pTarget->m_AnimOverlay[i].m_nSequence );
int nSequence = LookupSequence( pSequenceName );
if ( nSequence >= 0 )
{
float fCycle = pTarget->m_AnimOverlay[ i ].m_flCycle;
fCycle = ClampCycle( fCycle, IsSequenceLooping( nSequence ) );
if (fWeight > 1)
fWeight = 1;
AccumulatePose( hdr, NULL, pos, q, nSequence, fCycle, poseparam, boneMask, fWeight, currentTime );
#if _DEBUG
if (Q_stristr( hdr->pszName(), r_sequence_debug.GetString()) != NULL)
{
DevMsgRT( "%6.2f : %30s : %5.3f : %4.2f : %1d\n", currentTime, hdr->pSeqdesc( nSequence ).pszLabel(), fCycle, fWeight, i );
}
#endif
}
}
}
}
}
示例3: BuildTransformations
//-----------------------------------------------------------------------------
// Purpose: We need to slam our position!
//-----------------------------------------------------------------------------
void C_NPC_Puppet::BuildTransformations( CStudioHdr *pStudioHdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed )
{
if ( m_hAnimationTarget && m_nTargetAttachment != -1 )
{
C_BaseAnimating *pTarget = m_hAnimationTarget->GetBaseAnimating();
if ( pTarget )
{
matrix3x4_t matTarget;
pTarget->GetAttachment( m_nTargetAttachment, matTarget );
MatrixCopy( matTarget, GetBoneForWrite( 0 ) );
boneComputed.ClearAll(); // FIXME: Why is this calculated already?
boneComputed.MarkBone( 0 );
}
}
// Call the baseclass
BaseClass::BuildTransformations( pStudioHdr, pos, q, cameraTransform, boneMask, boneComputed );
}