CigiEntityCtrlV3 Class Reference

#include <CigiEntityCtrlV3.h>

Inheritance diagram for CigiEntityCtrlV3:

CigiBaseEntityCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiEntityCtrlV3 ()
virtual ~CigiEntityCtrlV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
int SetAlpha (const Cigi_uint8 AlphaIn, bool bndchk=true)
Cigi_uint8 GetAlpha (void) const
int SetYaw (const float YawIn, bool bndchk=true)
float GetYaw (void) const
int SetAlt (const double Alt, bool bndchk=true)
double GetAlt (void) const
int SetZoff (const double Zoff, bool bndchk=true)
double GetZoff (void) const
int SetEntityState (const EntityStateGrp EntityStateIn, bool bndchk=true)
EntityStateGrp GetEntityState (void) const
int SetGrndClamp (const GrndClampGrp GrndClampIn, bool bndchk=true)
GrndClampGrp GetGrndClamp (void) const
int SetInheritAlpha (const InheritAlphaGrp InheritAlphaIn, bool bndchk=true)
InheritAlphaGrp GetInheritAlpha (void) const
int SetAnimationDir (const AnimationDirGrp AnimationDirIn, bool bndchk=true)
AnimationDirGrp GetAnimationDir (void) const
int SetAnimationLoopMode (const AnimationLoopModeGrp AnimationLoopModeIn, bool bndchk=true)
AnimationLoopModeGrp GetAnimationLoopMode (void) const
int SetAnimationState (const AnimationStateGrp AnimationStateIn, bool bndchk=true)
AnimationStateGrp GetAnimationState (void) const

Detailed Description

The class for the Entity Control packet for CIGI version 3

Definition at line 69 of file CigiEntityCtrlV3.h.


Constructor & Destructor Documentation

CigiEntityCtrlV3::CigiEntityCtrlV3 (  ) 

General Constructor

Definition at line 73 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::Alpha, CigiBaseEntityCtrl::AltOrZoff, CigiBaseEntityCtrl::AnimationDir, CigiBaseEntityCtrl::AnimationLoopMode, CigiBaseEntityCtrl::AnimationState, CigiBaseEntityCtrl::AttachState, CIGI_ENTITY_CTRL_PACKET_ID_V3, CIGI_ENTITY_CTRL_PACKET_SIZE_V3, CigiBaseEntityCtrl::CollisionDetectEn, CigiBaseEntityCtrl::Detach, CigiBaseEntityCtrl::Disable, CigiBaseEntityCtrl::EntityID, CigiBaseEntityCtrl::EntityState, CigiBaseEntityCtrl::EntityType, CigiBaseEntityCtrl::Forward, CigiBaseEntityCtrl::GrndClamp, CigiBaseEntityCtrl::InheritAlpha, CigiBaseEntityCtrl::LatOrXoff, CigiBaseEntityCtrl::LonOrYoff, CigiBasePacket::MinorVersion, CigiBaseEntityCtrl::NoClamp, CigiBaseEntityCtrl::NoInherit, CigiBaseEntityCtrl::OneShot, CigiBaseEntityCtrl::Opacity, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseEntityCtrl::ParentID, CigiBaseEntityCtrl::PastAnimationState, CigiBaseEntityCtrl::Pitch, CigiBaseEntityCtrl::Roll, CigiBaseEntityCtrl::SmoothingEn, CigiBaseEntityCtrl::Standby, CigiBaseEntityCtrl::Stop, CigiBaseEntityCtrl::Temperature, CigiBasePacket::Version, and CigiBaseEntityCtrl::Yaw.

00074 {
00075 
00076    PacketID = CIGI_ENTITY_CTRL_PACKET_ID_V3;
00077    PacketSize = CIGI_ENTITY_CTRL_PACKET_SIZE_V3;
00078    Version = 3;
00079    MinorVersion = 0;
00080 
00081    EntityID = 0;
00082    EntityType = 0;
00083    ParentID = 0;
00084 
00085    Alpha = 255;
00086    Opacity = 100.0f;
00087    Temperature = 0.0f;
00088 
00089    Roll = 0.0f;
00090    Pitch = 0.0f;
00091    Yaw = 0.0f;
00092    LatOrXoff = 0.0f;
00093    LonOrYoff = 0.0f;
00094    AltOrZoff = 0.0f;
00095 
00096    EntityState = Standby;
00097    AttachState = Detach;
00098    CollisionDetectEn = Disable;
00099    InheritAlpha = NoInherit;
00100    GrndClamp = NoClamp;
00101    AnimationDir = Forward;
00102    AnimationLoopMode = OneShot;
00103    AnimationState = Stop;
00104    PastAnimationState = Stop;
00105    SmoothingEn = false;
00106 
00107 }

CigiEntityCtrlV3::~CigiEntityCtrlV3 (  )  [virtual]

General Destructor

Definition at line 112 of file CigiEntityCtrlV3.cpp.

00113 {
00114 
00115 }


Member Function Documentation

Cigi_uint8 CigiEntityCtrlV3::GetAlpha ( void   )  const [inline]

Gets the Alpha value.

Returns:
The alpha of the entity
0 - transparent.
255 - fully visible

Definition at line 144 of file CigiEntityCtrlV3.h.

00144 { return(Alpha); }

double CigiEntityCtrlV3::GetAlt ( void   )  const [inline]

Gets the altitude value

Returns:
The altitude above MSL of the entity in meters.

Definition at line 189 of file CigiEntityCtrlV3.h.

00189 { return(AltOrZoff); }

AnimationDirGrp CigiEntityCtrlV3::GetAnimationDir ( void   )  const [inline]

Gets the Animation Direction value

Returns:
The animation sequence direction.
0 Forward
1 Backward

Definition at line 312 of file CigiEntityCtrlV3.h.

00312 { return(AnimationDir); }

AnimationLoopModeGrp CigiEntityCtrlV3::GetAnimationLoopMode ( void   )  const [inline]

Gets the Animation Loop Mode value

Returns:
The mode in which to run the animation.
0 One-Shot
1 Continuous

Definition at line 335 of file CigiEntityCtrlV3.h.

00335 { return(AnimationLoopMode); }

CigiBaseEntityCtrl::AnimationStateGrp CigiEntityCtrlV3::GetAnimationState ( void   )  const

Gets the Animation State value

Returns:
The play state of the animation.
0 Stop
1 Pause
2 Play
3 Continue

Definition at line 424 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::AnimationState, CigiBaseEntityCtrl::Continue, CigiBaseEntityCtrl::NoAction, CigiBaseEntityCtrl::PastAnimationState, CigiBaseEntityCtrl::Pause, CigiBaseEntityCtrl::Stop, and CigiBaseEntityCtrl::ToV3.

00425 {
00426 
00427 
00428    AnimationStateGrp tAState = AnimationState;
00429    if((tAState >= 0)&&(tAState <= 9))
00430       tAState = ToV3[tAState];
00431    else
00432       tAState = NoAction;
00433 
00434    if(tAState == NoAction)
00435    {
00436       if((PastAnimationState == Stop) ||
00437          (PastAnimationState == Pause))
00438          tAState = (AnimationStateGrp)PastAnimationState;
00439       else
00440          tAState = Continue;
00441    }
00442 
00443    return(tAState);
00444 
00445 }

EntityStateGrp CigiEntityCtrlV3::GetEntityState ( void   )  const [inline]

Gets the Entity State value

Returns:
The current state of this entity.
0 Inactive/Standby
1 Active
2 Destroy

Definition at line 239 of file CigiEntityCtrlV3.h.

00239 { return(EntityState); }

GrndClampGrp CigiEntityCtrlV3::GetGrndClamp ( void   )  const [inline]

Gets the Ground/Ocean Clamp value

Returns:
The Ground/Ocean Clamp enable.
0 Clamp
1 Altitude clamp
2 Altitude and Orientation clamp

Definition at line 264 of file CigiEntityCtrlV3.h.

00264 { return(GrndClamp); }

InheritAlphaGrp CigiEntityCtrlV3::GetInheritAlpha ( void   )  const [inline]

Gets the Inherit Alpha value

Returns:
The flag for this entity inheriting alpha from the parent entity.
0 No Inheritance
1 Inherit

Definition at line 289 of file CigiEntityCtrlV3.h.

00289 { return(InheritAlpha); }

float CigiEntityCtrlV3::GetYaw ( void   )  const [inline]

Gets the Yaw value

Returns:
The Yaw of the entity in degrees.
(0 to 360.0)

Definition at line 165 of file CigiEntityCtrlV3.h.

00165 { return(Yaw); }

double CigiEntityCtrlV3::GetZoff ( void   )  const [inline]

Gets the Z Offset value

Returns:
The Z offset from the origin of the parent entity in meters.

Definition at line 214 of file CigiEntityCtrlV3.h.

00214 { return(AltOrZoff); }

int CigiEntityCtrlV3::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 1

Parameters:
Base - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket)
Buff - A pointer to the current pack point.
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseEntityCtrl.

Definition at line 125 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::Alpha, CigiBaseEntityCtrl::AltOrZoff, CigiBaseEntityCtrl::AnimationDir, CigiBaseEntityCtrl::AnimationLoopMode, CigiBaseEntityCtrl::AnimationState, CigiBaseEntityCtrl::AttachState, PackPointerUnion::c, CigiBaseEntityCtrl::CollisionDetectEn, CigiBaseEntityCtrl::Continue, PackPointerUnion::d, CigiBaseEntityCtrl::EntityID, CigiBaseEntityCtrl::EntityState, CigiBaseEntityCtrl::EntityType, PackPointerUnion::f, CigiAnimationTable::GetPastAnimation(), CigiBaseEntityCtrl::GrndClamp, CigiBaseEntityCtrl::InheritAlpha, CigiBaseEntityCtrl::LatOrXoff, CigiBaseEntityCtrl::LonOrYoff, CigiBaseEntityCtrl::NoAction, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseEntityCtrl::ParentID, CigiBaseEntityCtrl::Pause, CigiBaseEntityCtrl::Pitch, CigiBaseEntityCtrl::Roll, PackPointerUnion::s, CigiAnimationTable::SetPastAnimation(), CigiBaseEntityCtrl::Stop, CigiBaseEntityCtrl::ToV3, and CigiBaseEntityCtrl::Yaw.

00126 {
00127    PackPointer CDta;
00128 
00129    CigiAnimationTable *ATbl = (CigiAnimationTable *) Spec;
00130 
00131    CigiBaseEntityCtrl *Data = ( CigiBaseEntityCtrl *) Base;
00132 
00133 
00134    CDta.c = Buff;
00135 
00136    *CDta.c++ = PacketID;
00137    *CDta.c++ = PacketSize;
00138    *CDta.s++ = Data->EntityID;
00139    
00140    Cigi_uint8 HDta = (Cigi_uint8)((Data->EntityState & 0x03) |
00141                                         ((Data->AttachState << 2) & 0x04) |
00142                                         ((Data->CollisionDetectEn << 3) & 0x08) |
00143                                         ((Data->InheritAlpha << 4) & 0x10) |
00144                                         ((Data->GrndClamp << 5) & 0x60));
00145 
00146    *CDta.c++ = HDta;
00147 
00148    AnimationStateGrp tAState = Data->AnimationState;
00149    if((tAState >= 0)&&(tAState <= 9))
00150       tAState = ToV3[tAState];
00151    else
00152       tAState = NoAction;
00153 
00154    if(tAState == NoAction)
00155    {
00156       unsigned int PastAState = ATbl->GetPastAnimation(Data->EntityID);
00157       if((PastAState == Stop) ||
00158          (PastAState == Pause))
00159          tAState = (AnimationStateGrp)PastAState;
00160       else
00161          tAState = Continue;
00162    }
00163 
00164    ATbl->SetPastAnimation(Data->EntityID,tAState);
00165 
00166    HDta = (Cigi_uint8)((Data->AnimationDir & 0x01) |
00167                           ((Data->AnimationLoopMode << 1) & 0x02) |
00168                           ((tAState << 2) & 0x0C));
00169 
00170    *CDta.c++ = HDta;
00171 
00172    *CDta.c++ = Data->Alpha;
00173    *CDta.c++ = 0;
00174    *CDta.s++ = Data->EntityType;
00175    *CDta.s++ = Data->ParentID;
00176    *CDta.f++ = Data->Roll;
00177    *CDta.f++ = Data->Pitch;
00178    *CDta.f++ = Data->Yaw;
00179    *CDta.d++ = Data->LatOrXoff;
00180    *CDta.d++ = Data->LonOrYoff;
00181    *CDta.d++ = Data->AltOrZoff;
00182 
00183    return(PacketSize);
00184 
00185 }

int CigiEntityCtrlV3::SetAlpha ( const Cigi_uint8  AlphaIn,
bool  bndchk = true 
) [inline]

Sets the Alpha with bound checking control

Parameters:
AlphaIn - The alpha of the entity
0 - transparent.
255 - fully visible
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 131 of file CigiEntityCtrlV3.h.

References CIGI_SUCCESS.

00132    {
00133       Alpha = AlphaIn;
00134       Opacity = ((float)Alpha)/2.55f;
00135       return(CIGI_SUCCESS);
00136    }

int CigiEntityCtrlV3::SetAlt ( const double  Alt,
bool  bndchk = true 
) [inline]

Sets the altitude with bound checking control

Parameters:
Alt - The altitude above MSL of the entity in meters.
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 179 of file CigiEntityCtrlV3.h.

References CIGI_SUCCESS.

00180    {
00181       AltOrZoff = Alt;
00182       return(CIGI_SUCCESS);
00183    }

int CigiEntityCtrlV3::SetAnimationDir ( const AnimationDirGrp  AnimationDirIn,
bool  bndchk = true 
)

Sets the Animation Direction with bound checking control

Parameters:
AnimationDirIn - Specifies the animation sequence direction.
0 Forward
1 Backward
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 358 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::AnimationDir, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00359 {
00360 
00361 #ifndef CIGI_NO_BND_CHK
00362    if(bndchk && ((AnimationDirIn < 0)||(AnimationDirIn > 1)))
00363    {
00364 #ifndef CIGI_NO_EXCEPT
00365       throw CigiValueOutOfRangeException("AnimationDir",AnimationDirIn,0,1);
00366 #endif
00367       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00368    }
00369 #endif
00370 
00371    AnimationDir = AnimationDirIn;
00372 
00373    return(CIGI_SUCCESS);
00374 
00375 }

int CigiEntityCtrlV3::SetAnimationLoopMode ( const AnimationLoopModeGrp  AnimationLoopModeIn,
bool  bndchk = true 
)

Sets the Animation Loop Mode with bound checking control

Parameters:
AnimationLoopModeIn - The mode in which to run the animation.
0 One-Shot
1 Continuous
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 380 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::AnimationLoopMode, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00381 {
00382 
00383 #ifndef CIGI_NO_BND_CHK
00384    if(bndchk && ((AnimationLoopModeIn < 0)||(AnimationLoopModeIn > 1)))
00385    {
00386 #ifndef CIGI_NO_EXCEPT
00387       throw CigiValueOutOfRangeException("AnimationLoopMode",AnimationLoopModeIn,0,1);
00388 #endif
00389       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00390    }
00391 #endif
00392 
00393    AnimationLoopMode = AnimationLoopModeIn;
00394 
00395    return(CIGI_SUCCESS);
00396 
00397 }

int CigiEntityCtrlV3::SetAnimationState ( const AnimationStateGrp  AnimationStateIn,
bool  bndchk = true 
)

Sets the Animation State with bound checking control

Parameters:
AnimationStateIn - The play state of the animation.
0 Stop
1 Pause
2 Play
3 Continue
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 402 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::AnimationState, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00403 {
00404 
00405 #ifndef CIGI_NO_BND_CHK
00406    if(bndchk && ((AnimationStateIn < 0)||(AnimationStateIn > 3)))
00407    {
00408 #ifndef CIGI_NO_EXCEPT
00409       throw CigiValueOutOfRangeException("AnimationState",AnimationStateIn,0,3);
00410 #endif
00411       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00412    }
00413 #endif
00414 
00415    AnimationState = AnimationStateIn;
00416 
00417    return(CIGI_SUCCESS);
00418 
00419 }

int CigiEntityCtrlV3::SetEntityState ( const EntityStateGrp  EntityStateIn,
bool  bndchk = true 
)

Sets the Entity State with bound checking control

Parameters:
EntityStateIn - The current state of this entity.
0 Inactive/Standby
1 Active
2 Destroy
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 293 of file CigiEntityCtrlV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::EntityState.

00294 {
00295 
00296 #ifndef CIGI_NO_BND_CHK
00297    if(bndchk && ((EntityStateIn < 0)||(EntityStateIn > 2)))
00298    {
00299 #ifndef CIGI_NO_EXCEPT
00300       throw CigiValueOutOfRangeException("EntityState",EntityStateIn,0,2);
00301 #endif
00302       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00303    }
00304 #endif
00305 
00306    EntityState = EntityStateIn;
00307 
00308    return(CIGI_SUCCESS);
00309 
00310 }

int CigiEntityCtrlV3::SetGrndClamp ( const GrndClampGrp  GrndClampIn,
bool  bndchk = true 
)

Sets the Ground/Ocean Clamp with bound checking control

Parameters:
GrndClampIn - Ground/Ocean Clamp enable.
0 Clamp
1 Altitude clamp
2 Altitude and Orientation clamp
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 315 of file CigiEntityCtrlV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::GrndClamp.

00316 {
00317 
00318 #ifndef CIGI_NO_BND_CHK
00319    if(bndchk && ((GrndClampIn < 0)||(GrndClampIn > 2)))
00320    {
00321 #ifndef CIGI_NO_EXCEPT
00322       throw CigiValueOutOfRangeException("GrndClamp",GrndClampIn,0,2);
00323 #endif
00324       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00325    }
00326 #endif
00327 
00328    GrndClamp = GrndClampIn;
00329 
00330    return(CIGI_SUCCESS);
00331 
00332 }

int CigiEntityCtrlV3::SetInheritAlpha ( const InheritAlphaGrp  InheritAlphaIn,
bool  bndchk = true 
)

Sets the Inherit Alpha with bound checking control

Parameters:
InheritAlphaIn - Flag for this entity inheriting alpha from the parent entity.
0 No Inheritance
1 Inherit
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 337 of file CigiEntityCtrlV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::InheritAlpha.

00338 {
00339    
00340 #ifndef CIGI_NO_BND_CHK
00341    if(bndchk && ((InheritAlphaIn < 0)||(InheritAlphaIn > 1)))
00342    {
00343 #ifndef CIGI_NO_EXCEPT
00344       throw CigiValueOutOfRangeException("InheritAlpha",(int)InheritAlphaIn,0,1);
00345 #endif
00346       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00347    }
00348 #endif
00349 
00350    InheritAlpha = InheritAlphaIn;
00351    return(CIGI_SUCCESS);
00352 
00353 }

int CigiEntityCtrlV3::SetYaw ( const float  YawIn,
bool  bndchk = true 
)

Sets the Yaw with bound checking control

Parameters:
YawIn - The Yaw of the entity in degrees.
(0 - 360.0)
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 272 of file CigiEntityCtrlV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::Yaw.

00273 {
00274 
00275 #ifndef CIGI_NO_BND_CHK
00276    if(bndchk && ((YawIn < 0.0f)||(YawIn > 360.0f)))
00277    {
00278 #ifndef CIGI_NO_EXCEPT
00279       throw CigiValueOutOfRangeException("Yaw",(double)YawIn,0.0,360.0);
00280 #endif
00281       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00282    }
00283 #endif
00284 
00285    Yaw = YawIn;
00286    return(CIGI_SUCCESS);
00287 
00288 }

int CigiEntityCtrlV3::SetZoff ( const double  Zoff,
bool  bndchk = true 
) [inline]

Sets the Z Offset with bound checking control

Parameters:
Zoff - The Z offset from the origin of the parent entity in meters.
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 203 of file CigiEntityCtrlV3.h.

References CIGI_SUCCESS.

00204    {
00205       AltOrZoff = (double)Zoff;
00206       return(CIGI_SUCCESS);
00207    }

int CigiEntityCtrlV3::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 1

Parameters:
Buff - A pointer to the current pack point.
Swap - Byte swapping required.
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseEntityCtrl.

Definition at line 191 of file CigiEntityCtrlV3.cpp.

References CigiBaseEntityCtrl::Alpha, CigiBaseEntityCtrl::AltOrZoff, CigiBaseEntityCtrl::AnimationDir, CigiBaseEntityCtrl::AnimationLoopMode, CigiBaseEntityCtrl::AnimationState, CigiBaseEntityCtrl::AttachState, PackPointerUnion::c, CIGI_SUCCESS, CigiSwap2(), CigiSwap4(), CigiSwap8(), CigiBaseEntityCtrl::CollisionDetectEn, PackPointerUnion::d, CigiBaseEntityCtrl::EntityID, CigiBaseEntityCtrl::EntityState, CigiBaseEntityCtrl::EntityType, PackPointerUnion::f, CigiAnimationTable::GetPastAnimation(), CigiBaseEntityCtrl::GrndClamp, CigiBaseEntityCtrl::InheritAlpha, CigiBaseEntityCtrl::LatOrXoff, CigiBaseEntityCtrl::LonOrYoff, CigiBaseEntityCtrl::Opacity, CigiBaseEntityCtrl::ParentID, CigiBaseEntityCtrl::PastAnimationState, CigiBaseEntityCtrl::Pitch, CigiBaseEntityCtrl::Roll, PackPointerUnion::s, CigiAnimationTable::SetPastAnimation(), and CigiBaseEntityCtrl::Yaw.

00192 {
00193 
00194    PackPointer CDta;
00195 
00196    CigiAnimationTable *ATbl = (CigiAnimationTable *) Spec;
00197 
00198    Cigi_uint8 HDta1, HDta2;
00199 
00200    CDta.c = Buff;
00201 
00202    CDta.c += 2;
00203 
00204    if(!Swap)
00205    {
00206       EntityID = *CDta.s++;
00207 
00208       HDta1 = *CDta.c++;
00209       HDta2 = *CDta.c++;
00210 
00211       Alpha = *CDta.c++;
00212       Opacity = ((float)Alpha)/2.55f;
00213       CDta.c++;
00214       EntityType = *CDta.s++;
00215       ParentID = *CDta.s++;
00216       Roll = *CDta.f++;
00217       Pitch = *CDta.f++;
00218       Yaw = *CDta.f++;
00219       LatOrXoff = *CDta.d++;
00220       LonOrYoff = *CDta.d++;
00221       AltOrZoff = *CDta.d++;
00222    }
00223    else
00224    {
00225       CigiSwap2(&EntityID, CDta.s++);
00226 
00227       HDta1 = *CDta.c++;
00228       HDta2 = *CDta.c++;
00229 
00230       Alpha = *CDta.c++;
00231       Opacity = ((float)Alpha)/2.55f;
00232       CDta.c++;
00233       CigiSwap2(&EntityType, CDta.s++);
00234       CigiSwap2(&ParentID, CDta.s++);
00235       CigiSwap4(&Roll, CDta.f++);
00236       CigiSwap4(&Pitch, CDta.f++);
00237       CigiSwap4(&Yaw, CDta.f++);
00238       CigiSwap8(&LatOrXoff, CDta.d++);
00239       CigiSwap8(&LonOrYoff, CDta.d++);
00240       CigiSwap8(&AltOrZoff, CDta.d++);
00241    }
00242 
00243 
00244    EntityState = (EntityStateGrp)(HDta1 & 0x03);
00245    AttachState = (AttachStateGrp)((HDta1 >> 2) & 0x01);
00246    CollisionDetectEn = (CollisionDetectGrp)((HDta1 >> 3) & 0x01);
00247    InheritAlpha = (InheritAlphaGrp)((HDta1 >> 4) & 0x01);
00248    GrndClamp = (GrndClampGrp)((HDta1 >> 5) & 0x03);
00249 
00250    AnimationDir = (AnimationDirGrp)(HDta2 & 0x01);
00251    AnimationLoopMode = (AnimationLoopModeGrp)((HDta2 >> 1) & 0x01);
00252    AnimationState = (AnimationStateGrp)((HDta2 >> 2) & 0x03);
00253 
00254    PastAnimationState = (AnimationStateGrp)ATbl->GetPastAnimation(EntityID);
00255 
00256    ATbl->SetPastAnimation(EntityID,AnimationState);
00257 
00258    return(CIGI_SUCCESS);
00259 
00260 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:07 2009 for CCL by  doxygen 1.4.7