00001
00058 #if !defined(_CIGI_BASE_ENTITY_CTRL_INCLUDED_)
00059 #define _CIGI_BASE_ENTITY_CTRL_INCLUDED_
00060
00061 #include "CigiBasePacket.h"
00062
00063 #include "CigiAnimationTable.h"
00064
00065
00066
00067
00068
00069 #define CIGI_ENTITY_CTRL_PACKET_ID_V1 2
00070 #define CIGI_ENTITY_CTRL_PACKET_SIZE_V1 48
00071
00072 #define CIGI_ENTITY_CTRL_PACKET_ID_V2 2
00073 #define CIGI_ENTITY_CTRL_PACKET_SIZE_V2 56
00074
00075 #define CIGI_ENTITY_CTRL_PACKET_ID_V3 2
00076 #define CIGI_ENTITY_CTRL_PACKET_SIZE_V3 48
00077
00078 #define CIGI_ENTITY_CTRL_PACKET_ID_V3_3 2
00079 #define CIGI_ENTITY_CTRL_PACKET_SIZE_V3_3 48
00080
00081
00082 class CigiEntityCtrlV1;
00083 class CigiEntityCtrlV2;
00084 class CigiEntityCtrlV3;
00085 class CigiEntityCtrlV3_3;
00086
00087
00088
00091 class CIGI_SPEC CigiBaseEntityCtrl : public CigiBasePacket
00092 {
00093
00094 friend class CigiEntityCtrlV1;
00095 friend class CigiEntityCtrlV2;
00096 friend class CigiEntityCtrlV3;
00097 friend class CigiEntityCtrlV3_3;
00098
00099 public:
00100
00101
00104 enum EntityStateGrp
00105 {
00106 Standby=0,
00107 Active=1,
00108 Remove=2
00109 };
00110
00111
00114 enum AttachStateGrp
00115 {
00116 Detach=0,
00117 Attach=1
00118 };
00119
00120
00123 enum CollisionDetectGrp
00124 {
00125 Disable=0,
00126 Enable=1
00127 };
00128
00129
00132 enum InheritAlphaGrp
00133 {
00134 NoInherit=0,
00135 Inherit=1
00136 };
00137
00138
00141 enum GrndClampGrp
00142 {
00143 NoClamp=0,
00144 AltClamp=1,
00145 AltAttClamp=2
00146 };
00147
00148
00151 enum AnimationDirGrp
00152 {
00153 Forward=0,
00154 Backward=1
00155 };
00156
00157
00160 enum AnimationLoopModeGrp
00161 {
00162 OneShot=0,
00163 Continuous=1
00164 };
00165
00166
00170 enum AnimationStateGrp
00171 {
00172 Stop=0,
00173 Pause=1,
00174 Play=2,
00175 Continue=3,
00176 NoAction=4,
00177 Load=5,
00178 LoadActivate=6,
00179 Activate=7,
00180 Deactivate=8,
00181 DeactivateUnload=9
00182 };
00183
00184
00185
00186
00187
00188
00191 CigiBaseEntityCtrl();
00192
00193
00196 virtual ~CigiBaseEntityCtrl();
00197
00198
00199
00200
00201
00202
00213 virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const=0;
00214
00215
00225 virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec) =0;
00226
00227
00239 virtual int GetCnvt(CigiVersionID &CnvtVersion,
00240 CigiCnvtInfoType::Type &CnvtInfo);
00241
00242
00243
00244
00245
00246
00247
00248
00249
00259 int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
00260 {
00261 EntityID = EntityIDIn;
00262 return(CIGI_SUCCESS);
00263 }
00264
00265
00271 Cigi_uint16 GetEntityID(void) const { return(EntityID); }
00272
00273
00274
00275
00276
00285 int SetEntityType(const Cigi_uint16 EntityTypeIn, bool bndchk=true)
00286 {
00287 EntityType = EntityTypeIn;
00288 return(CIGI_SUCCESS);
00289 }
00290
00291
00296 Cigi_uint16 GetEntityType(void) const { return(EntityType); }
00297
00298
00299
00300
00301
00312 int SetAttachState(const AttachStateGrp AttachStateIn, bool bndchk=true);
00313
00314
00321 AttachStateGrp GetAttachState(void) const { return(AttachState); }
00322
00323
00324
00325
00326
00338 int SetCollisionDetectEn(const CollisionDetectGrp CollisionDetectEnIn,
00339 bool bndchk=true);
00340
00341
00347 CollisionDetectGrp GetCollisionDetectEn(void) const { return(CollisionDetectEn); }
00348
00349
00350
00351
00352
00361 int SetParentID(const Cigi_uint16 ParentIDIn, bool bndchk=true)
00362 {
00363 ParentID = ParentIDIn;
00364 return(CIGI_SUCCESS);
00365 }
00366
00367
00372 Cigi_uint16 GetParentID(void) const { return(ParentID); }
00373
00374
00375
00376
00377
00386 int SetPitch(const float PitchIn, bool bndchk=true);
00387
00388
00393 float GetPitch(void) const { return(Pitch); }
00394
00395
00396
00397
00398
00407 int SetRoll(const float RollIn, bool bndchk=true);
00408
00409
00414 float GetRoll(void) const { return(Roll); }
00415
00416
00417
00418
00419
00428 int SetLat(const double Lat, bool bndchk=true);
00429
00430
00435 double GetLat(void) const { return(LatOrXoff); }
00436
00437
00438
00439
00440
00449 int SetXoff(const double Xoff,bool bndchk=true)
00450 {
00451 LatOrXoff = Xoff;
00452 return(CIGI_SUCCESS);
00453 }
00454
00455
00460 double GetXoff(void) const { return(LatOrXoff); }
00461
00462
00463
00464
00465
00474 int SetLon(const double Lon, bool bndchk=true);
00475
00476
00481 double GetLon(void) const { return(LonOrYoff); }
00482
00483
00484
00485
00486
00495 int SetYoff(const double Yoff, bool bndchk=true)
00496 {
00497 LonOrYoff = Yoff;
00498 return(CIGI_SUCCESS);
00499 }
00500
00501
00506 double GetYoff(void) const { return(LonOrYoff); }
00507
00508
00509
00510
00511 protected:
00512
00513
00514
00515
00521 Cigi_uint16 EntityID;
00522
00523
00528 Cigi_uint16 EntityType;
00529
00530
00535 Cigi_uint16 ParentID;
00536
00537
00541 Cigi_uint8 Alpha;
00542
00543
00547 float Opacity;
00548
00549
00554 float Temperature;
00555
00556
00561 float Roll;
00562
00563
00568 float Pitch;
00569
00570
00574 float Yaw;
00575
00576
00582 double LatOrXoff;
00583
00584
00590 double LonOrYoff;
00591
00592
00597 double AltOrZoff;
00598
00599
00600
00601
00602 static const AnimationStateGrp ToV1[10];
00603 static const AnimationStateGrp ToV3[10];
00604
00605
00606
00607
00608
00614 EntityStateGrp EntityState;
00615
00616
00621 AttachStateGrp AttachState;
00622
00623
00628 CollisionDetectGrp CollisionDetectEn;
00629
00630
00635 InheritAlphaGrp InheritAlpha;
00636
00637
00643 GrndClampGrp GrndClamp;
00644
00645
00650 AnimationDirGrp AnimationDir;
00651
00652
00657 AnimationLoopModeGrp AnimationLoopMode;
00658
00659
00672 AnimationStateGrp AnimationState;
00673
00674
00688 AnimationStateGrp PastAnimationState;
00689
00690
00697 bool SmoothingEn;
00698
00699 };
00700
00701 #endif //#if !defined(_CIGI_BASE_ENTITY_CTRL_INCLUDED_)