Package edu.nps.moves.dis7.pdus
Class CollisionElasticPdu
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.CollisionElasticPdu
- All Implemented Interfaces:
Marshaller,Serializable
7.2.4 Information about elastic collisions in a DIS exercise shall be communicated using a Collision-Elastic PDU. See 5.3.4.
IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation - Application Protocols
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatThis field shall represent the degree to which energy is conserved in a collision and shall be represented by a 32-bit floating point number.protected EntityIDThis field shall identify the entity that has collided with the issuing entity.protected EventIdentifierThis field shall contain an identification generated by the issuing simulation application to associate related collision events.protected floatThese six records represent the six independent components of a positive semi-definite matrix formed by pre-multiplying and post-multiplying the tensor of inertia, by the anti-symmetric matrix generated by the moment arm, and shall be represented by 32-bit floating point numbers (see 5.3.4.4)protected floattensor valuesprotected floattensor valuesprotected floattensor valuesprotected floattensor valuesprotected floattensor valuesprotected Vector3FloatThis field shall contain the velocity at the time the collision is detected at the point the collision is detected.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 kilogramsprotected shortsome paddingprotected Vector3FloatThis record shall represent the normal vector to the surface at the point of collision detection.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 objectfloatGetter forcoefficientOfRestitutionGetter forcollidingEntityIDGetter forcollisionEventIDfloatGetter forcollisionIntermediateResultXXfloatGetter forcollisionIntermediateResultXYfloatGetter forcollisionIntermediateResultXZfloatGetter forcollisionIntermediateResultYYfloatGetter forcollisionIntermediateResultYZfloatGetter forcollisionIntermediateResultZZGetter forcontactVelocityGetter forissuingEntityIDGetter forlocationOfImpactintReturns size of this serialized (marshalled) object in bytesfloatgetMass()Getter formassshortgetPad()Getter forpadGetter forunitSurfaceNormalvoidmarshal(DataOutputStream dos)Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer)Packs an object into the ByteBuffer.setCoefficientOfRestitution(float pCoefficientOfRestitution)Setter forcoefficientOfRestitutionsetCollidingEntityID(EntityID pCollidingEntityID)Setter forcollidingEntityIDsetCollisionEventID(EventIdentifier pCollisionEventID)Setter forcollisionEventIDsetCollisionIntermediateResultXX(float pCollisionIntermediateResultXX)Setter forcollisionIntermediateResultXXsetCollisionIntermediateResultXY(float pCollisionIntermediateResultXY)Setter forcollisionIntermediateResultXYsetCollisionIntermediateResultXZ(float pCollisionIntermediateResultXZ)Setter forcollisionIntermediateResultXZsetCollisionIntermediateResultYY(float pCollisionIntermediateResultYY)Setter forcollisionIntermediateResultYYsetCollisionIntermediateResultYZ(float pCollisionIntermediateResultYZ)Setter forcollisionIntermediateResultYZsetCollisionIntermediateResultZZ(float pCollisionIntermediateResultZZ)Setter forcollisionIntermediateResultZZsetContactVelocity(Vector3Float pContactVelocity)Setter forcontactVelocitysetIssuingEntityID(EntityID pIssuingEntityID)Setter forissuingEntityIDsetLocationOfImpact(Vector3Float pLocationOfImpact)Setter forlocationOfImpactsetMass(float pMass)Setter formasssetPad(int pPad)Utility setter forpadsetPad(short pPad)Setter forpadsetUnitSurfaceNormal(Vector3Float pUnitSurfaceNormal)Setter forunitSurfaceNormaltoString()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. This field shall be a valid identifier of an entity or server capable of responding to the receipt of this Collision-Elastic PDU. This field shall be represented by an Entity Identifier record (see 6.2.28). -
collisionEventID
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). -
pad
protected short padsome padding -
contactVelocity
This field shall contain the velocity at the time the collision is detected at the point the collision is detected. 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 -
locationOfImpact
This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]. -
collisionIntermediateResultXX
protected float collisionIntermediateResultXXThese six records represent the six independent components of a positive semi-definite matrix formed by pre-multiplying and post-multiplying the tensor of inertia, by the anti-symmetric matrix generated by the moment arm, and shall be represented by 32-bit floating point numbers (see 5.3.4.4) -
collisionIntermediateResultXY
protected float collisionIntermediateResultXYtensor values -
collisionIntermediateResultXZ
protected float collisionIntermediateResultXZtensor values -
collisionIntermediateResultYY
protected float collisionIntermediateResultYYtensor values -
collisionIntermediateResultYZ
protected float collisionIntermediateResultYZtensor values -
collisionIntermediateResultZZ
protected float collisionIntermediateResultZZtensor values -
unitSurfaceNormal
This record shall represent the normal vector to the surface at the point of collision detection. The surface normal shall be represented in world coordinates. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]. -
coefficientOfRestitution
protected float coefficientOfRestitutionThis field shall represent the degree to which energy is conserved in a collision and shall be represented by a 32-bit floating point number. In addition, it represents a free parameter by which simulation application developers may "tune" their collision interactions.
-
-
Constructor Details
-
CollisionElasticPdu
public CollisionElasticPdu()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
-
setCollisionEventID
Setter forcollisionEventID- Parameters:
pCollisionEventID- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionEventID
Getter forcollisionEventID- 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 short getPad()Getter forpad- Returns:
- value of interest
-
setContactVelocity
Setter forcontactVelocity- Parameters:
pContactVelocity- new value of interest- Returns:
- same object to permit progressive setters
-
getContactVelocity
Getter forcontactVelocity- 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
-
setLocationOfImpact
Setter forlocationOfImpact- Parameters:
pLocationOfImpact- new value of interest- Returns:
- same object to permit progressive setters
-
getLocationOfImpact
Getter forlocationOfImpact- Returns:
- value of interest
-
setCollisionIntermediateResultXX
Setter forcollisionIntermediateResultXX- Parameters:
pCollisionIntermediateResultXX- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultXX
public float getCollisionIntermediateResultXX()Getter forcollisionIntermediateResultXX- Returns:
- value of interest
-
setCollisionIntermediateResultXY
Setter forcollisionIntermediateResultXY- Parameters:
pCollisionIntermediateResultXY- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultXY
public float getCollisionIntermediateResultXY()Getter forcollisionIntermediateResultXY- Returns:
- value of interest
-
setCollisionIntermediateResultXZ
Setter forcollisionIntermediateResultXZ- Parameters:
pCollisionIntermediateResultXZ- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultXZ
public float getCollisionIntermediateResultXZ()Getter forcollisionIntermediateResultXZ- Returns:
- value of interest
-
setCollisionIntermediateResultYY
Setter forcollisionIntermediateResultYY- Parameters:
pCollisionIntermediateResultYY- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultYY
public float getCollisionIntermediateResultYY()Getter forcollisionIntermediateResultYY- Returns:
- value of interest
-
setCollisionIntermediateResultYZ
Setter forcollisionIntermediateResultYZ- Parameters:
pCollisionIntermediateResultYZ- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultYZ
public float getCollisionIntermediateResultYZ()Getter forcollisionIntermediateResultYZ- Returns:
- value of interest
-
setCollisionIntermediateResultZZ
Setter forcollisionIntermediateResultZZ- Parameters:
pCollisionIntermediateResultZZ- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionIntermediateResultZZ
public float getCollisionIntermediateResultZZ()Getter forcollisionIntermediateResultZZ- Returns:
- value of interest
-
setUnitSurfaceNormal
Setter forunitSurfaceNormal- Parameters:
pUnitSurfaceNormal- new value of interest- Returns:
- same object to permit progressive setters
-
getUnitSurfaceNormal
Getter forunitSurfaceNormal- Returns:
- value of interest
-
setCoefficientOfRestitution
Setter forcoefficientOfRestitution- Parameters:
pCoefficientOfRestitution- new value of interest- Returns:
- same object to permit progressive setters
-
getCoefficientOfRestitution
public float getCoefficientOfRestitution()Getter forcoefficientOfRestitution- 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
-