本文整理汇总了C++中IVehicleSystem::CreateVehicleIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ IVehicleSystem::CreateVehicleIterator方法的具体用法?C++ IVehicleSystem::CreateVehicleIterator怎么用?C++ IVehicleSystem::CreateVehicleIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVehicleSystem
的用法示例。
在下文中一共展示了IVehicleSystem::CreateVehicleIterator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteVehicleData
void CCheckpointSystem::WriteVehicleData(XmlNodeRef parentNode)
{
IVehicleSystem *pVehicleSystem = CCryAction::GetCryAction()->GetIVehicleSystem();
IVehicleIteratorPtr pVehIt = pVehicleSystem->CreateVehicleIterator();
while(IVehicle *pVehicle = pVehIt->Next())
{
SaveExternalEntity(pVehicle->GetEntityId());
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:9,代码来源:CheckPointSystem.cpp
示例2: OnDebugDrawVarChanged
//------------------------------------------------------------------------
void OnDebugDrawVarChanged(ICVar* pVar)
{
if (pVar->GetIVal())
{
IVehicleSystem* pVehicleSystem = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem();
IVehicleIteratorPtr pIter = pVehicleSystem->CreateVehicleIterator();
while (IVehicle* pVehicle = pIter->Next())
{
pVehicle->NeedsUpdate();
}
}
}
示例3: ResetEngine
//////////////////////////////////////////////////////////////////////////
//clear everything out before loading a checkpoint
void CCheckpointSystem::ResetEngine()
{
//let game do initial resetting
if (m_pGameHandler)
{
m_pGameHandler->OnPreResetEngine();
}
//turn off physics
gEnv->pSystem->SetThreadState(ESubsys_Physics, false);
//reset engine similar to editor when leaving game mode
//broken geometry and dynamics
CCryAction::GetCryAction()->FlushBreakableObjects();
DeleteDynamicEntities();
CCryAction::GetCryAction()->ResetBrokenGameObjects();
//this should just reset the velocity of all moving things, but instead vehicle doors fall off ...
//CXP : add this back in after CXP, Anton has to fix it
//gEnv->pPhysicalWorld->ResetDynamicEntities();
//particle and post process effects
gEnv->p3DEngine->ResetPostEffects();
gEnv->p3DEngine->ResetParticlesAndDecals();
REINST("notify the audio system?");
//AI System
if (gEnv->pAISystem)
{
gEnv->pAISystem->Reset(IAISystem::RESET_EXIT_GAME);
gEnv->pAISystem->Reset(IAISystem::RESET_ENTER_GAME);
}
//flow system
//reset trackview
gEnv->pMovieSystem->Reset(true, true);
//entity system
SEntityEvent event;
event.event = ENTITY_EVENT_RESET;
event.nParam[0] = 0;
gEnv->pEntitySystem->SendEventToAll( event );
//Vehicle System
IVehicleSystem *pVehicleSystem = CCryAction::GetCryAction()->GetIVehicleSystem();
IVehicleIteratorPtr pVehIt = pVehicleSystem->CreateVehicleIterator();
while(IVehicle *pVehicle = pVehIt->Next())
{
pVehicle->Reset(true);
}
//make sure the scripts are clean
gEnv->pScriptSystem->ForceGarbageCollection();
//turn on physics again
gEnv->pSystem->SetThreadState(ESubsys_Physics, true);
//let game do final resetting
if (m_pGameHandler)
{
m_pGameHandler->OnPostResetEngine();
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:67,代码来源:CheckPointSystem.cpp
示例4: Update
void CHUDTagNames::Update()
{
CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor());
CGameRules *pGameRules = g_pGame->GetGameRules();
if(!pClientActor || !pGameRules || !gEnv->bMultiplayer)
return;
int iClientTeam = pGameRules->GetTeam(pClientActor->GetEntityId());
// Skip enemies, they need to be added only when shot
// (except in spectator mode when we display everyone)
for(int iTeam = 0; iTeam < pGameRules->GetTeamCount() + 1; ++iTeam)
{
if((iTeam == iClientTeam) || (pClientActor->GetSpectatorMode() != CActor::eASM_None))
{
int iTeamPlayerCount = pGameRules->GetTeamPlayerCount(iTeam);
for(int iPlayer=0; iPlayer<iTeamPlayerCount; iPlayer++)
{
IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pGameRules->GetTeamPlayer(iTeam,iPlayer));
if(!pActor)
continue;
// Never display the local player
if(pActor == pClientActor)
continue;
// never display other spectators
if(static_cast<CActor*>(pActor)->GetSpectatorMode() != CActor::eASM_None)
continue;
// never display the name of the player we're spectating (it's shown separately with their current health)
if(pClientActor->GetSpectatorMode() == CActor::eASM_Follow && pClientActor->GetSpectatorTarget() == pActor->GetEntityId())
continue;
DrawTagName(pActor);
}
}
}
IVehicleSystem *pVehicleSystem = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem();
if(!pVehicleSystem)
return;
IVehicleIteratorPtr pVehicleIter = pVehicleSystem->CreateVehicleIterator();
while(IVehicle *pVehicle=pVehicleIter->Next())
{
SVehicleStatus rVehicleStatus = pVehicle->GetStatus();
if(0 == rVehicleStatus.passengerCount)
continue;
// Skip enemy vehicles, they need to be added only when shot (except in spectator mode...)
bool bEnemyVehicle = true;
for(int iSeatId=1; iSeatId<=pVehicle->GetLastSeatId(); iSeatId++)
{
IVehicleSeat *pVehicleSeat = pVehicle->GetSeatById(iSeatId);
if(!pVehicleSeat)
continue;
EntityId uiEntityId = pVehicleSeat->GetPassenger();
if(0 == iClientTeam)
{
if(uiEntityId && IsFriendlyToClient(uiEntityId))
{
bEnemyVehicle = false;
}
}
else if(uiEntityId && pGameRules->GetTeam(uiEntityId) == iClientTeam)
{
bEnemyVehicle = false;
}
}
if(bEnemyVehicle && (pClientActor->GetSpectatorMode() == CActor::eASM_None)) // again, draw enemies in spectator mode
continue;
DrawTagName(pVehicle);
}
// don't need to do any of this if we're in spectator mode - all player names will have been drawn above.
if(pClientActor->GetSpectatorMode() == CActor::eASM_None)
{
for(TEnemyTagNamesList::iterator iter=m_enemyTagNamesList.begin(); iter!=m_enemyTagNamesList.end(); ++iter)
{
SEnemyTagName *pEnemyTagName = &(*iter);
if(gEnv->pTimer->GetAsyncTime().GetSeconds() >= pEnemyTagName->fSpawnTime+((float) g_pGameCVars->hud_mpNamesDuration))
{
// Note: iter=my_list.erase(iter) may not be standard/safe
TEnemyTagNamesList::iterator iterNext = iter;
++iterNext;
m_enemyTagNamesList.erase(iter);
iter = iterNext;
}
else
{
IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pEnemyTagName->uiEntityId);
if(pActor)
DrawTagName(pActor);
IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(pEnemyTagName->uiEntityId);
//.........这里部分代码省略.........