Package edu.nps.moves.dis7
Class CollisionPdu
java.lang.Object
edu.nps.moves.dis7.Pdu
edu.nps.moves.dis7.PduBase
edu.nps.moves.dis7.EntityInformationFamilyPdu
edu.nps.moves.dis7.CollisionPdu
- All Implemented Interfaces:
edu.nps.moves.dis7.Marshaller,java.io.Serializable
public class CollisionPdu extends EntityInformationFamilyPdu implements java.io.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
Fields Modifier and Type Field Description protected EntityIDcollidingEntityIDThis field shall identify the entity that has collided with the issuing entity (see 5.3.3.4).protected CollisionTypecollisionTypeThis field shall identify the type of collision.protected EventIdentifiereventIDThis field shall contain an identification generated by the issuing simulation application to associate related collision events.protected EntityIDissuingEntityIDThis field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).protected Vector3FloatlocationThis field shall specify the location of the collision with respect to the entity with which the issuing entity collided.protected floatmassThis field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.protected bytepadsome paddingprotected Vector3FloatvelocityThis field shall contain the velocity (at the time the collision is detected) of the issuing entity.Fields inherited from class edu.nps.moves.dis7.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp -
Constructor Summary
Constructors Constructor Description CollisionPdu()Constructor -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanequalsImpl(java.lang.Object obj)Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectEntityIDgetCollidingEntityID()Getter forcollidingEntityIDCollisionTypegetCollisionType()Getter forcollisionTypeEventIdentifiergetEventID()Getter foreventIDEntityIDgetIssuingEntityID()Getter forissuingEntityIDVector3FloatgetLocation()Getter forlocationintgetMarshalledSize()Returns the size of this serialized object in bytesfloatgetMass()Getter formassbytegetPad()Getter forpadVector3FloatgetVelocity()Getter forvelocityvoidmarshal(java.io.DataOutputStream dos)Serializes an object to a DataOutputStream.voidmarshal(java.nio.ByteBuffer buff)Packs an object into the ByteBuffer.CollisionPdusetCollidingEntityID(EntityID pCollidingEntityID)Setter forcollidingEntityIDCollisionPdusetCollisionType(CollisionType pCollisionType)Setter forcollisionTypeCollisionPdusetEventID(EventIdentifier pEventID)Setter foreventIDCollisionPdusetIssuingEntityID(EntityID pIssuingEntityID)Setter forissuingEntityIDCollisionPdusetLocation(Vector3Float pLocation)Setter forlocationCollisionPdusetMass(float pMass)Setter formassCollisionPdusetPad(byte pPad)Setter forpadCollisionPdusetVelocity(Vector3Float pVelocity)Setter forvelocityjava.lang.StringtoString()intunmarshal(java.io.DataInputStream dis)Unserializes an object from a DataInputStream.intunmarshal(java.nio.ByteBuffer buff)Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.PduBase
getPadding, getPduStatus, setPadding, setPduStatusMethods inherited from class edu.nps.moves.dis7.Pdu
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, marshal, setExerciseID, 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 the size of this serialized object in bytes- Specified by:
getMarshalledSizein interfaceedu.nps.moves.dis7.Marshaller- Overrides:
getMarshalledSizein classEntityInformationFamilyPdu
-
setIssuingEntityID
Setter forissuingEntityID -
getIssuingEntityID
Getter forissuingEntityID -
setCollidingEntityID
Setter forcollidingEntityID -
getCollidingEntityID
Getter forcollidingEntityID -
setEventID
Setter foreventID -
getEventID
Getter foreventID -
setCollisionType
Setter forcollisionType -
getCollisionType
Getter forcollisionType -
setPad
Setter forpad -
getPad
public byte getPad()Getter forpad -
setVelocity
Setter forvelocity -
getVelocity
Getter forvelocity -
setMass
Setter formass -
getMass
public float getMass()Getter formass -
setLocation
Setter forlocation -
getLocation
Getter forlocation -
marshal
public void marshal(java.io.DataOutputStream dos) throws java.lang.ExceptionSerializes an object to a DataOutputStream.- Specified by:
marshalin interfaceedu.nps.moves.dis7.Marshaller- Overrides:
marshalin classEntityInformationFamilyPdu- Parameters:
dos- the OutputStream- Throws:
java.lang.Exception- if something goes wrong- See Also:
DataOutputStream
-
unmarshal
public int unmarshal(java.io.DataInputStream dis) throws java.lang.ExceptionUnserializes an object from a DataInputStream.- Specified by:
unmarshalin interfaceedu.nps.moves.dis7.Marshaller- Overrides:
unmarshalin classEntityInformationFamilyPdu- Parameters:
dis- the InputStream- Returns:
- unmarshalled size
- Throws:
java.lang.Exception- if something goes wrong- See Also:
DataInputStream
-
marshal
public void marshal(java.nio.ByteBuffer buff) throws java.lang.ExceptionPacks an object into the ByteBuffer.- Specified by:
marshalin interfaceedu.nps.moves.dis7.Marshaller- Overrides:
marshalin classEntityInformationFamilyPdu- Parameters:
buff- The ByteBuffer at the position to begin writing- Throws:
java.nio.BufferOverflowException- if buff is too smalljava.nio.ReadOnlyBufferException- if buff is read onlyjava.lang.Exception- ByteBuffer-generated exception- See Also:
ByteBuffer
-
unmarshal
public int unmarshal(java.nio.ByteBuffer buff) throws java.lang.ExceptionUnpacks a Pdu from the underlying data.- Specified by:
unmarshalin interfaceedu.nps.moves.dis7.Marshaller- Overrides:
unmarshalin classEntityInformationFamilyPdu- Parameters:
buff- The ByteBuffer at the position to begin reading- Returns:
- marshalled size
- Throws:
java.nio.BufferUnderflowException- if buff is too smalljava.lang.Exception- ByteBuffer-generated exception- See Also:
ByteBuffer
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classEntityInformationFamilyPdu
-
equalsImpl
public boolean equalsImpl(java.lang.Object obj)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
public java.lang.String toString()- Overrides:
toStringin classEntityInformationFamilyPdu
-