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

◆ IsPlayerInside() [4/4]

override bool BaseBuildingBase::IsPlayerInside ( PlayerBase player,
string selection )
inlineprivate

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

509 {
510 if ( selection != "")
511 {
513 }
514 vector player_pos = player.GetPosition();
515 vector tower_pos = GetPosition();
516 vector ref_dir = GetDirection();
517 ref_dir[1] = 0;
518 ref_dir.Normalize();
519
520 vector min,max;
521
522 min = -GetMemoryPointPos( "interact_min" );
523 max = -GetMemoryPointPos( "interact_max" );
524
525 vector dir_to_tower = tower_pos - player_pos;
526 dir_to_tower[1] = 0;
527 float len = dir_to_tower.Length();
528
529
530 dir_to_tower.Normalize();
531
532 vector ref_dir_angle = ref_dir.VectorToAngles();
533 vector dir_to_tower_angle = dir_to_tower.VectorToAngles();
534 vector test_angles = dir_to_tower_angle - ref_dir_angle;
535
536 vector test_position = test_angles.AnglesToVector() * len;
537
538 if (test_position[0] > max[0] || test_position[0] < min[0] || test_position[2] > max[2] || test_position[2] < min[2] )
539 {
540 return false;
541 }
542
543 return true;
544 }
override bool CheckLevelVerticalDistance(float max_dist, string selection, PlayerBase player)
Определения Watchtower.c:383
const float MAX_FLOOR_VERTICAL_DISTANCE
Определения Watchtower.c:6
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки vector::AnglesToVector(), CheckLevelVerticalDistance(), GetPosition, vector::Length(), MAX_FLOOR_VERTICAL_DISTANCE, vector::Normalize() и vector::VectorToAngles().