CigiEntityCtrlV3_3 Class Reference

#include <CigiEntityCtrlV3_3.h>

Inheritance diagram for CigiEntityCtrlV3_3:

CigiBaseEntityCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiEntityCtrlV3_3 ()
virtual ~CigiEntityCtrlV3_3 ()
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
bool GetSmoothingEn (void) const
int SetSmoothingEn (const bool SmoothingEnabled, bool bndchk=true)

Detailed Description

The class for the Entity Control packet for CIGI version 3

Definition at line 55 of file CigiEntityCtrlV3_3.h.


Constructor & Destructor Documentation

CigiEntityCtrlV3_3::CigiEntityCtrlV3_3 (  ) 

General Constructor

Definition at line 59 of file CigiEntityCtrlV3_3.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.

00060 {
00061 
00062    PacketID = CIGI_ENTITY_CTRL_PACKET_ID_V3;
00063    PacketSize = CIGI_ENTITY_CTRL_PACKET_SIZE_V3;
00064    Version = 3;
00065    MinorVersion = 3;
00066 
00067    EntityID = 0;
00068    EntityType = 0;
00069    ParentID = 0;
00070 
00071    Alpha = 255;
00072    Opacity = 100.0f;
00073    Temperature = 0.0f;
00074 
00075    Roll = 0.0f;
00076    Pitch = 0.0f;
00077    Yaw = 0.0f;
00078    LatOrXoff = 0.0f;
00079    LonOrYoff = 0.0f;
00080    AltOrZoff = 0.0f;
00081 
00082    EntityState = Standby;
00083    AttachState = Detach;
00084    CollisionDetectEn = Disable;
00085    InheritAlpha = NoInherit;
00086    GrndClamp = NoClamp;
00087    AnimationDir = Forward;
00088    AnimationLoopMode = OneShot;
00089    AnimationState = Stop;
00090    PastAnimationState = Stop;
00091    SmoothingEn = false;
00092 
00093 }

CigiEntityCtrlV3_3::~CigiEntityCtrlV3_3 (  )  [virtual]

General Destructor

Definition at line 98 of file CigiEntityCtrlV3_3.cpp.

00099 {
00100 
00101 }


Member Function Documentation

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

Gets the Alpha value.

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

Definition at line 130 of file CigiEntityCtrlV3_3.h.

00130 { return(Alpha); }

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

Gets the altitude value

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

Definition at line 175 of file CigiEntityCtrlV3_3.h.

00175 { return(AltOrZoff); }

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

Gets the Animation Direction value

Returns:
The animation sequence direction.
0 Forward
1 Backward

Definition at line 298 of file CigiEntityCtrlV3_3.h.

00298 { return(AnimationDir); }

AnimationLoopModeGrp CigiEntityCtrlV3_3::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 321 of file CigiEntityCtrlV3_3.h.

00321 { return(AnimationLoopMode); }

CigiBaseEntityCtrl::AnimationStateGrp CigiEntityCtrlV3_3::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 412 of file CigiEntityCtrlV3_3.cpp.

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

00413 {
00414 
00415 
00416    AnimationStateGrp tAState = AnimationState;
00417    if((tAState >= 0)&&(tAState <= 9))
00418       tAState = ToV3[tAState];
00419    else
00420       tAState = NoAction;
00421 
00422    if(tAState == NoAction)
00423    {
00424       if((PastAnimationState == Stop) ||
00425          (PastAnimationState == Pause))
00426          tAState = (AnimationStateGrp)PastAnimationState;
00427       else
00428          tAState = Continue;
00429    }
00430 
00431    return(tAState);
00432 
00433 }

EntityStateGrp CigiEntityCtrlV3_3::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 225 of file CigiEntityCtrlV3_3.h.

00225 { return(EntityState); }

GrndClampGrp CigiEntityCtrlV3_3::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 250 of file CigiEntityCtrlV3_3.h.

00250 { return(GrndClamp); }

InheritAlphaGrp CigiEntityCtrlV3_3::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 275 of file CigiEntityCtrlV3_3.h.

00275 { return(InheritAlpha); }

bool CigiEntityCtrlV3_3::GetSmoothingEn ( void   )  const [inline]

Gets the Smoothing Enabled flag for V3.3

Returns:
Smoothing Enabled flag

Definition at line 357 of file CigiEntityCtrlV3_3.h.

00357 { return(SmoothingEn); }

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

Gets the Yaw value

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

Definition at line 151 of file CigiEntityCtrlV3_3.h.

00151 { return(Yaw); }

double CigiEntityCtrlV3_3::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 200 of file CigiEntityCtrlV3_3.h.

00200 { return(AltOrZoff); }

int CigiEntityCtrlV3_3::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 111 of file CigiEntityCtrlV3_3.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::SmoothingEn, CigiBaseEntityCtrl::Stop, CigiBaseEntityCtrl::ToV3, and CigiBaseEntityCtrl::Yaw.

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

int CigiEntityCtrlV3_3::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 117 of file CigiEntityCtrlV3_3.h.

References CIGI_SUCCESS.

00118    {
00119       Alpha = AlphaIn;
00120       Opacity = ((float)Alpha)/2.55f;
00121       return(CIGI_SUCCESS);
00122    }

int CigiEntityCtrlV3_3::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 165 of file CigiEntityCtrlV3_3.h.

References CIGI_SUCCESS.

00166    {
00167       AltOrZoff = Alt;
00168       return(CIGI_SUCCESS);
00169    }

int CigiEntityCtrlV3_3::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 346 of file CigiEntityCtrlV3_3.cpp.

References CigiBaseEntityCtrl::AnimationDir, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00347 {
00348 
00349 #ifndef CIGI_NO_BND_CHK
00350    if(bndchk && ((AnimationDirIn < 0)||(AnimationDirIn > 1)))
00351    {
00352 #ifndef CIGI_NO_EXCEPT
00353       throw CigiValueOutOfRangeException("AnimationDir",AnimationDirIn,0,1);
00354 #endif
00355       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00356    }
00357 #endif
00358 
00359    AnimationDir = AnimationDirIn;
00360 
00361    return(CIGI_SUCCESS);
00362 
00363 }

int CigiEntityCtrlV3_3::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 368 of file CigiEntityCtrlV3_3.cpp.

References CigiBaseEntityCtrl::AnimationLoopMode, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00369 {
00370 
00371 #ifndef CIGI_NO_BND_CHK
00372    if(bndchk && ((AnimationLoopModeIn < 0)||(AnimationLoopModeIn > 1)))
00373    {
00374 #ifndef CIGI_NO_EXCEPT
00375       throw CigiValueOutOfRangeException("AnimationLoopMode",AnimationLoopModeIn,0,1);
00376 #endif
00377       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00378    }
00379 #endif
00380 
00381    AnimationLoopMode = AnimationLoopModeIn;
00382 
00383    return(CIGI_SUCCESS);
00384 
00385 }

int CigiEntityCtrlV3_3::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 390 of file CigiEntityCtrlV3_3.cpp.

References CigiBaseEntityCtrl::AnimationState, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00391 {
00392 
00393 #ifndef CIGI_NO_BND_CHK
00394    if(bndchk && ((AnimationStateIn < 0)||(AnimationStateIn > 3)))
00395    {
00396 #ifndef CIGI_NO_EXCEPT
00397       throw CigiValueOutOfRangeException("AnimationState",AnimationStateIn,0,3);
00398 #endif
00399       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00400    }
00401 #endif
00402 
00403    AnimationState = AnimationStateIn;
00404 
00405    return(CIGI_SUCCESS);
00406 
00407 }

int CigiEntityCtrlV3_3::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 281 of file CigiEntityCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::EntityState.

00282 {
00283 
00284 #ifndef CIGI_NO_BND_CHK
00285    if(bndchk && ((EntityStateIn < 0)||(EntityStateIn > 2)))
00286    {
00287 #ifndef CIGI_NO_EXCEPT
00288       throw CigiValueOutOfRangeException("EntityState",EntityStateIn,0,2);
00289 #endif
00290       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00291    }
00292 #endif
00293 
00294    EntityState = EntityStateIn;
00295 
00296    return(CIGI_SUCCESS);
00297 
00298 }

int CigiEntityCtrlV3_3::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 303 of file CigiEntityCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::GrndClamp.

00304 {
00305 
00306 #ifndef CIGI_NO_BND_CHK
00307    if(bndchk && ((GrndClampIn < 0)||(GrndClampIn > 2)))
00308    {
00309 #ifndef CIGI_NO_EXCEPT
00310       throw CigiValueOutOfRangeException("GrndClamp",GrndClampIn,0,2);
00311 #endif
00312       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00313    }
00314 #endif
00315 
00316    GrndClamp = GrndClampIn;
00317 
00318    return(CIGI_SUCCESS);
00319 
00320 }

int CigiEntityCtrlV3_3::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 325 of file CigiEntityCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::InheritAlpha.

00326 {
00327    
00328 #ifndef CIGI_NO_BND_CHK
00329    if(bndchk && ((InheritAlphaIn < 0)||(InheritAlphaIn > 1)))
00330    {
00331 #ifndef CIGI_NO_EXCEPT
00332       throw CigiValueOutOfRangeException("InheritAlpha",(int)InheritAlphaIn,0,1);
00333 #endif
00334       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00335    }
00336 #endif
00337 
00338    InheritAlpha = InheritAlphaIn;
00339    return(CIGI_SUCCESS);
00340 
00341 }

int CigiEntityCtrlV3_3::SetSmoothingEn ( const bool  SmoothingEnabled,
bool  bndchk = true 
) [inline]

Enables or Disables motion smoothing of this entity.
Motion smoothing for an entity can only be enabled if global motion smoothing is enabled in the IG Ctrl packet and the motion smoothing for the entity is enabled.

Parameters:
SmoothingEnabled - Enables (true) or disables (false) Extrapolation or Interpolation motion smoothing
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 371 of file CigiEntityCtrlV3_3.h.

References CIGI_SUCCESS.

00372    {
00373       SmoothingEn = SmoothingEnabled;
00374 
00375       return(CIGI_SUCCESS);
00376    }

int CigiEntityCtrlV3_3::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 260 of file CigiEntityCtrlV3_3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEntityCtrl::Yaw.

00261 {
00262 
00263 #ifndef CIGI_NO_BND_CHK
00264    if(bndchk && ((YawIn < 0.0f)||(YawIn > 360.0f)))
00265    {
00266 #ifndef CIGI_NO_EXCEPT
00267       throw CigiValueOutOfRangeException("Yaw",(double)YawIn,0.0,360.0);
00268 #endif
00269       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00270    }
00271 #endif
00272 
00273    Yaw = YawIn;
00274    return(CIGI_SUCCESS);
00275 
00276 }

int CigiEntityCtrlV3_3::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 189 of file CigiEntityCtrlV3_3.h.

References CIGI_SUCCESS.

00190    {
00191       AltOrZoff = (double)Zoff;
00192       return(CIGI_SUCCESS);
00193    }

int CigiEntityCtrlV3_3::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 178 of file CigiEntityCtrlV3_3.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(), CigiBaseEntityCtrl::SmoothingEn, and CigiBaseEntityCtrl::Yaw.

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


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