VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiDiGuyCtrlExt.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2017 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|Res|*11|*10| *9| *8| *7| *6| *5| Reserved |
26 // |-------------------------------------------------------------------------------------------------------------------------------|
27 // | X Scale |
28 // |-------------------------------------------------------------------------------------------------------------------------------|
29 // | Y Scale |
30 // |-------------------------------------------------------------------------------------------------------------------------------|
31 // | Z Scale |
32 // |-------------------------------------------------------------------------------------------------------------------------------|
33 // | Weight |
34 // |-------------------------------------------------------------------------------------------------------------------------------|
35 // | Animation speed |
36 // | |
37 // |-------------------------------------------------------------------------------------------------------------------------------|
38 // | Animation (variable, multiple of 8 bytes) |
39 // |-------------------------------------------------------------------------------------------------------------------------------|
40 // | Item Appearance (variable, multiple of 8 bytes) |
41 // |-------------------------------------------------------------------------------------------------------------------------------|
42 // | Head Appearance (variable, multiple of 8 bytes) |
43 // |_______________________________________________________________________________________________________________________________|
44 
45 // *1 Action Paused
46 // *2 Weapon State
47 // *3 Health State
48 // *4 Posture
49 // *5 Action Paused Enable
50 // *6 Weapon State Enable
51 // *7 Posture Enable
52 // *8 Animation Speed Enable
53 // *9 Health State Enable
54 // *10 Scale Enable
55 // *11 Weight Enable
56 //
57 namespace makCigiExt
58 {
59 
61 
62  // This is the size of the FIXED portion of the packet
64 
65  //=========================================================
70  {
71  public:
72  //=========================================================
76  {
77  Unpaused=0,
78  Paused=1
79  };
80 
81  //=========================================================
85  {
86  Stowed=0,
87  Deployed=1
88  };
89 
90  //=========================================================
94  {
95  Standing=0,
96  Sitting=1,
97  Crouched=2,
98  Prone=3
99  };
100 
101  //=========================================================
105  {
106  Alive=0,
107  Dead=1
108  };
109 
110  //==> Management
111 
112  //=========================================================
115  DtCigiDiGuyCtrlExt(void);
116 
117  //=========================================================
120  virtual ~DtCigiDiGuyCtrlExt(void);
121 
122  //=========================================================
125  DtCigiDiGuyCtrlExt(const DtCigiDiGuyCtrlExt &BaseIn);
126 
127  //=========================================================
130  DtCigiDiGuyCtrlExt& operator=(const DtCigiDiGuyCtrlExt& BaseIn);
131 
132  //==> Buffer Packing/Unpacking
133 
134  //=========================================================
145  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const;
146 
147  //=========================================================
157  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec);
158 
159  //=========================================================
166  virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
167  { return(PacketSize + refPacket.GetVariableDataSize()); }
168 
169  //==> Accessing Member Variable Values functions
170 
171  //+> EntityID
172 
173  //=========================================================
183  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
184  {
185  myEntityID = EntityIDIn;
186  return(CIGI_SUCCESS);
187  }
188 
189  //=========================================================
195  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
196 
197  //+> PostureEn
198 
199  //=========================================================
207  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
208  {
209  myPostureEn = PostureEnIn;
210  return(CIGI_SUCCESS);
211  }
212 
213  //=========================================================
216  bool GetPostureEn(void) const { return(myPostureEn); }
217 
218  //+> Posture
219 
220  //=========================================================
232  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
233 
234  //=========================================================
242  PostureGrp GetPosture(void) const { return(myPosture); }
243 
244  //+> WeaponStateEn
245 
246  //=========================================================
254  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
255  {
256  myWeaponStateEn = WeaponStateEnIn;
257  return(CIGI_SUCCESS);
258  }
259 
260  //=========================================================
263  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
264 
265  //+> WeaponState
266 
267  //=========================================================
277  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
278 
279  //=========================================================
285  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
286 
287  //+> AnimationStateEn
288 
289  //=========================================================
297  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
298  {
299  myAnimationStateEn = AnimationStateEnIn;
300  return(CIGI_SUCCESS);
301  }
302 
303  //=========================================================
306  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
307 
308  //+> AnimationState
309 
310  //=========================================================
320  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
321 
322  //=========================================================
328  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
329 
330  //+> HealthStateEn
331 
332  //=========================================================
340  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
341  {
342  myHealthStateEn = HealthStateEnIn;
343  return(CIGI_SUCCESS);
344  }
345 
346  //=========================================================
349  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
350 
351  //+> HealthState
352 
353  //=========================================================
363  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
364 
365  //=========================================================
371  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
372 
373  //+> AnimationSpeedEn
374 
375  //=========================================================
383  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
384  {
385  myAnimationSpeedEn = AnimationSpeedEnIn;
386  return(CIGI_SUCCESS);
387  }
388 
389  //=========================================================
392  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
393 
394  //+> Animation Speed
395 
396  //=========================================================
403  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
404 
405  //=========================================================
409  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
410 
411  //+> ScaleEn
412 
413  //=========================================================
421  int SetScaleEn(const bool ScaleEnIn, bool bndchk=true)
422  {
423  myScaleEn = ScaleEnIn;
424  return(CIGI_SUCCESS);
425  }
426 
427  //=========================================================
430  bool GetScaleEn(void) const { return(myScaleEn); }
431 
432  //+> Scale
433 
434  //=========================================================
442  int SetScale(float XScaleIn, float YScaleIn, float ZScaleIn, bool bndchk=true);
443 
444  //=========================================================
450  void GetScale(float& XScaleOut, float& YScaleOut, float& ZScaleOut ) const;
451 
452  //+> WeightEn
453 
454  //=========================================================
462  int SetWeightEn(const bool WeightEnIn, bool bndchk=true)
463  {
464  myWeightEn = WeightEnIn;
465  return(CIGI_SUCCESS);
466  }
467 
468  //=========================================================
471  bool GetWeightEn(void) const { return(myWeightEn); }
472 
473  //+> Weight
474 
475  //=========================================================
481  int SetWeight(const float WeightIn, bool bndchk=true);
482 
483  //=========================================================
487  float GetWeight(void) const { return(myWeight); }
488 
489  //+> Animation
490 
493  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
494 
497  int GetAnimationSize(void) const { return(myAnimationSize); }
498 
499  //=========================================================
502  const std::string & GetAnimation(void) const { return(myAnimation); }
503 
504  //+> Head Appearance
505 
508  int SetHeadAppearance(const std::string &HeadAppearanceIn, bool bndchk=true);
509 
513  int GetHeadAppearanceSize(void) const { return(myHeadAppearanceSize); }
514 
515  //=========================================================
518  const std::string & GetHeadAppearance(void) const { return(myHeadAppearance); }
519 
520  //+> Item Appearance
521 
524  int SetItemAppearance(const std::string &ItemAppearanceIn, bool bndchk=true);
525 
529  int GetItemAppearanceSize(void) const { return(myItemAppearanceSize); }
530 
531  //=========================================================
534  const std::string & GetItemAppearance(void) const { return(myItemAppearance); }
535 
536  protected:
537  static int CalculatePaddedStringSize( int StringSizeIn );
538  static void BufferToString( PackPointer& CDta, std::string& StringOut );
539 
540 
541  protected:
542 
543  Cigi_uint16 myEntityID;
546  int myAnimationSize; // This is the string size padded to a multiple of 8
547  std::string myAnimation;
548  int myHeadAppearanceSize; // This is the string size padded to a multiple of 8
549  std::string myHeadAppearance;
550  int myItemAppearanceSize; // This is the string size padded to a multiple of 8
551  std::string myItemAppearance;
555  float myXScale;
556  float myYScale;
557  float myZScale;
558  float myWeight;
559 
565  bool myScaleEn;
567 
568  //=========================================================
573 
577  static const int MaxStringCharCnt = 71;
578  };
579 }
580 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)