本文整理汇总了C++中ClientEntityList函数的典型用法代码示例。如果您正苦于以下问题:C++ ClientEntityList函数的具体用法?C++ ClientEntityList怎么用?C++ ClientEntityList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ClientEntityList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckAutoTransparentProps
void CheckAutoTransparentProps(const Vector &pos, const QAngle &ang)
{
float opacity = clamp(cl_goal_opacity.GetFloat(), 0.0f, 1.0f);
for (int i = gpGlobals->maxClients; i <= ClientEntityList().GetHighestEntityIndex(); i++)
{
C_BaseEntity *pEnt = ClientEntityList().GetBaseEntity(i);
if(!dynamic_cast<C_AutoTransparentProp *>(pEnt))
continue;
// Check if the camera is behind the goal line and close to the goal. Use an additional offset so the goal post doesn't get in the way.
if (opacity != 1.0f
&& (pos.y <= SDKGameRules()->m_vFieldMin.GetY() + cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y < SDKGameRules()->m_vKickOff.GetY()
|| pos.y >= SDKGameRules()->m_vFieldMax.GetY() - cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y > SDKGameRules()->m_vKickOff.GetY())
&& pos.x >= SDKGameRules()->m_vKickOff.GetX() - 500 && pos.x <= SDKGameRules()->m_vKickOff.GetX() + 500)
{
pEnt->SetRenderMode(kRenderTransColor);
pEnt->SetRenderColorA(opacity * 255);
}
else
{
pEnt->SetRenderMode(kRenderNormal);
}
}
}
示例2: ClientEntityList
C_BaseEntity* C_AllBaseEntityIterator::Next()
{
if ( m_CurBaseEntity == ClientEntityList().m_BaseEntities.InvalidIndex() )
return NULL;
C_BaseEntity *pRet = ClientEntityList().m_BaseEntities[m_CurBaseEntity];
m_CurBaseEntity = ClientEntityList().m_BaseEntities.Next( m_CurBaseEntity );
return pRet;
}
示例3: ResetAutoTransparentProps
void ResetAutoTransparentProps()
{
for (int i = gpGlobals->maxClients; i <= ClientEntityList().GetHighestEntityIndex(); i++)
{
C_BaseEntity *pEnt = ClientEntityList().GetBaseEntity(i);
if(!dynamic_cast<C_AutoTransparentProp *>(pEnt))
continue;
pEnt->SetRenderMode(kRenderNormal);
}
}
示例4: CheckEntities
//-----------------------------------------------------------------------------
// Purpose: Validates existing entities
//-----------------------------------------------------------------------------
void CheckEntities( PyClientClassBase *pCC, boost::python::object pyClass )
{
int iHighest = ClientEntityList().GetHighestEntityIndex();
for ( int i=0; i <= iHighest; i++ )
{
C_BaseEntity *pEnt = ClientEntityList().GetBaseEntity( i );
if ( !pEnt || pEnt->GetClientClass() != pCC || pEnt->GetPyInstance().ptr() == Py_None )
continue;
pEnt->GetPyInstance().attr("__setattr__")("__class__", pyClass);
}
}
示例5: while
C_BaseEntity* C_BaseEntityIterator::Next()
{
// Skip dormant entities
while ( m_CurBaseEntity != ClientEntityList().m_BaseEntities.InvalidIndex() )
{
C_BaseEntity *pRet = ClientEntityList().m_BaseEntities[m_CurBaseEntity];
m_CurBaseEntity = ClientEntityList().m_BaseEntities.Next( m_CurBaseEntity );
if (!pRet->IsDormant())
return pRet;
}
return NULL;
}
示例6: ClientEntityList
void C_HLTVCamera::FixupMovmentParents()
{
// Find resource zone
for ( ClientEntityHandle_t e = ClientEntityList().FirstHandle();
e != ClientEntityList().InvalidHandle(); e = ClientEntityList().NextHandle( e ) )
{
C_BaseEntity *ent = C_BaseEntity::Instance( e );
if ( !ent )
continue;
ent->HierarchyUpdateMoveParent();
}
}
示例7: ClientEntityList
void CClientThinkList::PerformThinkFunctions()
{
float curtime = gpGlobals->curtime;
unsigned long iNext;
for ( unsigned long iCur=m_ThinkEntries.Head(); iCur != m_ThinkEntries.InvalidIndex(); iCur = iNext )
{
iNext = m_ThinkEntries.Next( iCur );
CThinkEntry *pEntry = &m_ThinkEntries[iCur];
IClientThinkable *pThink = ClientEntityList().GetClientThinkableFromHandle( pEntry->m_hEnt );
if ( pThink )
{
if ( pEntry->m_flNextClientThink == CLIENT_THINK_ALWAYS )
{
// NOTE: The Think function here could call SetNextClientThink
// which would cause it to be removed + readded into the list
pThink->ClientThink();
// NOTE: The Think() call can cause other things to be added to the Think
// list, which could reallocate memory and invalidate the pEntry pointer
pEntry = &m_ThinkEntries[iCur];
}
else if ( pEntry->m_flNextClientThink < curtime )
{
pEntry->m_flNextClientThink = curtime;
// NOTE: The Think function here could call SetNextClientThink
// which would cause it to be readded into the list
pThink->ClientThink();
// NOTE: The Think() call can cause other things to be added to the Think
// list, which could reallocate memory and invalidate the pEntry pointer
pEntry = &m_ThinkEntries[iCur];
// If they haven't changed the think time, then it should be removed.
if ( pEntry->m_flNextClientThink == curtime )
{
RemoveThinkable( pEntry->m_hEnt );
}
}
Assert( pEntry == &m_ThinkEntries[iCur] );
// Set this after the Think calls in case they look at LastClientThink
m_ThinkEntries[iCur].m_flLastClientThink = curtime;
}
else
{
// This should be almost impossible. When ClientEntityHandle_t's are versioned,
// this should be totally impossible.
Assert( false );
m_ThinkEntries.Remove( iCur );
}
}
// Clear out the client-side entity deletion list.
CleanUpDeleteList();
}
示例8: SpotlightCurrentPos
//------------------------------------------------------------------------------
void C_BeamSpotLight::SpotlightCreate(void)
{
m_vSpotlightTargetPos = SpotlightCurrentPos();
{
//C_Beam *beam = CBeam::BeamCreate( "sprites/spotlight.vmt", m_flSpotlightGoalWidth );
C_Beam *beam = C_Beam::BeamCreate( "sprites/glow_test02.vmt", m_flSpotlightGoalWidth );
// Beam only exists client side
ClientEntityList().AddNonNetworkableEntity( beam );
m_hSpotlight = beam;
}
// Set the temporary spawnflag on the beam so it doesn't save (we'll recreate it on restore)
m_hSpotlight->SetHDRColorScale( m_flHDRColorScale );
const color24 c = GetRenderColor();
m_hSpotlight->SetColor( c.r, c.g, c.b );
m_hSpotlight->SetHaloTexture(m_nHaloIndex);
m_hSpotlight->SetHaloScale(60);
m_hSpotlight->SetEndWidth(m_flSpotlightGoalWidth);
m_hSpotlight->SetBeamFlags( (FBEAM_SHADEOUT|FBEAM_NOTILE) );
m_hSpotlight->SetBrightness( 64 );
m_hSpotlight->SetNoise( 0 );
m_hSpotlight->PointsInit( GetAbsOrigin(), m_vSpotlightTargetPos );
}
示例9: ClientThinkList
void C_BaseNetworkable::Term()
{
// Detach from the server list.
if ( m_ClientHandle != ClientEntityList().InvalidHandle() )
{
// Remove from the think list.
ClientThinkList()->RemoveThinkable( m_ClientHandle );
ClientEntityList().RemoveEntity( GetRefEHandle() );
index = 0xFFFF;
// RemoveEntity should have done this.
Assert( m_ClientHandle == ClientEntityList().InvalidHandle() );
}
}
示例10: Assert
void C_BaseNetworkable::Init( int entnum, int iSerialNum )
{
Assert( index == 0xFFFF );
index = entnum;
m_ClientHandle = ClientEntityList().AddNetworkableEntity( GetIClientUnknown(), entnum, iSerialNum );
}
示例11: RemoveThinkable
void CClientThinkList::SetNextClientThink( ClientEntityHandle_t hEnt, float nextTime )
{
if ( nextTime == CLIENT_THINK_NEVER )
{
RemoveThinkable( hEnt );
}
else
{
IClientThinkable *pThink = ClientEntityList().GetClientThinkableFromHandle( hEnt );
if ( pThink )
{
ClientThinkHandle_t hThink = pThink->GetThinkHandle();
// Add it to the list if it's not already in there.
if ( hThink == INVALID_THINK_HANDLE )
{
hThink = (ClientThinkHandle_t)m_ThinkEntries.AddToTail();
pThink->SetThinkHandle( hThink );
GetThinkEntry( hThink )->m_hEnt = hEnt;
}
// Set the next think time..
GetThinkEntry( hThink )->m_flNextClientThink = nextTime;
}
}
}
示例12: CalcChaseCamView
void C_HLTVCamera::SetPrimaryTarget( int nEntity )
{
if ( m_iTraget1 == nEntity )
return;
m_iTraget1 = nEntity;
if ( GetMode() == OBS_MODE_ROAMING )
{
Vector vOrigin;
QAngle aAngles;
float flFov;
CalcChaseCamView( vOrigin, aAngles, flFov );
}
else if ( GetMode() == OBS_MODE_CHASE )
{
C_BaseEntity* target = ClientEntityList().GetEnt( m_iTraget1 );
if ( target )
{
QAngle eyeAngle = target->EyeAngles();
prediction->SetViewAngles( eyeAngle );
}
}
m_flLastDistance = m_flDistance;
m_flLastAngleUpdateTime = -1;
}
示例13: ClientEntityList
//-----------------------------------------------------------------------------
// Performs the think function
//-----------------------------------------------------------------------------
void CClientThinkList::PerformThinkFunction( ThinkEntry_t *pEntry, float flCurtime )
{
IClientThinkable *pThink = ClientEntityList().GetClientThinkableFromHandle( pEntry->m_hEnt );
if ( !pThink )
{
RemoveThinkable( pEntry->m_hEnt );
return;
}
if ( pEntry->m_flNextClientThink == CLIENT_THINK_ALWAYS )
{
// NOTE: The Think function here could call SetNextClientThink
// which would cause it to be removed + readded into the list
pThink->ClientThink();
}
else if ( pEntry->m_flNextClientThink == FLT_MAX )
{
// This is an entity that doesn't need to think again; remove it
RemoveThinkable( pEntry->m_hEnt );
}
else
{
Assert( pEntry->m_flNextClientThink <= flCurtime );
// Indicate we're not going to think again
pEntry->m_flNextClientThink = FLT_MAX;
// NOTE: The Think function here could call SetNextClientThink
// which would cause it to be readded into the list
pThink->ClientThink();
}
// Set this after the Think calls in case they look at LastClientThink
pEntry->m_flLastClientThink = flCurtime;
}
示例14: FX_BuildTeslaHitbox
//-----------------------------------------------------------------------------
// Purpose: Tesla effect
//-----------------------------------------------------------------------------
void FX_BuildTeslaHitbox( const CEffectData &data )
{
Vector vColor( 1, 1, 1 );
C_BaseEntity *pEntity = ClientEntityList().GetEnt( data.entindex() );
C_BaseAnimating *pAnimating = pEntity ? pEntity->GetBaseAnimating() : NULL;
if (!pAnimating)
return;
studiohdr_t *pStudioHdr = modelinfo->GetStudiomodel( pAnimating->GetModel() );
if (!pStudioHdr)
return;
mstudiohitboxset_t *set = pStudioHdr->pHitboxSet( pAnimating->GetHitboxSet() );
if ( !set )
return;
matrix3x4_t *hitboxbones[MAXSTUDIOBONES];
if ( !pAnimating->HitboxToWorldTransforms( hitboxbones ) )
return;
int nBeamCount = (int)(data.m_flMagnitude + 0.5f);
for ( int i = 0; i < nBeamCount; ++i )
{
int nStartHitBox = random->RandomInt( 1, set->numhitboxes );
int nEndHitBox = random->RandomInt( 1, set->numhitboxes );
FX_BuildTeslaHitbox( pEntity, nStartHitBox, nEndHitBox, data.m_flScale, vColor, random->RandomFloat( 0.05f, 0.2f ) );
}
}
示例15: ClientsideProjectileSyringeCallback
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ClientsideProjectileSyringeCallback( const CEffectData &data )
{
// Get the syringe and add it to the client entity list, so we can attach a particle system to it.
C_TFPlayer *pPlayer = dynamic_cast<C_TFPlayer*>( ClientEntityList().GetBaseEntityFromHandle( data.m_hEntity ) );
if ( pPlayer )
{
C_LocalTempEntity *pSyringe = ClientsideProjectileCallback( data, SYRINGE_GRAVITY );
if ( pSyringe )
{
switch (pPlayer->GetTeamNumber())
{
case TF_TEAM_RED:
pSyringe->m_nSkin = 0;
break;
case TF_TEAM_BLUE:
pSyringe->m_nSkin = 1;
break;
case TF_TEAM_GREEN:
pSyringe->m_nSkin = 2;
break;
case TF_TEAM_YELLOW:
pSyringe->m_nSkin = 3;
break;
}
bool bCritical = ( ( data.m_nDamageType & DMG_CRITICAL ) != 0 );
pPlayer->m_Shared.SetParticleToMercColor(
pSyringe->AddParticleEffect(GetSyringeTrailParticleName(pPlayer->GetTeamNumber(), bCritical))
);
pSyringe->AddEffects( EF_NOSHADOW );
pSyringe->flags |= FTENT_USEFASTCOLLISIONS;
}
}
}