本文整理汇总了C++中ratl::vector_vs::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ vector_vs::clear方法的具体用法?C++ vector_vs::clear怎么用?C++ vector_vs::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ratl::vector_vs
的用法示例。
在下文中一共展示了vector_vs::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Rail_Reset()
{
mRailSystemActive = false;
mRailTracks.clear();
mRailLanes.clear();
mRailMovers.clear();
mWooshSml.clear();
mWooshMed.clear();
mWooshLar.clear();
mWooshSup.clear();
mWooshTun.clear();
}
示例2:
void Pilot_Update(void)
{
mActivePilotCount = 0;
mRegistered.clear();
for (int i=0; i<ENTITYNUM_WORLD; i++)
{
if (g_entities[i].inuse &&
g_entities[i].client &&
g_entities[i].NPC &&
g_entities[i].NPC->greetEnt &&
g_entities[i].NPC->greetEnt->owner==(&g_entities[i])
)
{
mActivePilotCount++;
}
if ( g_entities[i].inuse &&
g_entities[i].client &&
g_entities[i].m_pVehicle &&
!g_entities[i].owner &&
g_entities[i].health>0 &&
g_entities[i].m_pVehicle->m_pVehicleInfo->type==VH_SPEEDER &&
!mRegistered.full())
{
mRegistered.push_back(&g_entities[i]);
}
}
if (player &&
player->inuse &&
TIMER_Done(player, "FlybySoundArchitectureDebounce"))
{
TIMER_Set(player, "FlybySoundArchitectureDebounce", 300);
Vehicle_t* pVeh = G_IsRidingVehicle(player);
if (pVeh &&
(pVeh->m_pVehicleInfo->soundFlyBy || pVeh->m_pVehicleInfo->soundFlyBy2) &&
//fabsf(pVeh->m_pParentEntity->currentAngles[2])<15.0f &&
VectorLength(pVeh->m_pParentEntity->client->ps.velocity)>500.0f)
{
vec3_t projectedPosition;
vec3_t projectedDirection;
vec3_t projectedRight;
vec3_t anglesNoRoll;
VectorCopy(pVeh->m_pParentEntity->currentAngles, anglesNoRoll);
anglesNoRoll[2] = 0;
AngleVectors(anglesNoRoll, projectedDirection, projectedRight, 0);
VectorMA(player->currentOrigin, 1.2f, pVeh->m_pParentEntity->client->ps.velocity, projectedPosition);
VectorMA(projectedPosition, Q_flrand(-200.0f, 200.0f), projectedRight, projectedPosition);
gi.trace(&mPilotViewTrace,
player->currentOrigin,
0,
0,
projectedPosition,
player->s.number,
MASK_SHOT, G2_NOCOLLIDE, 0);
if ((mPilotViewTrace.allsolid==qfalse) &&
(mPilotViewTrace.startsolid==qfalse) &&
(mPilotViewTrace.fraction<0.99f) &&
(mPilotViewTrace.plane.normal[2]<0.5f) &&
(DotProduct(projectedDirection, mPilotViewTrace.plane.normal)<-0.5f)
)
{
// CG_DrawEdge(player->currentOrigin, mPilotViewTrace.endpos, EDGE_IMPACT_POSSIBLE);
TIMER_Set(player, "FlybySoundArchitectureDebounce", Q_irand(1000, 2000));
int soundFlyBy = pVeh->m_pVehicleInfo->soundFlyBy;
if (pVeh->m_pVehicleInfo->soundFlyBy2 && (!soundFlyBy || !Q_irand(0,1)))
{
soundFlyBy = pVeh->m_pVehicleInfo->soundFlyBy2;
}
G_SoundAtSpot(mPilotViewTrace.endpos, soundFlyBy, qtrue);
}
else
{
// CG_DrawEdge(player->currentOrigin, mPilotViewTrace.endpos, EDGE_IMPACT_SAFE);
}
}
}
}