本文整理汇总了C++中CBaseViewModel::StudioFrameAdvance方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::StudioFrameAdvance方法的具体用法?C++ CBaseViewModel::StudioFrameAdvance怎么用?C++ CBaseViewModel::StudioFrameAdvance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::StudioFrameAdvance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Operator_FrameUpdate
void CBaseCombatWeapon::Operator_FrameUpdate( CBaseCombatCharacter *pOperator )
{
StudioFrameAdvance( ); // animate
if ( IsSequenceFinished() )
{
if ( SequenceLoops() )
{
// animation does loop, which means we're playing subtle idle. Might need to fidget.
int iSequence = SelectWeightedSequence( GetActivity() );
if ( iSequence != ACTIVITY_NOT_AVAILABLE )
{
ResetSequence( iSequence ); // Set to new anim (if it's there)
}
}
#if 0
else
{
// animation that just ended doesn't loop! That means we just finished a fidget
// and should return to our heaviest weighted idle (the subtle one)
SelectHeaviestSequence( GetActivity() );
}
#endif
}
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( pOwner == NULL )
return;
CBaseViewModel *vm = pOwner->GetViewModel( m_nViewModelIndex );
if ( vm == NULL )
return;
// HACK: Player weapon and view model often use the same mdl, which results
// in duplicate anim events. For now, let the view model handle the events
// if they're the same, which is the preferred behavior in general.
CStudioHdr *w_hdr = GetModelPtr();
CStudioHdr *v_hdr = vm->GetModelPtr();
if ( w_hdr->GetRenderHdr() != v_hdr->GetRenderHdr() )
{
// Animation events are passed back to the weapon's owner/operator
DispatchAnimEvents( pOperator );
}
// Update and dispatch the viewmodel events
if ( vm != NULL )
{
vm->StudioFrameAdvance();
vm->DispatchAnimEvents( this );
}
}
示例2: Operator_FrameUpdate
void CBaseCombatWeapon::Operator_FrameUpdate( CBaseCombatCharacter *pOperator )
{
StudioFrameAdvance( ); // animate
if ( IsSequenceFinished() )
{
if ( SequenceLoops() )
{
// animation does loop, which means we're playing subtle idle. Might need to fidget.
int iSequence = SelectWeightedSequence( GetActivity() );
if ( iSequence != ACTIVITY_NOT_AVAILABLE )
{
ResetSequence( iSequence ); // Set to new anim (if it's there)
}
}
#if 0
else
{
// animation that just ended doesn't loop! That means we just finished a fidget
// and should return to our heaviest weighted idle (the subtle one)
SelectHeaviestSequence( GetActivity() );
}
#endif
}
// Animation events are passed back to the weapon's owner/operator
DispatchAnimEvents( pOperator );
// Update and dispatch the viewmodel events
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( pOwner == NULL )
return;
CBaseViewModel *vm = pOwner->GetViewModel();
if ( vm != NULL )
{
vm->StudioFrameAdvance();
vm->DispatchAnimEvents( this );
}
}
示例3: Operator_FrameUpdate
void CWarsWeapon::Operator_FrameUpdate( CBaseCombatCharacter *pOperator )
{
BaseClass::Operator_FrameUpdate( pOperator );
if( GetCommander() )
{
CBaseViewModel *vm = GetCommander()->GetViewModel( m_nViewModelIndex );
if ( vm != NULL )
{
#ifndef CLIENT_DLL
vm->StudioFrameAdvance();
vm->DispatchAnimEvents( this );
#else
//if( vm->ShouldPredict() )
// vm->StudioFrameAdvance();
#endif // CLIENT_DLL
}
}
}