本文整理汇总了C++中IsEffectActive函数的典型用法代码示例。如果您正苦于以下问题:C++ IsEffectActive函数的具体用法?C++ IsEffectActive怎么用?C++ IsEffectActive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsEffectActive函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:30,代码来源:c_baseviewmodel.cpp
示例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;
}
}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:33,代码来源:asw_bone_merge.cpp
示例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 );
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:9,代码来源:particle_smokegrenade.cpp
示例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;
}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:8,代码来源:c_sdk_player.cpp
示例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);
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:32,代码来源:weapon_hl2mpbase.cpp
示例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);
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:37,代码来源:basecombatweapon.cpp
示例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");
}
}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:27,代码来源:c_asw_buzzer.cpp
示例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;
}
}
开发者ID:TalonBraveInfo,项目名称:InvasionSource,代码行数:20,代码来源:c_fire_smoke.cpp
示例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();
}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:11,代码来源:c_baseviewmodel.cpp
示例10: return
bool C_BaseObject::WasLastPlacementPosValid( void )
{
if ( MustBeBuiltOnAttachmentPoint() )
{
return ( !IsEffectActive(EF_NODRAW) );
}
return ( m_iLastPlacementPosValid > 0 );
}
开发者ID:Deathreus,项目名称:TF2Classic,代码行数:9,代码来源:c_baseobject.cpp
示例11: UpdateTransmitState
int CBaseViewModel::UpdateTransmitState()
{
if ( IsEffectActive( EF_NODRAW ) )
{
return SetTransmitState( FL_EDICT_DONTSEND );
}
return SetTransmitState( FL_EDICT_FULLCHECK );
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:9,代码来源:baseviewmodel.cpp
示例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;
}
开发者ID:staticfox,项目名称:TF2Classic,代码行数:14,代码来源:tf_weapon_sniperrifle.cpp
示例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 );
}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:20,代码来源:controlzone.cpp
示例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 );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:11,代码来源:baseparticleentity.cpp
示例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 );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:15,代码来源:tf_powerup.cpp
示例16: GetModelPtr
//-----------------------------------------------------------------------------
// Should this object cast render-to-texture shadows?
//-----------------------------------------------------------------------------
ShadowType_t C_PropVehicleDriveable::ShadowCastType()
{
CStudioHdr *pStudioHdr = GetModelPtr();
if ( !pStudioHdr )
return SHADOWS_NONE;
if ( IsEffectActive(EF_NODRAW | EF_NOSHADOW) )
return SHADOWS_NONE;
// Always use render-to-texture. We'll always the dirty bits in our think function
return SHADOWS_RENDER_TO_TEXTURE;
}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:15,代码来源:c_prop_vehicle.cpp
示例17: DispatchSpawn
void GhostEntity::HandleGhost() {
if (currentStep == NULL) {
GhostEngine::getEngine()->getRun(this)->EndRun();
}
else {
if (!isActive) {
if (Q_strcmp(currentMap, STRING(gpGlobals->mapname)) == 0) {
DispatchSpawn(this);
}
}
else {
if (nextStep != NULL) {
if (Q_strcmp(STRING(gpGlobals->mapname), currentMap) != 0) {
if (!IsEffectActive(EF_NODRAW)) AddEffects(EF_NODRAW);
return;
}
if (IsEffectActive(EF_NODRAW)) RemoveEffects(EF_NODRAW);
if (Q_strcmp(currentStep->map, nextStep->map) == 0) {
//interpolate position
float x = currentStep->x;
float y = currentStep->y;
float z = currentStep->z;
if (x == 0.0f) return;
float x2 = nextStep->x;
float y2 = nextStep->y;
float z2 = nextStep->z;
float t1 = currentStep->tim;
float t2 = nextStep->tim;
float scalar = ((((float)Plat_FloatTime()) - startTime) - t1) / (t2 - t1);
float xfinal = x + (scalar * (x2 - x));
float yfinal = y + (scalar * (y2 - y));
float zfinal = z + (scalar * (z2 - z));
SetAbsOrigin(Vector(xfinal, yfinal, (zfinal - 15.0f)));
} else {//set it to the last position before it updates to the next map
SetAbsOrigin(Vector(currentStep->x, currentStep->y, (currentStep->z - 15.0f)));
}
}
}
}
}
开发者ID:HL2-Ghosting-Team,项目名称:src,代码行数:40,代码来源:GhostEntity.cpp
示例18: if
//-----------------------------------------------------------------------------
// Purpose: Creates, destroys, and updates the flashlight effect as needed.
//-----------------------------------------------------------------------------
void C_HL2MP_Player::UpdateFlashlight()
{
// The dim light is the flashlight.
if ( IsEffectActive( EF_DIMLIGHT ) )
{
if (!m_pHL2MPFlashLightEffect)
{
// Turned on the headlight; create it.
m_pHL2MPFlashLightEffect = new CHL2MPFlashlightEffect(index);
if (!m_pHL2MPFlashLightEffect)
return;
m_pHL2MPFlashLightEffect->TurnOn();
}
Vector vecForward, vecRight, vecUp;
Vector position = EyePosition();
if ( ::input->CAM_IsThirdPerson() )
{
int iAttachment = LookupAttachment( "anim_attachment_RH" );
if ( iAttachment >= 0 )
{
Vector vecOrigin;
//Tony; EyeAngles will return proper whether it's local player or not.
QAngle eyeAngles = EyeAngles();
GetAttachment( iAttachment, vecOrigin, eyeAngles );
Vector vForward;
AngleVectors( eyeAngles, &vecForward, &vecRight, &vecUp );
position = vecOrigin;
}
else
EyeVectors( &vecForward, &vecRight, &vecUp );
}
else
EyeVectors( &vecForward, &vecRight, &vecUp );
// Update the light with the new position and direction.
m_pHL2MPFlashLightEffect->UpdateLight( position, vecForward, vecRight, vecUp, FLASHLIGHT_DISTANCE );
}
else if (m_pHL2MPFlashLightEffect)
{
// Turned off the flashlight; delete it.
delete m_pHL2MPFlashLightEffect;
m_pHL2MPFlashLightEffect = NULL;
}
}
开发者ID:uunx,项目名称:quakelife2,代码行数:55,代码来源:c_hl2mp_player.cpp
示例19: ShadowCastType
//-----------------------------------------------------------------------------
// Should this object cast shadows?
//-----------------------------------------------------------------------------
ShadowType_t C_BaseCombatWeapon::ShadowCastType()
{
if ( IsEffectActive( /*EF_NODRAW |*/ EF_NOSHADOW ) )
return SHADOWS_NONE;
if (!IsBeingCarried())
return SHADOWS_RENDER_TO_TEXTURE;
if (IsCarriedByLocalPlayer())
return SHADOWS_NONE;
return (m_iState != WEAPON_IS_CARRIED_BY_PLAYER) ? SHADOWS_RENDER_TO_TEXTURE : SHADOWS_NONE;
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:16,代码来源:c_basecombatweapon.cpp
示例20: Materialize
//=========================================================
// Materialize - make a CWeaponDODBase visible and tangible
//=========================================================
void CWeaponDODBase::Materialize()
{
if ( IsEffectActive( EF_NODRAW ) )
{
RemoveEffects( EF_NODRAW );
DoMuzzleFlash();
}
AddSolidFlags( FSOLID_TRIGGER );
SetThink (&CWeaponDODBase::SUB_Remove);
SetNextThink( gpGlobals->curtime + 1 );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:16,代码来源:weapon_dodbase.cpp
注:本文中的IsEffectActive函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论