DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ IsFacingCamera() [4/4]

override bool BaseBuildingBase::IsFacingCamera ( string selection)
inlineprivate

См. определение в файле Watchtower.c строка 478

479 {
480 vector ref_pos;
481 vector ref_dir;
482 vector cam_dir = GetGame().GetCurrentCameraDirection();
483
484 if ( MemoryPointExists( selection ) )
485 {
486 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
487 ref_dir = ref_pos - GetPosition();
488
489 ref_dir.Normalize();
490 ref_dir[1] = 0; //ignore height
491
492 cam_dir[1] = 0; //ignore height
493
494 if ( ref_dir.Length() > 0.5 ) //if the distance (m) is too low, ignore this check
495 {
496 float dot = vector.Dot( cam_dir, ref_dir );
497
498 if ( dot < 0 )
499 {
500 return true;
501 }
502 }
503 }
504
505 return false;
506 }
proto native vector GetCurrentCameraDirection()
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки vector::Dot(), CGame::GetCurrentCameraDirection(), GetGame(), GetPosition, vector::Length() и vector::Normalize().