MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / UpdateNightVisionMode

Method UpdateNightVisionMode

ogsr_engine/xrGame/SimpleDetectorSHOC.cpp:309–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307#include "clsid_game.h"
308
309void CCustomDetectorSHOC::UpdateNightVisionMode()
310{
311 bool bNightVision = Actor()->Cameras().GetPPEffector(EEffectorPPType(effNightvision)) != NULL;
312
313 bool bOn = bNightVision && m_pCurrentActor && m_pCurrentActor == Level().CurrentViewEntity() && IsWorking() && m_nightvision_particle.size();
314
315 ZONE_INFO_MAP_IT it;
316 for (it = m_ZoneInfoMap.begin(); m_ZoneInfoMap.end() != it; ++it)
317 {
318 CCustomZone* pZone = it->first;
319 ZONE_INFO_SHOC& zone_info = it->second;
320
321 if (bOn && pZone->IsEnabled())
322 {
323 Fvector zero_vector;
324 zero_vector.set(0.f, 0.f, 0.f);
325
326 if (!zone_info.pParticle)
327 zone_info.pParticle = CParticlesObject::Create(*m_nightvision_particle, FALSE);
328
329 zone_info.pParticle->UpdateParent(pZone->XFORM(), zero_vector);
330
331 if (!zone_info.pParticle->IsPlaying())
332 zone_info.pParticle->Play(false);
333 }
334 else
335 {
336 if (zone_info.pParticle)
337 {
338 zone_info.pParticle->Stop();
339 CParticlesObject::Destroy(zone_info.pParticle);
340 }
341 }
342 }
343}
344
345void CCustomDetectorSHOC::update_actor_radiation()
346{

Callers

nothing calls this directly

Calls 14

ActorFunction · 0.85
EEffectorPPTypeEnum · 0.85
CreateFunction · 0.85
DestroyFunction · 0.85
GetPPEffectorMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
IsEnabledMethod · 0.45
setMethod · 0.45
UpdateParentMethod · 0.45
IsPlayingMethod · 0.45

Tested by

no test coverage detected