545 {
547
551 if (useCamera)
552 {
554 player.GetCurrentCameraTransform(pos, dir, cameraRotation);
555 playerDir = dir;
556 }
557 else
558 {
559 playerDir = MiscGameplayFunctions.GetHeadingVector(player);
560 dir =
g_Game.GetCurrentCameraDirection();
561
562 pos = MiscGameplayFunctions.GetPlayerHeadPosition(player);
563 }
564
567 {
568 return false;
569 }
570
573
574
575 set<Object> hitObjects = new set<Object>;
577
578 if (
DayZPhysics.
RaycastRV(
m_RayStart,
m_RayEnd, hitPos, hitNormal, hitZone, hitObjects, null, player,
false,
false, ObjIntersectIFire) && hitObjects.Count() > 0 )
579 {
580 target = hitObjects[0];
582
585 if (playerTarget && playerTarget.IsInVehicle())
586 {
588 {
590 target = null;
592 hitZone = -1;
593 }
594 }
595
596 return true;
597 }
598
599 return false;
600 }
bool m_ForceUntargetable
Misc - cache.
DayZPlayerImplement m_DZPlayer
Parent.
vector m_RayStart
Start position of most recent HitZoneSelectionRaycast.
vector m_RayEnd
End position of most recent HitZoneSelectionRaycast.
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.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
static proto float SqrFloat(float f)
Returns squared value.