142 vector fromDirection =
GetGame().GetCurrentCameraDirection();
143 vector to = from + (fromDirection * RANGEFINDER_MAX_DISTANCE);
146 int contactComponent;
148 bool hit =
DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contactComponent, NULL , NULL, player,
false,
false, ObjIntersectIFire);
156 float h =
vector.Distance( from, contact_pos );
164 TextWidget angleText = TextWidget.Cast(
m_Root.FindAnyWidget(
"AngleText"));
165 TextWidget horizText = TextWidget.Cast(
m_Root.FindAnyWidget(
"RangeHDText"));
167 vector horizontalTo =
Vector( contact_pos[0], from[1], contact_pos[2] );
168 float a =
vector.Distance( from, horizontalTo );
171 float heightDiff = contact_pos[1] - from[1];
172 float angle =
Math.Atan( heightDiff / a ) *
Math.RAD2DEG;
173 angle =
Math.Round(angle);
178 angleText.SetText(
string.Format(
"%1", angle));
proto native vector Vector(float x, float y, float z)
Vector constructor from components.