56 {
57 vector player_pos = player.GetPosition();
59 vector ref_dir = GetDirection();
60 ref_dir[1] = 0;
62
64 vector b1,b2;
68
69 vector dir_to_shelter = shelter_pos - player_pos;
70 dir_to_shelter[1] = 0;
71 float len = dir_to_shelter.
Length();
72
74
77 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
78
80
81 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
82 {
83 return false;
84 }
85 else
86 {
87 return true;
88 }
89 }
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