335 {
336
340
341 vector cameraPos, cameraRot, cameraDir;
342 m_DZPlayer.GetCurrentCameraTransform(cameraPos, cameraDir, cameraRot);
343 vector dir = MiscGameplayFunctions.GetHeadingVector(player);
344 dir[1] = cameraDir[1];
345
346
350
351
352
353
354
355
357 {
358
360 {
362
363 return;
364 }
365 }
366
367
369
372 int hitZone;
373
374
376 {
378 {
380 return;
381 }
382
384 {
386
388 return;
389 }
390 }
391
392
393 MeleeTargetData targetData =
m_MeleeTargeting.GetMeleeTargetEx(
new MeleeTargetSettings(pos, dist*0.75, angle,
TARGETING_MIN_HEIGHT,
TARGETING_MAX_HEIGHT, rayStart, dir,
TARGETING_RAY_RADIUS_EX,
m_DZPlayer,
m_TargetableObjects),
m_AllTargetObjects,
m_BlacklistedDamageZones);
394
395 if (targetData)
396 {
398 return;
399 }
400
401
403 {
405
407 return;
408 }
409 }
void SetTarget(Object obj, vector hitPos, int hitZone)
const float TARGETING_MIN_HEIGHT
Second Pass: How deep the cone goes in meters from player position.
bool m_WasHit
If most recent attack was.
ref array< string > m_BlacklistedDamageZones
List of blacklisted damage zone names (cannot use indices due to the possible changes when p3d compon...
void InternalResetTarget()
const float TARGETING_MAX_HEIGHT
Second Pass: How high the cone goes in meters from player position.
ref MeleeTargeting m_MeleeTargeting
Target selecting "component".
bool m_ForceUntargetable
Misc - cache.
ref array< Object > m_AllTargetObjects
All potential targets found during most recent TargetSelection.
DayZPlayerImplement m_DZPlayer
Parent.
Object m_TargetObject
Targets - types.
bool HitZoneSelectionRaycastHelper(out vector hitPos, out int hitZone, out Object target)
const float TARGETING_RAY_RADIUS_EX
Second Pass: Max distance from ray projected from player looking direction.
ref array< typename > m_TargetableObjects
Typenames of all directly/preferred targetable objects (1st Pass + 2nd Pass)
bool CanObjectBeTargeted(Object obj, bool checkNonAligneAble=false)
string m_HitZoneName
Most recent target HitZone name.
ref array< typename > TargetableObjects void MeleeTargetSettings(vector coneOrigin, float coneLength, float coneHalfAngle, float coneMinHeight, float coneMaxHeight, vector rayStart, vector dir, float maxDist, EntityAI pToIgnore, array< typename > targetableObjects)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto float SqrFloat(float f)
Returns squared value.