VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCigiDiGuyCtrl.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2014 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 Posture Enable
40 // *8 Animation Speed Enable
41 // *9 Health State 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  //=========================================================
56  {
57  public:
58  //=========================================================
62  {
63  Unpaused=0,
64  Paused=1
65  };
66 
67  //=========================================================
71  {
72  Stowed=0,
73  Deployed=1
74  };
75 
76  //=========================================================
80  {
81  Standing=0,
82  Sitting=1,
83  Crouched=2,
84  Prone=3
85  };
86 
87  //=========================================================
91  {
92  Alive=0,
93  Dead=1
94  };
95 
96  //==> Management
97 
98  //=========================================================
101  DtCigiDiGuyCtrl(void);
102 
103  //=========================================================
106  virtual ~DtCigiDiGuyCtrl(void);
107 
108  //=========================================================
111  DtCigiDiGuyCtrl(const DtCigiDiGuyCtrl &BaseIn);
112 
113  //=========================================================
116  DtCigiDiGuyCtrl& operator=(const DtCigiDiGuyCtrl& BaseIn);
117 
118  //==> Buffer Packing/Unpacking
119 
120  //=========================================================
131  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const;
132 
133  //=========================================================
143  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec);
144 
145  //=========================================================
152  virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
153  { return(PacketSize + refPacket.GetVariableDataSize()); }
154 
155  //==> Accessing Member Variable Values functions
156 
157  //+> EntityID
158 
159  //=========================================================
169  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
170  {
171  myEntityID = EntityIDIn;
172  return(CIGI_SUCCESS);
173  }
174 
175  //=========================================================
181  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
182 
183  //+> PostureEn
184 
185  //=========================================================
193  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
194  {
195  myPostureEn = PostureEnIn;
196  return(CIGI_SUCCESS);
197  }
198 
199  //=========================================================
202  bool GetPostureEn(void) const { return(myPostureEn); }
203 
204  //+> Posture
205 
206  //=========================================================
218  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
219 
220  //=========================================================
228  PostureGrp GetPosture(void) const { return(myPosture); }
229 
230  //+> WeaponStateEn
231 
232  //=========================================================
240  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
241  {
242  myWeaponStateEn = WeaponStateEnIn;
243  return(CIGI_SUCCESS);
244  }
245 
246  //=========================================================
249  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
250 
251  //+> WeaponState
252 
253  //=========================================================
263  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
264 
265  //=========================================================
271  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
272 
273  //+> AnimationStateEn
274 
275  //=========================================================
283  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
284  {
285  myAnimationStateEn = AnimationStateEnIn;
286  return(CIGI_SUCCESS);
287  }
288 
289  //=========================================================
292  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
293 
294  //+> AnimationState
295 
296  //=========================================================
306  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
307 
308  //=========================================================
314  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
315 
316  //+> HealthStateEn
317 
318  //=========================================================
326  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
327  {
328  myHealthStateEn = HealthStateEnIn;
329  return(CIGI_SUCCESS);
330  }
331 
332  //=========================================================
335  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
336 
337  //+> HealthState
338 
339  //=========================================================
349  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
350 
351  //=========================================================
357  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
358 
359  //+> AnimationSpeedEn
360 
361  //=========================================================
369  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
370  {
371  myAnimationSpeedEn = AnimationSpeedEnIn;
372  return(CIGI_SUCCESS);
373  }
374 
375  //=========================================================
378  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
379 
380  //+> Animation Speed
381 
382  //=========================================================
389  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
390 
391  //=========================================================
395  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
396 
397  //+> Animation
398 
401  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
402 
405  int GetAnimationSize(void) const { return(VariableDataSize); }
406 
407  //=========================================================
410  const std::string & GetAnimation(void) const { return(myAnimation); }
411 
412  protected:
413 
414  Cigi_uint16 myEntityID;
417  std::string myAnimation;
421 
427 
428  //=========================================================
433  static const int MaxCharCnt = 224;
434  };
435 }
436 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)