![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00009 00010 #ifndef _detonationPdu_h 00011 #define _detonationPdu_h 00012 00013 #if DtDIS 00014 00015 #include "interaction.h" 00016 #include "packets/detonationP.h" 00017 #include "hostStructs.h" 00018 #include "eventId.h" 00019 #include "fireInter.h" 00020 00021 #include <vlpi/articulatedPartCollection.h> 00022 #include <vlpi/apSpec.h> 00023 00024 #include <matrix/vlMath.h> 00025 00026 00027 00028 #define DtMaxNumDetArtParts 25 00029 00030 class DtExerciseConn; 00031 class DtDetonationPdu; 00032 00034 typedef DtDetonationPdu DtDetonationInteraction; 00035 00036 typedef void (*DtDetonationInteractionCb)(DtDetonationInteraction *inter, 00037 void *usr); 00038 00041 class DT_DLL_VL DtDetonationPdu : public DtInteraction 00042 { 00043 public: 00044 00045 enum { PduStaticSize=104 }; 00046 00047 public: 00048 DtDetonationPdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00049 DtDetonationPdu(const DtNetDetonationPdu *initial, 00050 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00051 00052 DtDetonationPdu(const DtEntityIdentifier &attacker, 00053 const DtEntityIdentifier &target, 00054 const DtEntityIdentifier &munition, 00055 const DtEventID &eventId, 00056 const DtVector& linVelocity, 00057 const DtVector& location, 00058 const DtBurstDescriptor &burst, 00059 const DtVector& entLocation, 00060 DtDetonationResult result, 00061 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00062 00064 DtDetonationPdu(const DtFireInteraction &fire, 00065 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00066 00067 static DtPdu *create(const DtNetPacket *initial, 00068 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00069 00070 static void addCallback(DtExerciseConn *conn, 00071 DtDetonationInteractionCb cb, void *usr); 00072 static void removeCallback(DtExerciseConn *conn, 00073 DtDetonationInteractionCb cb, void *usr); 00074 00075 /****************** INSPECTOR FUNCTIONS *******************/ 00076 const DtObjectId &attackerId() const; 00077 void setAttackerId(const DtObjectId &id); 00078 00079 const DtObjectId &targetId() const; 00080 void setTargetId(const DtObjectId &id); 00081 00082 const DtObjectId &munitionId() const; 00083 void setMunitionId(const DtObjectId &id); 00084 00085 const DtEventID &eventId() const; 00086 void setEventId(const DtEventID &id); 00087 00088 const DtVector& velocity() const; 00089 void setVelocity(const DtVector& velocity); 00090 00091 const DtVector& worldLocation() const; 00092 void setWorldLocation(const DtVector& location); 00093 00094 const DtVector& entityLocation() const; 00095 void setEntityLocation(const DtVector& location); 00096 00097 DtDetonationResult result() const; 00098 void setResult(DtDetonationResult result); 00099 00100 DtDetonatorFuze fuseType() const; 00101 void setFuseType(DtDetonatorFuze fuse); 00102 00103 const DtEntityType &munitionType() const; 00104 void setMunitionType(const DtEntityType &munType); 00105 00106 int quantity() const; 00107 void setQuantity(int quant); 00108 00109 int rate() const; 00110 void setRate(int rate); 00111 00112 DtWarheadType warheadType() const; 00113 void setWarheadType(DtWarheadType type); 00114 00116 const DtBurstDescriptor &burst() const; 00117 void setBurst(const DtBurstDescriptor &burst); 00118 00119 void setArticulatedParts(const DtArticulatedPartCollection& apList); 00120 const DtArticulatedPartCollection& articulatedParts() const; 00121 00122 virtual void printData() const; 00123 virtual void printDataToStream(std::ostream& stream) const; 00124 virtual void printDataToString(DtString& str) const; 00125 00126 protected: 00127 DtPduKind internalGetPduKind() const {return DtDetonationPduKind;} 00128 00129 DtObjectId att; 00130 DtObjectId tar; 00131 DtObjectId mun; 00132 DtEventID event; 00133 DtVector vel, world, ent; 00134 DtBurstDescriptor theBurst; 00135 DtEntityType myMunType; 00136 mutable DtArticulatedPartCollection myArtPartCollection; 00137 }; 00138 00139 00140 #endif 00141 #endif 00142