Class CollisionElasticPdu
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.CollisionElasticPdu
- All Implemented Interfaces:
Marshaller
,Serializable
public class CollisionElasticPdu
extends EntityInformationInteractionFamilyPdu
implements Serializable
7.2.4 Information about elastic collisions in a DIS exercise shall be communicated using a Collision-Elastic PDU. See 5.3.4.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected float
This 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 EntityID
This field shall identify the entity that has collided with the issuing entity.protected EventIdentifier
This field shall contain an identification generated by the issuing simulation application to associate related collision events.protected float
These 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 float
tensor valuesprotected float
tensor valuesprotected float
tensor valuesprotected float
tensor valuesprotected float
tensor valuesprotected Vector3Float
This field shall contain the velocity at the time the collision is detected at the point the collision is detected.protected DataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serializationprotected 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 kilogramsstatic final String
The name of this PDU typeprotected short
some paddingprotected Vector3Float
This record shall represent the normal vector to the surface at the point of collision detection.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
ConstructorsConstructorDescriptionConstructor creates and configures a new instance object -
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 objectfloat
Getter forcoefficientOfRestitution
Getter forcollidingEntityID
Getter forcollisionEventID
float
Getter forcollisionIntermediateResultXX
float
Getter forcollisionIntermediateResultXY
float
Getter forcollisionIntermediateResultXZ
float
Getter forcollisionIntermediateResultYY
float
Getter forcollisionIntermediateResultYZ
float
Getter forcollisionIntermediateResultZZ
Getter forcontactVelocity
Getter forissuingEntityID
Getter forlocationOfImpact
int
Returns size of this serialized (marshalled) object in bytesfloat
getMass()
Getter formass
short
getPad()
Getter forpad
Getter forunitSurfaceNormal
int
hashCode()
void
marshal
(DataOutputStream dos) Serializes an object to a DataOutputStream.void
marshal
(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setCoefficientOfRestitution
(float pCoefficientOfRestitution) Setter forcoefficientOfRestitution
setCollidingEntityID
(EntityID pCollidingEntityID) Setter forcollidingEntityID
setCollisionEventID
(EventIdentifier pCollisionEventID) Setter forcollisionEventID
setCollisionIntermediateResultXX
(float pCollisionIntermediateResultXX) Setter forcollisionIntermediateResultXX
setCollisionIntermediateResultXY
(float pCollisionIntermediateResultXY) Setter forcollisionIntermediateResultXY
setCollisionIntermediateResultXZ
(float pCollisionIntermediateResultXZ) Setter forcollisionIntermediateResultXZ
setCollisionIntermediateResultYY
(float pCollisionIntermediateResultYY) Setter forcollisionIntermediateResultYY
setCollisionIntermediateResultYZ
(float pCollisionIntermediateResultYZ) Setter forcollisionIntermediateResultYZ
setCollisionIntermediateResultZZ
(float pCollisionIntermediateResultZZ) Setter forcollisionIntermediateResultZZ
setContactVelocity
(Vector3Float pContactVelocity) Setter forcontactVelocity
setIssuingEntityID
(EntityID pIssuingEntityID) Setter forissuingEntityID
setLocationOfImpact
(Vector3Float pLocationOfImpact) Setter forlocationOfImpact
setMass
(float pMass) Setter formass
setPad
(int pPad) Utility setter forpad
setPad
(short pPad) Setter forpad
setUnitSurfaceNormal
(Vector3Float pUnitSurfaceNormal) Setter forunitSurfaceNormal
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
-
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. -
byteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serialization- See Also:
-
dataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serialization- See Also:
-
-
Constructor Details
-
CollisionElasticPdu
public CollisionElasticPdu()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
-
setCollidingEntityID
Setter forcollidingEntityID
- Parameters:
pCollidingEntityID
- new value of interest- Returns:
- same object to permit progressive setters
-
getCollidingEntityID
-
setCollisionEventID
Setter forcollisionEventID
- Parameters:
pCollisionEventID
- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionEventID
-
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
-
setContactVelocity
Setter forcontactVelocity
- Parameters:
pContactVelocity
- new value of interest- Returns:
- same object to permit progressive setters
-
getContactVelocity
-
setMass
Setter formass
- Parameters:
pMass
- new value of interest- Returns:
- same object to permit progressive setters
-
getMass
-
setLocationOfImpact
Setter forlocationOfImpact
- Parameters:
pLocationOfImpact
- new value of interest- Returns:
- same object to permit progressive setters
-
getLocationOfImpact
-
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
-
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:
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
-