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.EntityInformationFamilyPdu
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.
IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation - Application Protocols
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EntityIDThis field shall identify the entity that has collided with the issuing entity (see 5.3.3.4).protected CollisionTypeThis field shall identify the type of collision.protected EventIdentifierThis field shall contain an identification generated by the issuing simulation application to associate related collision events.protected EntityIDThis field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).protected Vector3FloatThis field shall specify the location of the collision with respect to the entity with which the issuing entity collided.protected floatThis field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.protected bytesome paddingprotected Vector3FloatThis 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.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequalsImpl(Object obj)Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectGetter forcollidingEntityIDGetter forcollisionTypeGetter foreventIDGetter forissuingEntityIDGetter forlocationintReturns size of this serialized (marshalled) object in bytesfloatgetMass()Getter formassbytegetPad()Getter forpadGetter forvelocityvoidmarshal(DataOutputStream dos)Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer)Packs an object into the ByteBuffer.setCollidingEntityID(EntityID pCollidingEntityID)Setter forcollidingEntityIDsetCollisionType(CollisionType pCollisionType)Setter forcollisionTypesetEventID(EventIdentifier pEventID)Setter foreventIDsetIssuingEntityID(EntityID pIssuingEntityID)Setter forissuingEntityIDsetLocation(Vector3Float pLocation)Setter forlocationsetMass(float pMass)Setter formasssetPad(byte pPad)Setter forpadsetPad(int pPad)Utility setter forpadsetVelocity(Vector3Float pVelocity)Setter forvelocitytoString()intunmarshal(DataInputStream dis)Deserializes an object from a DataInputStream.intunmarshal(ByteBuffer byteBuffer)Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.pdus.PduBase
getPadding, getPduStatus, setPadding, setPadding, setPduStatusMethods inherited from class edu.nps.moves.dis7.pdus.Pdu
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, marshal, setExerciseID, setExerciseID, setLength, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp
-
Field Details
-
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)].
-
-
Constructor Details
-
CollisionPdu
public CollisionPdu()Constructor
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Specified by:
getMarshalledSizein interfaceMarshaller- Overrides:
getMarshalledSizein classEntityInformationFamilyPdu- Returns:
- serialized size in bytes
- See Also:
- https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
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:
marshalin interfaceMarshaller- Overrides:
marshalin classEntityInformationFamilyPdu- Parameters:
dos- the OutputStream- Throws:
Exception- if something goes wrong- See Also:
DataOutputStream
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin classEntityInformationFamilyPdu- Parameters:
dis- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception- if something goes wrong- See Also:
DataInputStream, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
marshal
Packs an object into the ByteBuffer.- Specified by:
marshalin interfaceMarshaller- Overrides:
marshalin classEntityInformationFamilyPdu- 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:
ByteBuffer
-
unmarshal
Unpacks a Pdu from the underlying data.- Specified by:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin classEntityInformationFamilyPdu- 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:
ByteBuffer, https://en.wikipedia.org/wiki/Marshalling_(computer_science)
-
equals
- Overrides:
equalsin classEntityInformationFamilyPdu
-
equalsImpl
Description copied from class:PduCompare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied object- Overrides:
equalsImplin classEntityInformationFamilyPdu- Parameters:
obj- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
- Overrides:
toStringin classEntityInformationFamilyPdu
-