本文整理汇总了C++中C_BaseAnimating::GetCycle方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseAnimating::GetCycle方法的具体用法?C++ C_BaseAnimating::GetCycle怎么用?C++ C_BaseAnimating::GetCycle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseAnimating
的用法示例。
在下文中一共展示了C_BaseAnimating::GetCycle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerFrameUpdate
void C_PortalGhostRenderable::PerFrameUpdate( void )
{
if( m_pGhostedRenderable )
{
SetModelName( m_pGhostedRenderable->GetModelName() );
SetModelIndex( m_pGhostedRenderable->GetModelIndex() );
SetEffects( m_pGhostedRenderable->GetEffects() | EF_NOINTERP );
m_flAnimTime = m_pGhostedRenderable->m_flAnimTime;
if( m_bSourceIsBaseAnimating )
{
C_BaseAnimating *pSource = (C_BaseAnimating *)m_pGhostedRenderable;
SetCycle( pSource->GetCycle() );
SetSequence( pSource->GetSequence() );
m_nBody = pSource->m_nBody;
m_nSkin = pSource->m_nSkin;
}
}
// Set position and angles relative to the object it's ghosting
Vector ptNewOrigin = m_matGhostTransform * m_pGhostedRenderable->GetAbsOrigin();
QAngle qNewAngles = TransformAnglesToWorldSpace( m_pGhostedRenderable->GetAbsAngles(), m_matGhostTransform.As3x4() );
SetAbsOrigin( ptNewOrigin );
SetAbsAngles( qNewAngles );
AddEffects( EF_NOINTERP );
RemoveFromInterpolationList();
g_pClientLeafSystem->RenderableChanged( RenderHandle() );
}
示例2: 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() );
}
}
示例3: OnBind
virtual void OnBind( C_BaseEntity *pC_BaseEntity )
{
C_BaseAnimating *pBaseAnimating = pC_BaseEntity ? pC_BaseEntity->GetBaseAnimating() : NULL;
if ( pBaseAnimating )
{
float fCycle = pBaseAnimating->GetCycle();
float f = RemapValClamped( fCycle, m_fStart, m_fEnd, 0.0f, 1.0f );
if ( m_bEaseIn && m_bEaseOut )
{
f = SimpleSpline( f );
}
else if ( m_bEaseIn )
{
f = sin( M_PI * f * 0.5f );
}
else if ( m_bEaseOut )
{
f = 1.0f - sin( M_PI * f * 0.5f + 0.5f * M_PI );
}
MaterialVarType_t resultType;
int vecSize;
ComputeResultType( resultType, vecSize );
switch( resultType )
{
case MATERIAL_VAR_TYPE_VECTOR:
{
Vector4D vec( f, f, f, f );
m_pResult->SetVecValue( vec.Base(), vecSize );
}
break;
case MATERIAL_VAR_TYPE_FLOAT:
case MATERIAL_VAR_TYPE_INT:
default:
m_pResult->SetFloatValue( f );
break;
}
}
}