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

◆ IsFacingCamera() [4/4]

override bool BaseBuildingBase::IsFacingCamera ( string selection)
inlineprivate

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

484 {
485 vector ref_pos;
486 vector ref_dir;
487 vector cam_dir = g_Game.GetCurrentCameraDirection();
488
489 if ( MemoryPointExists( selection ) )
490 {
491 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
492 ref_dir = ref_pos - GetPosition();
493
494 ref_dir.Normalize();
495 ref_dir[1] = 0; //ignore height
496
497 cam_dir[1] = 0; //ignore height
498
499 if ( ref_dir.Length() > 0.5 ) //if the distance (m) is too low, ignore this check
500 {
501 float dot = vector.Dot( cam_dir, ref_dir );
502
503 if ( dot < 0 )
504 {
505 return true;
506 }
507 }
508 }
509
510 return false;
511 }
DayZGame g_Game
Определения DayZGame.c:4074
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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