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.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 ByteArrayOutputStreambyteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected 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 DataOutputStreamdataOutputStream (dos) is used for marshal/unmarshal serializationprotected 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 kilogramsstatic final StringThe name of this PDU typeprotected 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.EntityInformationInteractionFamilyPdu
FAMILY_NAMEFields 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.booleanbooleanequalsImpl(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 forunitSurfaceNormalinthashCode()voidmarshal(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
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:
getMarshalledSizein interfaceMarshaller- Overrides:
getMarshalledSizein 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:
marshalin interfaceMarshaller- Overrides:
marshalin classEntityInformationInteractionFamilyPdu- Parameters:
dos- the OutputStream- Throws:
Exception- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin 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:
marshalin interfaceMarshaller- Overrides:
marshalin 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:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin 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:
equalsin classEntityInformationInteractionFamilyPdu
-
equalsImpl
Description copied from class:PduCompare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied object- Overrides:
equalsImplin classEntityInformationInteractionFamilyPdu- Parameters:
obj- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
- Overrides:
toStringin classEntityInformationInteractionFamilyPdu
-
hashCode
-