Package edu.nps.moves.dis7.pdus
Class CollisionPdu
java.lang.Object
edu.nps.moves.dis7.pdus.Pdu
edu.nps.moves.dis7.pdus.PduBase
edu.nps.moves.dis7.pdus.EntityInformationInteractionFamilyPdu
edu.nps.moves.dis7.pdus.CollisionPdu
- All Implemented Interfaces:
Marshaller
,Serializable
7.2.3 Collisions between entities shall be communicated by issuing a Collision PDU. See 5.3.3.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected EntityID
This field shall identify the entity that has collided with the issuing entity (see 5.3.3.4).protected CollisionType
This field shall identify the type of collision.protected DataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serializationprotected EventIdentifier
This field shall contain an identification generated by the issuing simulation application to associate related collision events.protected EntityID
This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).protected Vector3Float
This field shall specify the location of the collision with respect to the entity with which the issuing entity collided.protected float
This field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.static final String
The name of this PDU typeprotected byte
some paddingprotected Vector3Float
This field shall contain the velocity (at the time the collision is detected) of the issuing entity.Fields inherited from class edu.nps.moves.dis7.pdus.EntityInformationInteractionFamilyPdu
FAMILY_NAME
Fields inherited from class edu.nps.moves.dis7.pdus.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
copy method creates a deep copy of current object using preferred marshalling methodCreates a "deep copy" of current object using ByteBuffer methods.copy method creates a deep copy of current object using DataOutputStream methods.boolean
boolean
equalsImpl
(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectGetter forcollidingEntityID
Getter forcollisionType
Getter foreventID
Getter forissuingEntityID
Getter forlocation
int
Returns size of this serialized (marshalled) object in bytesfloat
getMass()
Getter formass
byte
getPad()
Getter forpad
Getter forvelocity
int
hashCode()
void
marshal
(DataOutputStream dos) Serializes an object to a DataOutputStream.void
marshal
(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setCollidingEntityID
(EntityID pCollidingEntityID) Setter forcollidingEntityID
setCollisionType
(CollisionType pCollisionType) Setter forcollisionType
setEventID
(EventIdentifier pEventID) Setter foreventID
setIssuingEntityID
(EntityID pIssuingEntityID) Setter forissuingEntityID
setLocation
(Vector3Float pLocation) Setter forlocation
setMass
(float pMass) Setter formass
setPad
(byte pPad) Setter forpad
setPad
(int pPad) Utility setter forpad
setVelocity
(Vector3Float pVelocity) Setter forvelocity
toString()
int
unmarshal
(DataInputStream dis) Deserializes an object from a DataInputStream.int
unmarshal
(ByteBuffer byteBuffer) Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.pdus.PduBase
getPadding, getPduStatus, setPadding, setPadding, setPduStatus
Methods inherited from class edu.nps.moves.dis7.pdus.Pdu
copyByPduFactory, getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, getTimestampSeconds, isAcknowledgeRPdu, isActionRequestPdu, isActionRequestRPdu, isActionResponsePdu, isActionResponseRPdu, isAggregateStatePdu, isAppearancePdu, isArealObjectStatePdu, isArticulatedPartsPdu, isAttributePdu, isCollisionElasticPdu, isCollisionPdu, isCommentPdu, isCommentRPdu, isCreateEntityPdu, isCreateEntityRPdu, isDataPdu, isDataQueryPdu, isDataQueryRPdu, isDataRPdu, isDesignatorPdu, isDetonationPdu, isDirectedEnergyFirePdu, isDistributedEmissionsRegenerationFamilyPdu, isElectromagneticEmissionPdu, isEntityDamageStatusPdu, isEntityInformationInteractionFamilyPdu, isEntityManagementFamilyPdu, isEntityStatePdu, isEntityStateUpdatePdu, isEnvironmentalProcessPdu, isEventReportPdu, isEventReportRPdu, isFirePdu, isGriddedDataPdu, isIFFPdu, isInformationOperationsActionPdu, isInformationOperationsFamilyPdu, isInformationOperationsReportPdu, isIntercomControlPdu, isIntercomSignalPdu, isIsGroupOfPdu, isIsPartOfPdu, isLEDetonationPdu, isLEFirePdu, isLinearObjectStatePdu, isLiveEntityDetonationPdu, isLiveEntityFirePdu, isLogisticsFamilyPdu, isMinefieldDataPdu, isMinefieldFamilyPdu, isMinefieldQueryPdu, isMinefieldResponseNACKPdu, isMinefieldStatePdu, isPointObjectStatePdu, isRadioCommunicationsFamilyPdu, isReceiverPdu, isRecordQueryRPdu, isRecordRPdu, isReliablePdu, isRemoveEntityPdu, isRemoveEntityRPdu, isRepairCompletePdu, isRepairResponsePdu, isResupplyCancelPdu, isResupplyOfferPdu, isResupplyReceivedPdu, isSEESPdu, isSetDataPdu, isSetDataRPdu, isSetRecordRPdu, isSignalPdu, isSimulationManagementFamilyPdu, isSimulationManagementWithReliabilityFamilyPdu, isStartResumePdu, isStartResumeRPdu, isStopFreezePdu, isStopFreezeRPdu, isSupplementalEmissionEntityStatePdu, isSyntheticEnvironmentFamilyPdu, isTransferOwnershipPdu, isTransmitterPdu, isTSPIPdu, isUnderwaterAcousticPdu, isWarfareFamilyPdu, marshal, occursAfter, occursBefore, occursSameTime, setExerciseID, setExerciseID, setLength, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp, setTimestampSeconds
-
Field Details
-
NAME
The name of this PDU type- See Also:
-
issuingEntityID
This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28). -
collidingEntityID
This field shall identify the entity that has collided with the issuing entity (see 5.3.3.4). This field shall be represented by an Entity Identifier record (see 6.2.28). -
eventID
This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34). -
collisionType
This field shall identify the type of collision. The Collision Type field shall be represented by an 8-bit record of enumerations uid 189 -
pad
protected byte padsome padding -
velocity
This field shall contain the velocity (at the time the collision is detected) of the issuing entity. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]. -
mass
protected float massThis field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms. -
location
This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. The Location field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]. -
byteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serialization- See Also:
-
dataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serialization- See Also:
-
-
Constructor Details
-
CollisionPdu
public CollisionPdu()Constructor creates and configures a new instance object
-
-
Method Details
-
copy
copy method creates a deep copy of current object using preferred marshalling method- Returns:
- deep copy of PDU
-
copyByteBuffer
Creates a "deep copy" of current object using ByteBuffer methods.- Returns:
- deep copy of PDU
-
copyDataOutputStream
copy method creates a deep copy of current object using DataOutputStream methods.- Returns:
- deep copy of PDU
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Specified by:
getMarshalledSize
in interfaceMarshaller
- Overrides:
getMarshalledSize
in classEntityInformationInteractionFamilyPdu
- Returns:
- serialized size in bytes
- See Also:
-
setIssuingEntityID
Setter forissuingEntityID
- Parameters:
pIssuingEntityID
- new value of interest- Returns:
- same object to permit progressive setters
-
getIssuingEntityID
Getter forissuingEntityID
- Returns:
- value of interest
-
setCollidingEntityID
Setter forcollidingEntityID
- Parameters:
pCollidingEntityID
- new value of interest- Returns:
- same object to permit progressive setters
-
getCollidingEntityID
Getter forcollidingEntityID
- Returns:
- value of interest
-
setEventID
Setter foreventID
- Parameters:
pEventID
- new value of interest- Returns:
- same object to permit progressive setters
-
getEventID
Getter foreventID
- Returns:
- value of interest
-
setCollisionType
Setter forcollisionType
- Parameters:
pCollisionType
- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionType
Getter forcollisionType
- Returns:
- value of interest
-
setPad
Setter forpad
- Parameters:
pPad
- new value of interest- Returns:
- same object to permit progressive setters
-
setPad
Utility setter forpad
- Parameters:
pPad
- new value of interest- Returns:
- same object to permit progressive setters
-
getPad
public byte getPad()Getter forpad
- Returns:
- value of interest
-
setVelocity
Setter forvelocity
- Parameters:
pVelocity
- new value of interest- Returns:
- same object to permit progressive setters
-
getVelocity
Getter forvelocity
- Returns:
- value of interest
-
setMass
Setter formass
- Parameters:
pMass
- new value of interest- Returns:
- same object to permit progressive setters
-
getMass
public float getMass()Getter formass
- Returns:
- value of interest
-
setLocation
Setter forlocation
- Parameters:
pLocation
- new value of interest- Returns:
- same object to permit progressive setters
-
getLocation
Getter forlocation
- Returns:
- value of interest
-
marshal
Serializes an object to a DataOutputStream.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classEntityInformationInteractionFamilyPdu
- Parameters:
dos
- the OutputStream- Throws:
Exception
- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classEntityInformationInteractionFamilyPdu
- Parameters:
dis
- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception
- if something goes wrong- See Also:
-
marshal
Packs an object into the ByteBuffer.- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classEntityInformationInteractionFamilyPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException
- if byteBuffer is too smallReadOnlyBufferException
- if byteBuffer is read onlyException
- ByteBuffer-generated exception- See Also:
-
unmarshal
Unpacks a Pdu from the underlying data.- Specified by:
unmarshal
in interfaceMarshaller
- Overrides:
unmarshal
in classEntityInformationInteractionFamilyPdu
- Parameters:
byteBuffer
- The ByteBuffer at the position to begin reading- Returns:
- marshalled serialized size in bytes
- Throws:
BufferUnderflowException
- if byteBuffer is too smallException
- ByteBuffer-generated exception- See Also:
-
equals
- Overrides:
equals
in classEntityInformationInteractionFamilyPdu
-
equalsImpl
Description copied from class:Pdu
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Overrides:
equalsImpl
in classEntityInformationInteractionFamilyPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
- Overrides:
toString
in classEntityInformationInteractionFamilyPdu
-
hashCode
public int hashCode()
-