本文整理汇总了C++中C_BaseAnimating::GetSequenceName方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseAnimating::GetSequenceName方法的具体用法?C++ C_BaseAnimating::GetSequenceName怎么用?C++ C_BaseAnimating::GetSequenceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseAnimating
的用法示例。
在下文中一共展示了C_BaseAnimating::GetSequenceName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ComputeSurroundingBox
void CCollisionProperty::ComputeSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs )
{
if (( GetSolid() == SOLID_CUSTOM ) && (m_nSurroundType != USE_GAME_CODE ))
{
// NOTE: This can only happen in transition periods, say during network
// reception on the client. We expect USE_GAME_CODE to be used with SOLID_CUSTOM
*pVecWorldMins = GetCollisionOrigin();
*pVecWorldMaxs = *pVecWorldMins;
return;
}
switch( m_nSurroundType )
{
case USE_OBB_COLLISION_BOUNDS:
Assert( GetSolid() != SOLID_CUSTOM );
ComputeOBBBounds( pVecWorldMins, pVecWorldMaxs );
break;
case USE_BEST_COLLISION_BOUNDS:
Assert( GetSolid() != SOLID_CUSTOM );
ComputeCollisionSurroundingBox( (GetSolid() == SOLID_VPHYSICS), pVecWorldMins, pVecWorldMaxs );
break;
case USE_ROTATION_EXPANDED_SEQUENCE_BOUNDS:
ComputeRotationExpandedSequenceBounds( pVecWorldMins, pVecWorldMaxs );
break;
case USE_COLLISION_BOUNDS_NEVER_VPHYSICS:
Assert( GetSolid() != SOLID_CUSTOM );
ComputeCollisionSurroundingBox( false, pVecWorldMins, pVecWorldMaxs );
break;
case USE_HITBOXES:
ComputeHitboxSurroundingBox( pVecWorldMins, pVecWorldMaxs );
break;
case USE_ROTATION_EXPANDED_BOUNDS:
ComputeRotationExpandedBounds( pVecWorldMins, pVecWorldMaxs );
break;
case USE_SPECIFIED_BOUNDS:
VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMins, *pVecWorldMins );
VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMaxs, *pVecWorldMaxs );
break;
case USE_GAME_CODE:
GetOuter()->ComputeWorldSpaceSurroundingBox( pVecWorldMins, pVecWorldMaxs );
Assert( pVecWorldMins->x <= pVecWorldMaxs->x );
Assert( pVecWorldMins->y <= pVecWorldMaxs->y );
Assert( pVecWorldMins->z <= pVecWorldMaxs->z );
return;
}
//#ifdef DEBUG
#ifdef CLIENT_DLL
if ( cl_show_bounds_errors.GetBool() && ( m_nSurroundType == USE_ROTATION_EXPANDED_SEQUENCE_BOUNDS ) )
{
// For debugging purposes, make sure the bounds actually does surround the thing.
// Otherwise the optimization we were using isn't really all that great, is it?
Vector vecTestMins, vecTestMaxs;
if ( GetOuter()->GetBaseAnimating() )
{
GetOuter()->GetBaseAnimating()->InvalidateBoneCache();
}
ComputeHitboxSurroundingBox( &vecTestMins, &vecTestMaxs );
Assert( vecTestMins.x >= pVecWorldMins->x && vecTestMins.y >= pVecWorldMins->y && vecTestMins.z >= pVecWorldMins->z );
Assert( vecTestMaxs.x <= pVecWorldMaxs->x && vecTestMaxs.y <= pVecWorldMaxs->y && vecTestMaxs.z <= pVecWorldMaxs->z );
if ( vecTestMins.x < pVecWorldMins->x || vecTestMins.y < pVecWorldMins->y || vecTestMins.z < pVecWorldMins->z ||
vecTestMaxs.x > pVecWorldMaxs->x || vecTestMaxs.y > pVecWorldMaxs->y || vecTestMaxs.z > pVecWorldMaxs->z )
{
const char *pSeqName = "<unknown seq>";
C_BaseAnimating *pAnim = GetOuter()->GetBaseAnimating();
if ( pAnim )
{
int nSequence = pAnim->GetSequence();
pSeqName = pAnim->GetSequenceName( nSequence );
}
Warning( "*** Bounds problem, index %d Eng %s, Seqeuence %s ", GetOuter()->entindex(), GetOuter()->GetClassname(), pSeqName );
Vector vecDelta = *pVecWorldMins - vecTestMins;
Vector vecDelta2 = vecTestMaxs - *pVecWorldMaxs;
if ( vecDelta.x > 0.0f || vecDelta2.x > 0.0f || vecDelta.y > 0.0f || vecDelta2.y > 0.0f )
{
Msg( "Outside X/Y by %.2f ", MAX( MAX( vecDelta.x, vecDelta2.x ), MAX( vecDelta.y, vecDelta2.y ) ) );
}
if ( vecDelta.z > 0.0f || vecDelta2.z > 0.0f )
{
Msg( "Outside Z by (below) %.2f, (above) %.2f ", MAX( vecDelta.z, 0.0f ), MAX( vecDelta2.z, 0.0f ) );
}
Msg( "\n" );
char pTemp[MAX_PATH];
Q_snprintf( pTemp, sizeof(pTemp), "%s [seq: %s]", GetOuter()->GetClassname(), pSeqName );
debugoverlay->AddBoxOverlay( vec3_origin, vecTestMins, vecTestMaxs, vec3_angle, 255, 0, 0, 0, 2 );
debugoverlay->AddBoxOverlay( vec3_origin, *pVecWorldMins, *pVecWorldMaxs, vec3_angle, 0, 0, 255, 0, 2 );
debugoverlay->AddTextOverlay( ( vecTestMins + vecTestMaxs ) * 0.5f, 2, pTemp );
}
//.........这里部分代码省略.........