VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiBaseDiGuyCtrlExt.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2020 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 namespace makCigiExt
19 {
20 
22 
23  // This is the size of the FIXED portion of the packet
25 
27 
28  // This is the size of the FIXED portion of the packet
30 
31  //=========================================================
36  {
37  public:
38  //=========================================================
42  {
43  Unpaused=0,
44  Paused=1
45  };
46 
47  //=========================================================
51  {
52  Stowed=0,
53  Deployed=1
54  };
55 
56  //=========================================================
60  {
61  Standing=0,
62  Sitting=1,
63  Crouched=2,
64  Prone=3
65  };
66 
67  //=========================================================
71  {
72  Alive=0,
73  Dead=1
74  };
75 
76  //==> Management
77 
78  //=========================================================
82 
83  //=========================================================
86  virtual ~DtCigiBaseDiGuyCtrlExt(void);
87 
88  //=========================================================
92 
93  //=========================================================
96  DtCigiBaseDiGuyCtrlExt& operator=(const DtCigiBaseDiGuyCtrlExt& BaseIn);
97 
98  //==> Buffer Packing/Unpacking
99 
100  //=========================================================
111  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const = 0;
112 
113  //=========================================================
123  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec) = 0;
124 
125  //=========================================================
133  { return(PacketSize + refPacket.GetVariableDataSize()); }
134 
135  //==> Accessing Member Variable Values functions
136 
137  //+> EntityID
138 
139  //=========================================================
149  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
150  {
151  myEntityID = EntityIDIn;
152  return(CIGI_SUCCESS);
153  }
154 
155  //=========================================================
161  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
162 
163  //+> PostureEn
164 
165  //=========================================================
173  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
174  {
175  myPostureEn = PostureEnIn;
176  return(CIGI_SUCCESS);
177  }
178 
179  //=========================================================
182  bool GetPostureEn(void) const { return(myPostureEn); }
183 
184  //+> Posture
185 
186  //=========================================================
198  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
199 
200  //=========================================================
208  PostureGrp GetPosture(void) const { return(myPosture); }
209 
210  //+> WeaponStateEn
211 
212  //=========================================================
220  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
221  {
222  myWeaponStateEn = WeaponStateEnIn;
223  return(CIGI_SUCCESS);
224  }
225 
226  //=========================================================
229  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
230 
231  //+> WeaponState
232 
233  //=========================================================
243  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
244 
245  //=========================================================
251  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
252 
253  //+> AnimationStateEn
254 
255  //=========================================================
263  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
264  {
265  myAnimationStateEn = AnimationStateEnIn;
266  return(CIGI_SUCCESS);
267  }
268 
269  //=========================================================
272  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
273 
274  //+> AnimationState
275 
276  //=========================================================
286  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
287 
288  //=========================================================
294  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
295 
296  //+> HealthStateEn
297 
298  //=========================================================
306  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
307  {
308  myHealthStateEn = HealthStateEnIn;
309  return(CIGI_SUCCESS);
310  }
311 
312  //=========================================================
315  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
316 
317  //+> HealthState
318 
319  //=========================================================
329  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
330 
331  //=========================================================
337  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
338 
339  //+> AnimationSpeedEn
340 
341  //=========================================================
349  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
350  {
351  myAnimationSpeedEn = AnimationSpeedEnIn;
352  return(CIGI_SUCCESS);
353  }
354 
355  //=========================================================
358  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
359 
360  //+> Animation Speed
361 
362  //=========================================================
369  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
370 
371  //=========================================================
375  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
376 
377  //+> ScaleEn
378 
379  //=========================================================
387  int SetScaleEn(const bool ScaleEnIn, bool bndchk=true)
388  {
389  myScaleEn = ScaleEnIn;
390  return(CIGI_SUCCESS);
391  }
392 
393  //=========================================================
396  bool GetScaleEn(void) const { return(myScaleEn); }
397 
398  //+> Scale
399 
400  //=========================================================
408  int SetScale(float XScaleIn, float YScaleIn, float ZScaleIn, bool bndchk=true);
409 
410  //=========================================================
416  void GetScale(float& XScaleOut, float& YScaleOut, float& ZScaleOut ) const;
417 
418  //+> WeightEn
419 
420  //=========================================================
428  int SetWeightEn(const bool WeightEnIn, bool bndchk=true)
429  {
430  myWeightEn = WeightEnIn;
431  return(CIGI_SUCCESS);
432  }
433 
434  //=========================================================
437  bool GetWeightEn(void) const { return(myWeightEn); }
438 
439  //+> Weight
440 
441  //=========================================================
447  int SetWeight(const float WeightIn, bool bndchk=true);
448 
449  //=========================================================
453  float GetWeight(void) const { return(myWeight); }
454 
455  //+> Animation
456 
459  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
460 
463  int GetAnimationSize(void) const { return(myAnimationSize); }
464 
465  //=========================================================
468  const std::string & GetAnimation(void) const { return(myAnimation); }
469 
470  //+> Head Appearance
471 
474  int SetHeadAppearance(const std::string &HeadAppearanceIn, bool bndchk=true);
475 
479  int GetHeadAppearanceSize(void) const { return(myHeadAppearanceSize); }
480 
481  //=========================================================
484  const std::string & GetHeadAppearance(void) const { return(myHeadAppearance); }
485 
486  //+> Item Appearance
487 
490  int SetItemAppearance(const std::string &ItemAppearanceIn, bool bndchk=true);
491 
495  int GetItemAppearanceSize(void) const { return(myItemAppearanceSize); }
496 
497  //=========================================================
500  const std::string & GetItemAppearance(void) const { return(myItemAppearance); }
501 
502  protected:
503  static int CalculatePaddedStringSize( int StringSizeIn );
504  static void BufferToString( PackPointer& CDta, std::string& StringOut );
505 
506 
507  protected:
508 
509  Cigi_uint16 myEntityID;
512  int myAnimationSize; // This is the string size padded to a multiple of 8
513  std::string myAnimation;
514  int myHeadAppearanceSize; // This is the string size padded to a multiple of 8
515  std::string myHeadAppearance;
516  int myItemAppearanceSize; // This is the string size padded to a multiple of 8
517  std::string myItemAppearance;
521  float myXScale;
522  float myYScale;
523  float myZScale;
524  float myWeight;
525 
531  bool myScaleEn;
533 
534  //=========================================================
539 
543  static const int MaxStringCharCnt = 71;
544  };
545 }
546 
const std::string & GetItemAppearance(void) const
Gets the Item Appearance string.
Definition: DtCigiBaseDiGuyCtrlExt.h:500
int SetWeightEn(const bool WeightEnIn, bool bndchk=true)
Sets the WeightEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:428
AnimationStateGrp
The enumeration for the Animation Paused/Not Paused flag.
Definition: DtCigiBaseDiGuyCtrlExt.h:41
Cigi_uint16 myEntityID
Definition: DtCigiBaseDiGuyCtrlExt.h:509
WeaponStateGrp GetWeaponState(void) const
Gets the WeaponState value.
Definition: DtCigiBaseDiGuyCtrlExt.h:251
const std::string & GetAnimation(void) const
Gets the Animation (Action) string.
Definition: DtCigiBaseDiGuyCtrlExt.h:468
float myWeight
Definition: DtCigiBaseDiGuyCtrlExt.h:524
int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
Sets the AnimationStateEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:263
const int CIGI_DI_GUY_CTRL_EXT_PACKET_SIZE
Definition: DtCigiBaseDiGuyCtrlExt.h:24
PostureGrp GetPosture(void) const
Gets the Posture value.
Definition: DtCigiBaseDiGuyCtrlExt.h:208
WeaponStateGrp
The enumeration for the Weapon State flag.
Definition: DtCigiBaseDiGuyCtrlExt.h:50
The base class for all packets.
Definition: DtCigiBaseDiGuyCtrlExt.h:34
int GetAnimationSize(void) const
Definition: DtCigiBaseDiGuyCtrlExt.h:463
Cigi_uint16 GetEntityID(void) const
Gets the Entity ID value.
Definition: DtCigiBaseDiGuyCtrlExt.h:161
PostureGrp
The enumeration for the Posture flags.
Definition: DtCigiBaseDiGuyCtrlExt.h:59
std::string myHeadAppearance
Definition: DtCigiBaseDiGuyCtrlExt.h:515
int myHeadAppearanceSize
Definition: DtCigiBaseDiGuyCtrlExt.h:514
float myYScale
Definition: DtCigiBaseDiGuyCtrlExt.h:522
double myAnimationSpeed
Definition: DtCigiBaseDiGuyCtrlExt.h:518
double GetAnimationSpeed(void) const
Gets the AnimationSpeed.
Definition: DtCigiBaseDiGuyCtrlExt.h:375
Contains DLL export macros.
PostureGrp myPosture
Definition: DtCigiBaseDiGuyCtrlExt.h:510
int GetHeadAppearanceSize(void) const
Definition: DtCigiBaseDiGuyCtrlExt.h:479
HealthStateGrp
The enumeration for the Health flag.
Definition: DtCigiBaseDiGuyCtrlExt.h:70
int myItemAppearanceSize
Definition: DtCigiBaseDiGuyCtrlExt.h:516
bool myPostureEn
Definition: DtCigiBaseDiGuyCtrlExt.h:526
bool myScaleEn
Definition: DtCigiBaseDiGuyCtrlExt.h:531
float GetWeight(void) const
Gets the Weight.
Definition: DtCigiBaseDiGuyCtrlExt.h:453
AnimationStateGrp myAnimationState
Definition: DtCigiBaseDiGuyCtrlExt.h:519
virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
A virtual function to determine the size that the packet will take up when packed.
Definition: DtCigiBaseDiGuyCtrlExt.h:132
bool GetScaleEn(void) const
Gets the ScaleEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:396
const int CIGI_DI_GUY_CTRL_EXT_PACKET_SIZE_V4
Definition: DtCigiBaseDiGuyCtrlExt.h:29
bool GetAnimationStateEn(void) const
Gets the AnimationStateEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:272
bool GetWeightEn(void) const
Gets the WeightEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:437
HealthStateGrp GetHealthState(void) const
Gets the HealthState value.
Definition: DtCigiBaseDiGuyCtrlExt.h:337
int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
Sets the PostureEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:173
int GetItemAppearanceSize(void) const
Definition: DtCigiBaseDiGuyCtrlExt.h:495
const int CIGI_DI_GUY_CTRL_EXT_PACKET_ID_V4
Definition: DtCigiBaseDiGuyCtrlExt.h:26
int myAnimationSize
Definition: DtCigiBaseDiGuyCtrlExt.h:512
bool GetWeaponStateEn(void) const
Gets the WeaponStateEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:229
int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
Sets the HealthStateEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:306
int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
Sets the Entity ID with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:149
const int CIGI_DI_GUY_CTRL_EXT_PACKET_ID
Definition: DtCigiBaseDiGuyCtrlExt.h:21
int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
Sets the WeaponStateEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:220
bool myHealthStateEn
Definition: DtCigiBaseDiGuyCtrlExt.h:530
int SetScaleEn(const bool ScaleEnIn, bool bndchk=true)
Sets the ScaleEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:387
AnimationStateGrp GetAnimationState(void) const
Gets the AnimationState value.
Definition: DtCigiBaseDiGuyCtrlExt.h:294
const std::string & GetHeadAppearance(void) const
Gets the Head Appearance string.
Definition: DtCigiBaseDiGuyCtrlExt.h:484
std::string myAnimation
Definition: DtCigiBaseDiGuyCtrlExt.h:513
#define DT_DLL_MAKCIGIEXTENSIONS
Definition: makCigiExtensions.h:17
int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
Sets the AnimationSpeedEn with bound checking control.
Definition: DtCigiBaseDiGuyCtrlExt.h:349
bool myAnimationSpeedEn
Definition: DtCigiBaseDiGuyCtrlExt.h:529
bool myAnimationStateEn
Definition: DtCigiBaseDiGuyCtrlExt.h:528
bool myWeightEn
Definition: DtCigiBaseDiGuyCtrlExt.h:532
WeaponStateGrp myWeaponState
Definition: DtCigiBaseDiGuyCtrlExt.h:511
float myXScale
Definition: DtCigiBaseDiGuyCtrlExt.h:521
std::string myItemAppearance
Definition: DtCigiBaseDiGuyCtrlExt.h:517
float myZScale
Definition: DtCigiBaseDiGuyCtrlExt.h:523
bool GetPostureEn(void) const
Gets the PostureEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:182
bool GetHealthStateEn(void) const
Gets the HealthStateEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:315
HealthStateGrp myHealthState
Definition: DtCigiBaseDiGuyCtrlExt.h:520
bool myWeaponStateEn
Definition: DtCigiBaseDiGuyCtrlExt.h:527
bool GetAnimationSpeedEn(void) const
Gets the AnimationSpeedEn value.
Definition: DtCigiBaseDiGuyCtrlExt.h:358

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)