VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiDiGuyCtrl.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2019 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <CigiBaseVariableSizePckt.h>
15 
16 #include <string>
17 
18 
19 //+> Packet layout
20 // |-------------------------------------------------------------------------------------------------------------------------------|
21 // | 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 |
22 // |-------------------------------------------------------------------------------------------------------------------------------|
23 // | Packet Id = 201 | Packet Size = 16+strLen | Entity ID |
24 // |-------------------------------------------------------------------------------------------------------------------------------|
25 // | Reserved | *4 | *3| *2| *1| Reserved | *9| *8| *7| *6| *5| Reserved |
26 // |-------------------------------------------------------------------------------------------------------------------------------|
27 // | Animation speed |
28 // | |
29 // |-------------------------------------------------------------------------------------------------------------------------------|
30 // | Animation (variable, multiple of 8 bytes) |
31 // |_______________________________________________________________________________________________________________________________|
32 
33 // *1 Action Paused
34 // *2 Weapon State
35 // *3 Health State
36 // *4 Posture
37 // *5 Action Paused Enable
38 // *6 Weapon State Enable
39 // *7 Health State Enable
40 // *8 Posture Enable
41 // *9 Animation Speed Enable
42 //
43 namespace makCigiExt
44 {
45 
46  const int CIGI_DI_GUY_CTRL_PACKET_ID = 201;
47 
48  // This is the size of the FIXED portion of the packet
50 
51  //=========================================================
59  {
60  public:
61  //=========================================================
65  {
66  Unpaused=0,
67  Paused=1
68  };
69 
70  //=========================================================
74  {
75  Stowed=0,
76  Deployed=1
77  };
78 
79  //=========================================================
83  {
84  Standing=0,
85  Sitting=1,
86  Crouched=2,
87  Prone=3
88  };
89 
90  //=========================================================
94  {
95  Alive=0,
96  Dead=1
97  };
98 
99  //==> Management
100 
101  //=========================================================
104  DtCigiDiGuyCtrl(void);
105 
106  //=========================================================
109  virtual ~DtCigiDiGuyCtrl(void);
110 
111  //=========================================================
114  DtCigiDiGuyCtrl(const DtCigiDiGuyCtrl &BaseIn);
115 
116  //=========================================================
119  DtCigiDiGuyCtrl& operator=(const DtCigiDiGuyCtrl& BaseIn);
120 
121  //==> Buffer Packing/Unpacking
122 
123  //=========================================================
134  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const;
135 
136  //=========================================================
146  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec);
147 
148  //=========================================================
156  { return(PacketSize + refPacket.GetVariableDataSize()); }
157 
158  //==> Accessing Member Variable Values functions
159 
160  //+> EntityID
161 
162  //=========================================================
172  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
173  {
174  myEntityID = EntityIDIn;
175  return(CIGI_SUCCESS);
176  }
177 
178  //=========================================================
184  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
185 
186  //+> PostureEn
187 
188  //=========================================================
196  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
197  {
198  myPostureEn = PostureEnIn;
199  return(CIGI_SUCCESS);
200  }
201 
202  //=========================================================
205  bool GetPostureEn(void) const { return(myPostureEn); }
206 
207  //+> Posture
208 
209  //=========================================================
221  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
222 
223  //=========================================================
231  PostureGrp GetPosture(void) const { return(myPosture); }
232 
233  //+> WeaponStateEn
234 
235  //=========================================================
243  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
244  {
245  myWeaponStateEn = WeaponStateEnIn;
246  return(CIGI_SUCCESS);
247  }
248 
249  //=========================================================
252  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
253 
254  //+> WeaponState
255 
256  //=========================================================
266  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
267 
268  //=========================================================
274  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
275 
276  //+> AnimationStateEn
277 
278  //=========================================================
286  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
287  {
288  myAnimationStateEn = AnimationStateEnIn;
289  return(CIGI_SUCCESS);
290  }
291 
292  //=========================================================
295  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
296 
297  //+> AnimationState
298 
299  //=========================================================
309  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
310 
311  //=========================================================
317  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
318 
319  //+> HealthStateEn
320 
321  //=========================================================
329  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
330  {
331  myHealthStateEn = HealthStateEnIn;
332  return(CIGI_SUCCESS);
333  }
334 
335  //=========================================================
338  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
339 
340  //+> HealthState
341 
342  //=========================================================
352  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
353 
354  //=========================================================
360  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
361 
362  //+> AnimationSpeedEn
363 
364  //=========================================================
372  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
373  {
374  myAnimationSpeedEn = AnimationSpeedEnIn;
375  return(CIGI_SUCCESS);
376  }
377 
378  //=========================================================
381  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
382 
383  //+> Animation Speed
384 
385  //=========================================================
392  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
393 
394  //=========================================================
398  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
399 
400  //+> Animation
401 
404  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
405 
408  int GetAnimationSize(void) const { return(VariableDataSize); }
409 
410  //=========================================================
413  const std::string & GetAnimation(void) const { return(myAnimation); }
414 
415  protected:
416 
417  Cigi_uint16 myEntityID;
420  std::string myAnimation;
424 
430 
431  //=========================================================
436  static const int MaxCharCnt = 224;
437  };
438 }
439 
bool GetAnimationSpeedEn(void) const
Gets the AnimationSpeedEn value.
Definition: DtCigiDiGuyCtrl.h:381
std::string myAnimation
Definition: DtCigiDiGuyCtrl.h:420
AnimationStateGrp myAnimationState
Definition: DtCigiDiGuyCtrl.h:422
double myAnimationSpeed
Definition: DtCigiDiGuyCtrl.h:421
bool GetHealthStateEn(void) const
Gets the HealthStateEn value.
Definition: DtCigiDiGuyCtrl.h:338
PostureGrp myPosture
Definition: DtCigiDiGuyCtrl.h:418
This is the original DiGuy control packet for V3.
Definition: DtCigiDiGuyCtrl.h:57
bool myPostureEn
Definition: DtCigiDiGuyCtrl.h:425
double GetAnimationSpeed(void) const
Gets the AnimationSpeed.
Definition: DtCigiDiGuyCtrl.h:398
Cigi_uint16 GetEntityID(void) const
Gets the Entity ID value.
Definition: DtCigiDiGuyCtrl.h:184
Contains DLL export macros.
bool myHealthStateEn
Definition: DtCigiDiGuyCtrl.h:429
AnimationStateGrp GetAnimationState(void) const
Gets the AnimationState value.
Definition: DtCigiDiGuyCtrl.h:317
HealthStateGrp
The enumeration for the Health flag.
Definition: DtCigiDiGuyCtrl.h:93
bool myAnimationStateEn
Definition: DtCigiDiGuyCtrl.h:427
const int CIGI_DI_GUY_CTRL_PACKET_SIZE
Definition: DtCigiDiGuyCtrl.h:49
WeaponStateGrp myWeaponState
Definition: DtCigiDiGuyCtrl.h:419
WeaponStateGrp GetWeaponState(void) const
Gets the WeaponState value.
Definition: DtCigiDiGuyCtrl.h:274
const int CIGI_DI_GUY_CTRL_PACKET_ID
Definition: DtCigiDiGuyCtrl.h:46
int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
Sets the PostureEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:196
int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
Sets the WeaponStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:243
bool myAnimationSpeedEn
Definition: DtCigiDiGuyCtrl.h:428
PostureGrp
The enumeration for the Posture flags.
Definition: DtCigiDiGuyCtrl.h:82
bool GetAnimationStateEn(void) const
Gets the AnimationStateEn value.
Definition: DtCigiDiGuyCtrl.h:295
Cigi_uint16 myEntityID
Definition: DtCigiDiGuyCtrl.h:417
bool myWeaponStateEn
Definition: DtCigiDiGuyCtrl.h:426
HealthStateGrp myHealthState
Definition: DtCigiDiGuyCtrl.h:423
const std::string & GetAnimation(void) const
Gets the Animation (Action) string.
Definition: DtCigiDiGuyCtrl.h:413
bool GetWeaponStateEn(void) const
Gets the WeaponStateEn value.
Definition: DtCigiDiGuyCtrl.h:252
virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
A virtual function to determine the size that the packet will take up when packed.
Definition: DtCigiDiGuyCtrl.h:155
int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
Sets the AnimationStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:286
int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
Sets the AnimationSpeedEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:372
#define DT_DLL_MAKCIGIEXTENSIONS
Definition: makCigiExtensions.h:17
HealthStateGrp GetHealthState(void) const
Gets the HealthState value.
Definition: DtCigiDiGuyCtrl.h:360
int GetAnimationSize(void) const
Definition: DtCigiDiGuyCtrl.h:408
bool GetPostureEn(void) const
Gets the PostureEn value.
Definition: DtCigiDiGuyCtrl.h:205
WeaponStateGrp
The enumeration for the Weapon State flag.
Definition: DtCigiDiGuyCtrl.h:73
int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
Sets the HealthStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:329
int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
Sets the Entity ID with bound checking control.
Definition: DtCigiDiGuyCtrl.h:172
PostureGrp GetPosture(void) const
Gets the Posture value.
Definition: DtCigiDiGuyCtrl.h:231
AnimationStateGrp
The enumeration for the Animation Paused/Not Paused flag.
Definition: DtCigiDiGuyCtrl.h:64

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)