Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
humanitems.h
Go to the documentation of this file.
1 
2 // *************************************************************************************
3 // ! HumanItemBehaviorCfg - per item config of stances / movements
4 // *************************************************************************************
6 {
7 
8  // static int DEFMOVEMENT = MOVEMENT_IDLE | MOVEMENT_WALK | MOVEMENT_RUN | SPRINT;
9 
11  static int IKSETTING_AIMING = 0x1;
12  static int IKSETTING_RHAND = 0x2;
13  static int IKSETTING_LHAND = 0x4;
14 
15  int m_iType;
16 
17  int m_iStanceMask;
18  int m_StanceMovements[6];
19  int m_StanceRotation[6];
20  int m_IKSettings[24];
21  int m_IKSettingsMelee[2];
22  int m_iPerItemCameraUserData;
23 
25  float m_fMoveHeadingFilterSpan;
26  float m_fMoveHeadingSprintFilterSpan;
27  float m_fMoveHeadingProneFilterSpan;
28  float m_fMoveHeadingFilterSpeed;
29 
31  float m_fMeleeEvadeHeadingFilterSpan;
32  float m_fMeleeEvadeHeadingFilterSpeed;
33 
34 
36  bool m_bAttackLean;
37 
39  bool m_bJumpAllowed;
40 
41  private bool m_bPlaceholder;
42 
43 
44  void SetIK(int pStance, int pMovement, bool pAim, bool pRArm, bool pLArm)
45  {
46  int val = 0;
47  if (pAim) val |= IKSETTING_AIMING;
48  if (pRArm) val |= IKSETTING_RHAND;
49  if (pLArm) val |= IKSETTING_LHAND;
50 
51  // Print("Setting ik " + pStance.ToString() + "," + pMovement.ToString() );
52  pStance = pStance * 4;
53  pStance = pStance + pMovement;
54 
55  // Print("Setting ik " + pStance.ToString() + " to value " + val.ToString() );
56  m_IKSettings[pStance] = val;
57  }
58 
59  void SetIKStance(int pStance, bool pAim, bool pRArm, bool pLArm)
60  {
61  int val = 0;
62  if (pAim) val |= IKSETTING_AIMING;
63  if (pRArm) val |= IKSETTING_RHAND;
64  if (pLArm) val |= IKSETTING_LHAND;
65 
66  int bo = pStance * 4;
67 
68  for (int i = 0; i < 4; i++)
69  {
70  m_IKSettings[bo+i] = val;
71  }
72  }
73 
74  void SetIKMelee(int pHitType, bool pAim, bool pRArm, bool pLArm)
75  {
76  int val = 0;
77  if (pAim) val |= IKSETTING_AIMING;
78  if (pRArm) val |= IKSETTING_RHAND;
79  if (pLArm) val |= IKSETTING_LHAND;
80 
81  m_IKSettingsMelee[pHitType] = val;
82  }
83 
84  void SetIKAll(bool pAim, bool pRArm, bool pLArm)
85  {
86  int val = 0;
87  if (pAim) val |= IKSETTING_AIMING;
88  if (pRArm) val |= IKSETTING_RHAND;
89  if (pLArm) val |= IKSETTING_LHAND;
90 
91  int i;
92  for (i = 0; i < 24; i++)
93  {
94  m_IKSettings[i] = val;
95  }
96 
97  for (i = 0; i < 2; i++)
98  {
99  m_IKSettingsMelee[i] = val;
100  }
101  }
102 
103 
104 }
105 
106 
107 
108 // *************************************************************************************
109 // ! HumanItemAccessor - item helpers
110 // *************************************************************************************
111 class HumanItemAccessor
112 {
114  proto native void OnItemInHandsChanged(bool pInstant = false);
115 
117  proto native void ResetWeaponInHands();
118 
120  proto native void HideItemInHands(bool pState);
121 
123  proto native bool IsItemInHandsHidden();
124 
126  proto native bool IsItemInHandsWeapon();
127 
129  proto native bool WeaponGetCameraPoint(out vector pPos, out vector pRot);
130 
132  proto native bool WeaponGetCameraPointMSTransform (notnull EntityAI pCamEntity, vector pCamPoint, vector pCamDir, out vector pTm[4]);
133 
135  proto native bool WeaponGetCameraPointBoneRelative(notnull EntityAI pCamEntity, vector pCamPoint, vector pCamDir, int pBoneIndex, out vector pTm[4]);
136 
138  proto native bool WeaponGetAimingModelDirTm(out vector pTm[4]);
139 
142 
143  private void HumanItemAccessor()
144  {
145  }
146 
147  private void ~HumanItemAccessor()
148  {
149  }
150 }
HideItemInHands
proto native void HideItemInHands(bool pState)
hides item in hands visually
WeaponGetCameraPoint
proto native bool WeaponGetCameraPoint(out vector pPos, out vector pRot)
returns true if weapon is item and it has camera point - local pos, dir in weapon space
m_IKSettings
int m_IKSettings[24]
Definition: humanitems.c:15
IsItemInHandsWeapon
proto native bool IsItemInHandsWeapon()
returns true if item in hands is a weapon
IsItemInHandsHidden
proto native bool IsItemInHandsHidden()
returns if item in hands is hidden visually
WeaponGetCameraPointMSTransform
proto native bool WeaponGetCameraPointMSTransform(notnull EntityAI pCamEntity, vector pCamPoint, vector pCamDir, out vector pTm[4])
returns true if weapon is item and it has camera point - model space matrix -
ResetWeaponInHands
proto native void ResetWeaponInHands()
reset weapon anim override in case of premature death
OnItemInHandsChanged
class HumanItemBehaviorCfg OnItemInHandsChanged(bool pInstant=false)
signalization from script to engine that item in hands changed
vector
Definition: enconvert.c:105
GetItemInHandsBehaviourCfg
proto native HumanItemBehaviorCfg GetItemInHandsBehaviourCfg()
~HumanItemAccessor
private void ~HumanItemAccessor()
Definition: humanitems.h:147
m_IKSettingsMelee
int m_IKSettingsMelee[2]
[stance][movement] mask for ik
Definition: humanitems.c:16
HumanItemAccessor
private void HumanItemAccessor()
Definition: humanitems.h:143
WeaponGetCameraPointBoneRelative
proto native bool WeaponGetCameraPointBoneRelative(notnull EntityAI pCamEntity, vector pCamPoint, vector pCamDir, int pBoneIndex, out vector pTm[4])
returns true if weapon is item and it has camera point - model space matrix -
HumanItemBehaviorCfg
Definition: humanitems.c:5
WeaponGetAimingModelDirTm
proto native bool WeaponGetAimingModelDirTm(out vector pTm[4])
return current aiming point from aiming model (additive swaying applied - no recoil points)
EntityAI
Definition: building.c:5