Highly WIP, do not use.
230 {
232
235 {
236 widget.SetPos(0, 0);
237 widget.Update();
238 return;
239 }
240
242
244
246
249
252
255
256 vector resAngle = aimAngles + plrAngles;
257
259 MiscGameplayFunctions.GetHeadBonePos(
m_Player, start);
260
262
263 int layer = ObjIntersectView;
264 float range = 1.0;
265
268 {
269 layer = ObjIntersectFire;
270 range = 10.0;
271
272 vector usti_hlavne_position = weapon.GetSelectionPositionMS(
"usti hlavne" );
273 vector konec_hlavne_position = weapon.GetSelectionPositionMS(
"konec hlavne" );
274 usti_hlavne_position =
m_Player.ModelToWorld(usti_hlavne_position);
275 konec_hlavne_position =
m_Player.ModelToWorld(konec_hlavne_position);
276
278 int contact_component;
279
280 direction = konec_hlavne_position - usti_hlavne_position;
282
283 start = konec_hlavne_position;
284
286 }
287 else
288 {
290 {
293 }
294
295 float r0[4];
296 float r1[4];
297
299
302
305
307
309
310 direction = t[2];
311
313 }
314
315 vector end = start + (direction * range);
317
318 DayZPhysics.
RaycastRV(start, end, position, contact_dir, contact_component, null,
m_Player,
m_Player,
false,
false, layer);
319
320
321
322
323
324
325
326
327
328
329
331
332 float sx, sy;
333 widget.GetScreenSize(sx, sy);
334 screenSpace[0] = screenSpace[0] - (sx * 0.5);
335 screenSpace[1] = screenSpace[1] - (sy * 0.5);
336
337 widget.SetScreenPos(screenSpace[0], screenSpace[1]);
338 widget.Update();
339 }
vector m_PreviousDirection
Floating crosshair.
bool m_PreviousDirectionSet
proto native vector GetScreenPos(vector world_pos)
Transforms position in world to position in screen in pixels as x, y component of vector,...
Super root of all classes in Enforce script.
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
proto native float GetBaseAimingAngleLR()
returns base aiming angle LR - without sway/offsets/...
proto native float GetBaseAimingAngleUD()
returns base aiming angle UD - without sway/offsets/...
proto float Normalize()
Normalizes vector. Returns length.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto void QuatToMatrix(float q[4], out vector mat[3])
Converts quaternion to rotation matrix.
static proto vector MatrixToAngles(vector mat[3])
Returns angles of rotation matrix.
static proto void QuatLerp(out float qout[4], float q1[4], float q2[4], float frac)
Linear interpolation between q1 and q2 with weight 'frac' (0...1)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void DirectionAndUpMatrix(vector dir, vector up, out vector mat[4])
Creates rotation matrix from direction and up vector.
static const float RAD2DEG