545 {
547
551 if (useCamera)
552 {
554 player.GetCurrentCameraTransform(pos, dir, cameraRotation);
555 playerDir = dir;
556 }
557 else
558 {
559 playerDir = MiscGameplayFunctions.GetHeadingVector(player);
561 MiscGameplayFunctions.GetHeadBonePos(player, pos);
562 }
563
566 {
567 return false;
568 }
569
572
573
574 set<Object> hitObjects = new set<Object>;
576
577 if (
DayZPhysics.
RaycastRV(
m_RayStart,
m_RayEnd, hitPos, hitNormal, hitZone, hitObjects, null, player,
false,
false, ObjIntersectIFire) && hitObjects.Count() > 0 )
578 {
579 target = hitObjects[0];
581
584 if (playerTarget && playerTarget.IsInVehicle())
585 {
587 {
589 target = null;
591 hitZone = -1;
592 }
593 }
594
595 return true;
596 }
597
598 return false;
599 }
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.
proto native vector GetCurrentCameraDirection()
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.
proto native CGame GetGame()
static proto float SqrFloat(float f)
Returns squared value.