#include <CigiCollDetSegRespV3.h>
Inheritance diagram for CigiCollDetSegRespV3:
Public Member Functions | |
CigiCollDetSegRespV3 () | |
virtual | ~CigiCollDetSegRespV3 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
int | SetSegID (const Cigi_uint8 SegIDIn, bool bndchk=true) |
Cigi_uint8 | GetSegID (void) const |
int | SetCollType (const CollTypeGrp CollTypeIn, bool bndchk=true) |
CollTypeGrp | GetCollType (void) const |
int | SetCollEntityID (const Cigi_uint16 CollEntityIDIn, bool bndchk=true) |
Cigi_uint16 | GetCollEntityID (void) const |
int | SetIntersectDist (const float IntersectDistIn, bool bndchk=true) |
float | GetIntersectDist (void) const |
Definition at line 61 of file CigiCollDetSegRespV3.h.
CigiCollDetSegRespV3::CigiCollDetSegRespV3 | ( | ) |
General Constructor
Definition at line 67 of file CigiCollDetSegRespV3.cpp.
References CIGI_COLL_DET_SEG_RESP_PACKET_ID_V3, CIGI_COLL_DET_SEG_RESP_PACKET_SIZE_V3, CigiBaseCollDetSegResp::CollEntityID, CigiBaseCollDetSegResp::CollType, CigiBaseCollDetSegResp::EntityID, CigiBaseCollDetSegResp::IntersectDist, CigiBaseCollDetSegResp::IsValidV1or2, CigiBaseCollDetSegResp::Material, CigiBasePacket::MinorVersion, CigiBaseCollDetSegResp::NonEntity, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseCollDetSegResp::SegID, CigiBasePacket::Version, CigiBaseCollDetSegResp::X, CigiBaseCollDetSegResp::Y, and CigiBaseCollDetSegResp::Z.
00068 { 00069 00070 PacketID = CIGI_COLL_DET_SEG_RESP_PACKET_ID_V3; 00071 PacketSize = CIGI_COLL_DET_SEG_RESP_PACKET_SIZE_V3; 00072 Version = 3; 00073 MinorVersion = 0; 00074 00075 EntityID = 0; 00076 SegID = 0; 00077 CollType = NonEntity; 00078 CollEntityID = 0; 00079 Material = 0; 00080 IntersectDist = 0.0; 00081 X = 0.0; 00082 Y = 0.0; 00083 Z = 0.0; 00084 IsValidV1or2 = false; 00085 00086 }
CigiCollDetSegRespV3::~CigiCollDetSegRespV3 | ( | ) | [virtual] |
Cigi_uint16 CigiCollDetSegRespV3::GetCollEntityID | ( | void | ) | const [inline] |
Gets the CollEntityID value.
Definition at line 168 of file CigiCollDetSegRespV3.h.
00168 { return(CollEntityID); }
CollTypeGrp CigiCollDetSegRespV3::GetCollType | ( | void | ) | const [inline] |
Gets the CollType value.
Definition at line 147 of file CigiCollDetSegRespV3.h.
00147 { return(CollType); }
float CigiCollDetSegRespV3::GetIntersectDist | ( | void | ) | const [inline] |
Gets the IntersectDist value.
Definition at line 190 of file CigiCollDetSegRespV3.h.
00190 { return(IntersectDist); }
Cigi_uint8 CigiCollDetSegRespV3::GetSegID | ( | void | ) | const [inline] |
Gets the SegID value.
Definition at line 128 of file CigiCollDetSegRespV3.h.
00128 { return(SegID); }
int CigiCollDetSegRespV3::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
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. |
Implements CigiBaseCollDetSegResp.
Definition at line 103 of file CigiCollDetSegRespV3.cpp.
References PackPointerUnion::c, CigiBaseCollDetSegResp::CollEntityID, CigiBaseCollDetSegResp::CollType, CigiBaseCollDetSegResp::EntityID, PackPointerUnion::f, CigiBaseCollDetSegResp::IntersectDist, CigiBaseCollDetSegResp::IsValidV1or2, PackPointerUnion::l, CigiBaseCollDetSegResp::Material, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCollDetSegResp::SegID.
00104 { 00105 PackPointer CDta; 00106 00107 CigiBaseCollDetSegResp * Data = ( CigiBaseCollDetSegResp *)Base; 00108 00109 CDta.c = Buff; 00110 00111 *CDta.c++ = PacketID; 00112 *CDta.c++ = PacketSize; 00113 00114 *CDta.s++ = Data->EntityID; 00115 *CDta.c++ = Data->SegID; 00116 00117 *CDta.c++ = ((Cigi_uint8)Data->CollType) & 0x01; 00118 00119 *CDta.s++ = Data->CollEntityID; 00120 *CDta.l++ = Data->Material; 00121 00122 if(!Data->IsValidV1or2) 00123 *CDta.f++ = Data->IntersectDist; 00124 else 00125 *CDta.f++ = 0.0f; 00126 00127 return(PacketSize); 00128 00129 }
int CigiCollDetSegRespV3::SetCollEntityID | ( | const Cigi_uint16 | CollEntityIDIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the CollEntityID with bound checking control
CollEntityIDIn | - ID of entity collided with. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 159 of file CigiCollDetSegRespV3.h.
References CIGI_SUCCESS.
00160 { 00161 CollEntityID = CollEntityIDIn; 00162 return(CIGI_SUCCESS); 00163 }
int CigiCollDetSegRespV3::SetCollType | ( | const CollTypeGrp | CollTypeIn, | |
bool | bndchk = true | |||
) |
Sets the CollType with bound checking control
CollTypeIn | - Collision Type NonEntity=0 Entity=1 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 181 of file CigiCollDetSegRespV3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetSegResp::CollType.
00182 { 00183 00184 #ifndef CIGI_NO_BND_CHK 00185 if(bndchk && ((CollTypeIn < 0)||(CollTypeIn > 1))) 00186 { 00187 #ifndef CIGI_NO_EXCEPT 00188 throw CigiValueOutOfRangeException("CollType",(CollTypeGrp)CollTypeIn,0,1); 00189 #endif 00190 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00191 } 00192 #endif 00193 00194 CollType = CollTypeIn; 00195 return(CIGI_SUCCESS); 00196 00197 }
int CigiCollDetSegRespV3::SetIntersectDist | ( | const float | IntersectDistIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the IntersectDist with bound checking control
IntersectDistIn | - Distance from the source or starting point of the segment along the segment. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 181 of file CigiCollDetSegRespV3.h.
References CIGI_SUCCESS.
00182 { 00183 IntersectDist = IntersectDistIn; 00184 return(CIGI_SUCCESS); 00185 }
int CigiCollDetSegRespV3::SetSegID | ( | const Cigi_uint8 | SegIDIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the SegID with bound checking control
SegIDIn | - Segment ID | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 119 of file CigiCollDetSegRespV3.h.
References CIGI_SUCCESS.
00120 { 00121 SegID = SegIDIn; 00122 return(CIGI_SUCCESS); 00123 }
int CigiCollDetSegRespV3::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
Buff | - A pointer to the current pack point. | |
Swap | - N/A for V1 & V2 | |
Spec | - A pointer to special data - This is not used in this class. |
Implements CigiBaseCollDetSegResp.
Definition at line 134 of file CigiCollDetSegRespV3.cpp.
References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiBaseCollDetSegResp::CollEntityID, CigiBaseCollDetSegResp::CollType, CigiBaseCollDetSegResp::EntityID, PackPointerUnion::f, CigiBaseCollDetSegResp::IntersectDist, CigiBaseCollDetSegResp::IsValidV1or2, PackPointerUnion::l, CigiBaseCollDetSegResp::Material, CigiBasePacket::PacketSize, PackPointerUnion::s, and CigiBaseCollDetSegResp::SegID.
00135 { 00136 PackPointer CDta; 00137 00138 CDta.c = Buff; 00139 00140 CDta.c += 2; // Step over packet id and size 00141 00142 if(!Swap) 00143 { 00144 EntityID = *CDta.s++; 00145 SegID = *CDta.c++; 00146 00147 CollType = (CollTypeGrp)(*CDta.c++ & 0x01); 00148 00149 CollEntityID = *CDta.s++; 00150 Material = *CDta.l++; 00151 IntersectDist = *CDta.f++; 00152 } 00153 else 00154 { 00155 CigiSwap2(&EntityID, CDta.s++); 00156 SegID = *CDta.c++; 00157 00158 CollType = (CollTypeGrp)(*CDta.c++ & 0x01); 00159 00160 CigiSwap2(&CollEntityID, CDta.s++); 00161 CigiSwap4(&Material, CDta.l++); 00162 CigiSwap4(&IntersectDist, CDta.f++); 00163 } 00164 00165 IsValidV1or2 = false; 00166 00167 return(PacketSize); 00168 00169 }