本文整理汇总了C++中C_BaseAnimating::SetModelScale方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseAnimating::SetModelScale方法的具体用法?C++ C_BaseAnimating::SetModelScale怎么用?C++ C_BaseAnimating::SetModelScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseAnimating
的用法示例。
在下文中一共展示了C_BaseAnimating::SetModelScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientThink
//-----------------------------------------------------------------------------
// Purpose:
// Input : timeDelta -
//-----------------------------------------------------------------------------
void C_ASW_AOEGrenade_Projectile::ClientThink( void )
{
float baseScale = m_flScale;
float flTimeLeft = m_flTimeBurnOut - gpGlobals->curtime;
//Account for fading out
if ( ( m_flTimeBurnOut != -1.0f ) && ( flTimeLeft <= 5.0f ) )
{
baseScale *= ( flTimeLeft / 5.0f );
CSoundEnvelopeController::GetController().SoundChangeVolume( m_pLoopedSound, clamp<float>(0.6f * baseScale, 0.0f, 0.6f), 0 );
AOEGrenTargetFXList_t::IndexLocalType_t i = m_hAOETargetEffects.Head();
while ( m_hAOETargetEffects.IsValidIndex(i) )
{
// Are we still buffing this target?
for ( int target = 0; target < m_hAOETargets.Count(); target++ )
{
if ( m_hAOETargetEffects[i].pBuffLoopSound )
{
CSoundEnvelopeController::GetController().SoundChangeVolume( m_hAOETargetEffects[i].pBuffLoopSound, clamp<float>(0.6f * baseScale, 0.0f, 0.6f), 0 );
}
}
i = m_hAOETargetEffects.Next( i );
}
}
if ( baseScale < 0.01f )
return;
//
// Dynamic light
//
if ( m_fStartLightTime == 0.0f )
{
m_fStartLightTime = gpGlobals->curtime;
}
if ( !m_pDLight )
{
m_pDLight = effects->CL_AllocDlight( index );
Color rgbaGrenadeColor = GetGrenadeColor();
m_pDLight->color.r = rgbaGrenadeColor.r();
m_pDLight->color.g = rgbaGrenadeColor.g();
m_pDLight->color.b = rgbaGrenadeColor.b();
m_pDLight->color.exponent = 1;
}
m_pDLight->origin = GetAbsOrigin() + Vector(0, 0, 5); // make the dlight slightly higher than the aoegrenade, so it doesn't bury the light being so close to the ground
if ( m_fLightRadius < 32.0f )
{
m_fLightRadius += flTimeLeft * (1.0f + random->RandomFloat() * 36.0f);
if (m_fLightRadius > 32.0f)
m_fLightRadius = 100.0f;
}
m_pDLight->radius = baseScale * 120 * (m_fLightRadius/32.0f);
if ( flTimeLeft > 4.0f )
{
m_pDLight->die = gpGlobals->curtime + 30.0f;
}
// spehere bubble models
if ( !ShouldSpawnSphere() || !m_hSphereModel.Get() )
return;
C_BaseAnimating *pSphere = static_cast<C_BaseAnimating*>( m_hSphereModel.Get() );
if ( pSphere )
{
float flTimeLeft = m_flTimeBurnOut - gpGlobals->curtime;
float flScale = GetSphereScale();
if ( m_flTimeCreated > 0 && ( gpGlobals->curtime - m_flTimeCreated ) < 0.25f )
{
pSphere->SetModelScale( MIN( ((gpGlobals->curtime - m_flTimeCreated)/0.25f)*flScale, 1.0f ) );
}
else
{
pSphere->SetModelScale( flScale );
}
if ( flTimeLeft < 0.25f )
{
pSphere->SetModelScale( MAX( (flTimeLeft/0.25f)*flScale, 0.01f ) );
}
}
if ( m_fUpdateAttachFXTime < gpGlobals->curtime )
{
AOEGrenTargetFXList_t::IndexLocalType_t i = m_hAOETargetEffects.Head();
//.........这里部分代码省略.........