DayZ
1.24
Loading...
Searching...
No Matches
CCTCursorParent.c
Go to the documentation of this file.
1
class
CCTCursorParent
:
CCTBase
2
{
3
protected
float
m_MaximalActionDistanceSq
;
4
5
//approximate head heights
6
const
float
HEIGHT_ERECT
= 1.6;
7
const
float
HEIGHT_CROUCH
= 1.05;
8
const
float
HEIGHT_PRONE
= 0.66;
9
10
void
CCTCursorParent
(
float
maximal_target_distance
=
UAMaxDistances
.
DEFAULT
)
11
{
12
m_MaximalActionDistanceSq
=
maximal_target_distance
*
maximal_target_distance
;
13
}
14
15
override
bool
Can
(
PlayerBase
player
, ActionTarget
target
)
16
{
17
if
(!
target
)
18
return
false
;
19
20
Object
parentObject
=
target
.GetParent();
21
if
(!
player
|| !
parentObject
||
parentObject
.IsDamageDestroyed())
22
return
false
;
23
24
vector
playerHeadPos
;
25
MiscGameplayFunctions
.GetHeadBonePos(
player
,
playerHeadPos
);
26
27
float
distanceRoot
=
vector
.
DistanceSq
(
target
.GetCursorHitPos(),
player
.GetPosition());
28
float
distanceHead
=
vector
.
DistanceSq
(
target
.GetCursorHitPos(),
playerHeadPos
);
29
30
return
(
distanceRoot
<=
m_MaximalActionDistanceSq
||
distanceHead
<=
m_MaximalActionDistanceSq
);
31
}
32
};
CCTBase
Definition
CCTBase.c:2
CCTCursorParent
Definition
CCTCursorParent.c:2
CCTCursorParent::HEIGHT_ERECT
const float HEIGHT_ERECT
Definition
CCTCursorParent.c:6
CCTCursorParent::HEIGHT_CROUCH
const float HEIGHT_CROUCH
Definition
CCTCursorParent.c:7
CCTCursorParent::CCTCursorParent
void CCTCursorParent(float maximal_target_distance=UAMaxDistances.DEFAULT)
Definition
CCTCursorParent.c:10
CCTCursorParent::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTCursorParent.c:15
CCTCursorParent::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTCursorParent.c:3
CCTCursorParent::HEIGHT_PRONE
const float HEIGHT_PRONE
Definition
CCTCursorParent.c:8
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UAMaxDistances
Definition
ActionConstants.c:105
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:107
vector
Definition
EnConvert.c:106
vector::DistanceSq
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
scripts
4_World
Classes
UserActionsComponent
TargetConditionsComponents
CCTCursorParent.c
Generated by
1.10.0