VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiDiGuyCtrl.h
Go to the documentation of this file.
1 
5 
6 #pragma once
7 
9 
10 #include <CigiBaseVariableSizePckt.h>
11 
12 #include <string>
13 
14 
15 //+> Packet layout
16 // |-------------------------------------------------------------------------------------------------------------------------------|
17 // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
18 // |-------------------------------------------------------------------------------------------------------------------------------|
19 // | Packet Id = 201 | Packet Size = 16+strLen | Entity ID |
20 // |-------------------------------------------------------------------------------------------------------------------------------|
21 // | Reserved | *4 | *3| *2| *1| Reserved | *9| *8| *7| *6| *5| Reserved |
22 // |-------------------------------------------------------------------------------------------------------------------------------|
23 // | Animation speed |
24 // | |
25 // |-------------------------------------------------------------------------------------------------------------------------------|
26 // | Animation (variable, multiple of 8 bytes) |
27 // |_______________________________________________________________________________________________________________________________|
28 
29 // *1 Action Paused
30 // *2 Weapon State
31 // *3 Health State
32 // *4 Posture
33 // *5 Action Paused Enable
34 // *6 Weapon State Enable
35 // *7 Health State Enable
36 // *8 Posture Enable
37 // *9 Animation Speed Enable
38 //
39 namespace makCigiExt
40 {
41 
42  const int CIGI_DI_GUY_CTRL_PACKET_ID = 201;
43 
44  // This is the size of the FIXED portion of the packet
46 
47  //=========================================================
55  {
56  public:
57  //=========================================================
61  {
62  Unpaused=0,
63  Paused=1
64  };
65 
66  //=========================================================
70  {
71  Stowed=0,
72  Deployed=1
73  };
74 
75  //=========================================================
79  {
80  Standing=0,
81  Sitting=1,
82  Crouched=2,
83  Prone=3
84  };
85 
86  //=========================================================
90  {
91  Alive=0,
92  Dead=1
93  };
94 
95  //==> Management
96 
97  //=========================================================
100  DtCigiDiGuyCtrl(void);
101 
102  //=========================================================
105  virtual ~DtCigiDiGuyCtrl(void);
106 
107  //=========================================================
110  DtCigiDiGuyCtrl(const DtCigiDiGuyCtrl &BaseIn);
111 
112  //=========================================================
115  DtCigiDiGuyCtrl& operator=(const DtCigiDiGuyCtrl& BaseIn);
116 
117  //==> Buffer Packing/Unpacking
118 
119  //=========================================================
130  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const;
131 
132  //=========================================================
142  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec);
143 
144  //=========================================================
152  { return(PacketSize + refPacket.GetVariableDataSize()); }
153 
154  //==> Accessing Member Variable Values functions
155 
156  //+> EntityID
157 
158  //=========================================================
168  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
169  {
170  myEntityID = EntityIDIn;
171  return(CIGI_SUCCESS);
172  }
173 
174  //=========================================================
180  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
181 
182  //+> PostureEn
183 
184  //=========================================================
192  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
193  {
194  myPostureEn = PostureEnIn;
195  return(CIGI_SUCCESS);
196  }
197 
198  //=========================================================
201  bool GetPostureEn(void) const { return(myPostureEn); }
202 
203  //+> Posture
204 
205  //=========================================================
217  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
218 
219  //=========================================================
227  PostureGrp GetPosture(void) const { return(myPosture); }
228 
229  //+> WeaponStateEn
230 
231  //=========================================================
239  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
240  {
241  myWeaponStateEn = WeaponStateEnIn;
242  return(CIGI_SUCCESS);
243  }
244 
245  //=========================================================
248  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
249 
250  //+> WeaponState
251 
252  //=========================================================
262  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
263 
264  //=========================================================
270  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
271 
272  //+> AnimationStateEn
273 
274  //=========================================================
282  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
283  {
284  myAnimationStateEn = AnimationStateEnIn;
285  return(CIGI_SUCCESS);
286  }
287 
288  //=========================================================
291  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
292 
293  //+> AnimationState
294 
295  //=========================================================
305  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
306 
307  //=========================================================
313  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
314 
315  //+> HealthStateEn
316 
317  //=========================================================
325  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
326  {
327  myHealthStateEn = HealthStateEnIn;
328  return(CIGI_SUCCESS);
329  }
330 
331  //=========================================================
334  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
335 
336  //+> HealthState
337 
338  //=========================================================
348  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
349 
350  //=========================================================
356  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
357 
358  //+> AnimationSpeedEn
359 
360  //=========================================================
368  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
369  {
370  myAnimationSpeedEn = AnimationSpeedEnIn;
371  return(CIGI_SUCCESS);
372  }
373 
374  //=========================================================
377  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
378 
379  //+> Animation Speed
380 
381  //=========================================================
388  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
389 
390  //=========================================================
394  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
395 
396  //+> Animation
397 
400  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
401 
404  int GetAnimationSize(void) const { return(VariableDataSize); }
405 
406  //=========================================================
409  const std::string & GetAnimation(void) const { return(myAnimation); }
410 
411  protected:
412 
413  Cigi_uint16 myEntityID;
416  std::string myAnimation;
420 
426 
427  //=========================================================
432  static const int MaxCharCnt = 224;
433  };
434 }
435 
bool GetAnimationSpeedEn(void) const
Gets the AnimationSpeedEn value.
Definition: DtCigiDiGuyCtrl.h:377
std::string myAnimation
Definition: DtCigiDiGuyCtrl.h:416
AnimationStateGrp myAnimationState
Definition: DtCigiDiGuyCtrl.h:418
double myAnimationSpeed
Definition: DtCigiDiGuyCtrl.h:417
bool GetHealthStateEn(void) const
Gets the HealthStateEn value.
Definition: DtCigiDiGuyCtrl.h:334
PostureGrp myPosture
Definition: DtCigiDiGuyCtrl.h:414
This is the original DiGuy control packet for V3. It is maintained for backward compatibility, but is deprecated. New users should use DtCigiDiGuyCtrlExt for V3.x and DtCigiDiGuyCtrlExtV4 for V4.
Definition: DtCigiDiGuyCtrl.h:53
bool myPostureEn
Definition: DtCigiDiGuyCtrl.h:421
double GetAnimationSpeed(void) const
Gets the AnimationSpeed.
Definition: DtCigiDiGuyCtrl.h:394
Cigi_uint16 GetEntityID(void) const
Gets the Entity ID value.
Definition: DtCigiDiGuyCtrl.h:180
Contains DLL export macros.
bool myHealthStateEn
Definition: DtCigiDiGuyCtrl.h:425
AnimationStateGrp GetAnimationState(void) const
Gets the AnimationState value.
Definition: DtCigiDiGuyCtrl.h:313
HealthStateGrp
The enumeration for the Health flag.
Definition: DtCigiDiGuyCtrl.h:89
bool myAnimationStateEn
Definition: DtCigiDiGuyCtrl.h:423
const int CIGI_DI_GUY_CTRL_PACKET_SIZE
Definition: DtCigiDiGuyCtrl.h:45
WeaponStateGrp myWeaponState
Definition: DtCigiDiGuyCtrl.h:415
WeaponStateGrp GetWeaponState(void) const
Gets the WeaponState value.
Definition: DtCigiDiGuyCtrl.h:270
const int CIGI_DI_GUY_CTRL_PACKET_ID
Definition: DtCigiDiGuyCtrl.h:42
int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
Sets the PostureEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:192
int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
Sets the WeaponStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:239
bool myAnimationSpeedEn
Definition: DtCigiDiGuyCtrl.h:424
PostureGrp
The enumeration for the Posture flags.
Definition: DtCigiDiGuyCtrl.h:78
bool GetAnimationStateEn(void) const
Gets the AnimationStateEn value.
Definition: DtCigiDiGuyCtrl.h:291
Cigi_uint16 myEntityID
Definition: DtCigiDiGuyCtrl.h:413
bool myWeaponStateEn
Definition: DtCigiDiGuyCtrl.h:422
HealthStateGrp myHealthState
Definition: DtCigiDiGuyCtrl.h:419
const std::string & GetAnimation(void) const
Gets the Animation (Action) string.
Definition: DtCigiDiGuyCtrl.h:409
bool GetWeaponStateEn(void) const
Gets the WeaponStateEn value.
Definition: DtCigiDiGuyCtrl.h:248
virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
A virtual function to determine the size that the packet will take up when packed.
Definition: DtCigiDiGuyCtrl.h:151
int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
Sets the AnimationStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:282
int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
Sets the AnimationSpeedEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:368
#define DT_DLL_MAKCIGIEXTENSIONS
Definition: makCigiExtensions.h:17
HealthStateGrp GetHealthState(void) const
Gets the HealthState value.
Definition: DtCigiDiGuyCtrl.h:356
int GetAnimationSize(void) const
Definition: DtCigiDiGuyCtrl.h:404
bool GetPostureEn(void) const
Gets the PostureEn value.
Definition: DtCigiDiGuyCtrl.h:201
WeaponStateGrp
The enumeration for the Weapon State flag.
Definition: DtCigiDiGuyCtrl.h:69
int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
Sets the HealthStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:325
int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
Sets the Entity ID with bound checking control.
Definition: DtCigiDiGuyCtrl.h:168
PostureGrp GetPosture(void) const
Gets the Posture value.
Definition: DtCigiDiGuyCtrl.h:227
AnimationStateGrp
The enumeration for the Animation Paused/Not Paused flag.
Definition: DtCigiDiGuyCtrl.h:60

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)