本文整理汇总了C++中IsEffectActive函数的典型用法代码示例。如果您正苦于以下问题:C++ IsEffectActive函数的具体用法?C++ IsEffectActive怎么用?C++ IsEffectActive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsEffectActive函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
//-----------------------------------------------------------------------------
// Purpose: check if weapon viewmodel should be drawn
//-----------------------------------------------------------------------------
bool C_BaseViewModel::ShouldDraw()
{
if ( g_bEngineIsHLTV )
{
return ( HLTVCamera()->GetMode() == OBS_MODE_IN_EYE &&
HLTVCamera()->GetPrimaryTarget() == GetOwner() );
}
#if defined( REPLAY_ENABLED )
else if ( engine->IsReplay() )
{
return ( ReplayCamera()->GetMode() == OBS_MODE_IN_EYE &&
ReplayCamera()->GetPrimaryTarget() == GetOwner() );
}
#endif
else
{
Assert( !IsEffectActive( EF_NODRAW ) );
Assert( GetRenderMode() != kRenderNone );
if ( vm_draw_always.GetBool() )
return true;
if ( GetOwner() != C_BasePlayer::GetLocalPlayer() )
return false;
return BaseClass::ShouldDraw();
}
}
示例2: IsEffectActive
// Alien Swarm weapons use custom bone merge cache so they can pitch the guns up slightly
void C_ASW_Weapon::CalcBoneMerge( CStudioHdr *hdr, int boneMask, CBoneBitList &boneComputed )
{
// For EF_BONEMERGE entities, copy the bone matrices for any bones that have matching names.
bool boneMerge = IsEffectActive(EF_BONEMERGE);
if ( boneMerge || m_pBoneMergeCache )
{
if ( boneMerge )
{
if ( !m_pBoneMergeCache )
{
m_pBoneMergeCache = new CASW_Bone_Merge_Cache;
m_pBoneMergeCache->Init( this );
}
CASW_Bone_Merge_Cache *pASWBoneMergeCache = static_cast<CASW_Bone_Merge_Cache*>( m_pBoneMergeCache );
pASWBoneMergeCache->MergeMatchingBones( boneMask, boneComputed, ShouldAlignWeaponToLaserPointer(), m_vecLaserPointerDirection );
int iAttachment = GetMuzzleAttachment();
if ( iAttachment > 0 && m_pLaserPointerEffect )
{
Vector vecOrigin;
QAngle angWeapon;
GetAttachment( iAttachment, vecOrigin, angWeapon );
m_pLaserPointerEffect->SetControlPoint( 1, vecOrigin );
}
}
else
{
delete m_pBoneMergeCache;
m_pBoneMergeCache = NULL;
}
}
}
示例3: UpdateTransmitState
// Smoke grenade particles should always transmitted to clients. If not, a client who
// enters the PVS late will see the smoke start billowing from then, allowing better vision.
int ParticleSmokeGrenade::UpdateTransmitState( void )
{
if ( IsEffectActive( EF_NODRAW ) )
return SetTransmitState( FL_EDICT_DONTSEND );
return SetTransmitState( FL_EDICT_ALWAYS );
}
示例4: ShadowCastType
//IOS Added from HLCoders:
ShadowType_t C_SDKPlayer::ShadowCastType( void )
{
if ( !IsVisible() || IsEffectActive(EF_NODRAW | EF_NOSHADOW) )
return SHADOWS_NONE;
else
return SHADOWS_RENDER_TO_TEXTURE_DYNAMIC;
}
示例5: GetSolidFlags
void CWeaponHL2MPBase::Materialize( void )
{
if ( IsEffectActive( EF_NODRAW ) )
{
// changing from invisible state to visible.
EmitSound( "AlyxEmp.Charge" );
RemoveEffects( EF_NODRAW );
DoMuzzleFlash();
}
if ( HasSpawnFlags( SF_NORESPAWN ) == false )
{
VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, false );
SetMoveType( MOVETYPE_VPHYSICS );
HL2MPRules()->AddLevelDesignerPlacedObject( this );
}
if ( HasSpawnFlags( SF_NORESPAWN ) == false )
{
if ( GetOriginalSpawnOrigin() == vec3_origin )
{
m_vOriginalSpawnOrigin = GetAbsOrigin();
m_vOriginalSpawnAngles = GetAbsAngles();
}
}
SetPickupTouch();
SetThink (NULL);
}
示例6: Materialize
//====================================================================================
// WEAPON SPAWNING
//====================================================================================
//-----------------------------------------------------------------------------
// Purpose: Make a weapon visible and tangible
//-----------------------------------------------------------------------------//
void CBaseCombatWeapon::Materialize( void )
{
if ( IsEffectActive( EF_NODRAW ) )
{
// changing from invisible state to visible.
#ifdef HL2MP
EmitSound( "AlyxEmp.Charge" );
#else
EmitSound( "BaseCombatWeapon.WeaponMaterialize" );
#endif
RemoveEffects( EF_NODRAW );
DoMuzzleFlash();
}
#ifdef HL2MP
if ( HasSpawnFlags( SF_NORESPAWN ) == false )
{
VPhysicsInitNormal( SOLID_BBOX, GetSolidFlags() | FSOLID_TRIGGER, false );
SetMoveType( MOVETYPE_VPHYSICS );
HL2MPRules()->AddLevelDesignerPlacedObject( this );
}
#else
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_TRIGGER );
#endif
SetPickupTouch();
SetThink (NULL);
}
示例7: UpdateFireEmitters
void C_ASW_Buzzer::UpdateFireEmitters()
{
bool bOnFire = (m_bOnFire && !IsEffectActive(EF_NODRAW));
if (bOnFire != m_bClientOnFire)
{
m_bClientOnFire = bOnFire;
if (m_bClientOnFire)
{
if ( !m_pBurningEffect )
{
m_pBurningEffect = UTIL_ASW_CreateFireEffect( this );
}
EmitSound( "ASWFire.BurningFlesh" );
}
else
{
if ( m_pBurningEffect )
{
ParticleProp()->StopEmission( m_pBurningEffect );
m_pBurningEffect = NULL;
}
StopSound("ASWFire.BurningFlesh");
if ( C_BaseEntity::IsAbsQueriesValid() )
EmitSound("ASWFire.StopBurning");
}
}
}
示例8: Simulate
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_EntityFlame::Simulate( void )
{
if ( gpGlobals->frametime <= 0.0f )
return;
if ( IsEffectActive(EF_BRIGHTLIGHT) || IsEffectActive(EF_DIMLIGHT) )
{
dlight_t *dl = effects->CL_AllocDlight ( index );
dl->origin = GetAbsOrigin();
dl->origin[2] += 16;
dl->color.r = 254;
dl->color.g = 174;
dl->color.b = 10;
dl->radius = random->RandomFloat(400,431);
dl->die = gpGlobals->curtime + 0.001;
}
}
示例9: AddEntity
//-----------------------------------------------------------------------------
// Purpose: Add entity to visible view models list
//-----------------------------------------------------------------------------
void C_BaseViewModel::AddEntity( void )
{
// Server says don't interpolate this frame, so set previous info to new info.
if ( IsEffectActive(EF_NOINTERP) )
{
ResetLatched();
}
}
示例10: return
bool C_BaseObject::WasLastPlacementPosValid( void )
{
if ( MustBeBuiltOnAttachmentPoint() )
{
return ( !IsEffectActive(EF_NODRAW) );
}
return ( m_iLastPlacementPosValid > 0 );
}
示例11: UpdateTransmitState
int CBaseViewModel::UpdateTransmitState()
{
if ( IsEffectActive( EF_NODRAW ) )
{
return SetTransmitState( FL_EDICT_DONTSEND );
}
return SetTransmitState( FL_EDICT_FULLCHECK );
}
示例12: ShouldDraw
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CSniperDot::ShouldDraw( void )
{
if ( IsEffectActive( EF_NODRAW ) )
return false;
// Don't draw the sniper dot when in thirdperson.
if ( ::input->CAM_IsThirdPerson() )
return false;
return true;
}
示例13: UpdateTransmitState
//-----------------------------------------------------------------------------
// Purpose: Since the control zone is a data only class, force it to always be sent ( shouldn't change often so )
// bandwidth usage should be small.
// Input : **ppSendTable -
// *recipient -
// *pvs -
// clientArea -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
int CControlZone::UpdateTransmitState()
{
if ( IsEffectActive( EF_NODRAW ) )
{
return SetTransmitState( FL_EDICT_DONTSEND );
}
else
{
return SetTransmitState( FL_EDICT_ALWAYS );
}
}
示例14: UpdateTransmitState
int CBaseParticleEntity::UpdateTransmitState( void )
{
if ( IsEffectActive( EF_NODRAW ) )
return SetTransmitState( FL_EDICT_DONTSEND );
if ( IsEFlagSet( EFL_IN_SKYBOX ) )
return SetTransmitState( FL_EDICT_ALWAYS );
// cull against PVS
return SetTransmitState( FL_EDICT_PVSCHECK );
}
示例15: Materialize
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFPowerup::Materialize( void )
{
if ( !m_bDisabled && IsEffectActive( EF_NODRAW ) )
{
// changing from invisible state to visible.
EmitSound( "Item.Materialize" );
RemoveEffects( EF_NODRAW );
}
m_bRespawning = false;
SetTouch( &CItem::ItemTouch );
}