Package edu.nps.moves.dis7
Class CollisionElasticPdu
java.lang.Object
edu.nps.moves.dis7.Pdu
edu.nps.moves.dis7.PduBase
edu.nps.moves.dis7.EntityInformationFamilyPdu
edu.nps.moves.dis7.CollisionElasticPdu
- All Implemented Interfaces:
edu.nps.moves.dis7.Marshaller
,java.io.Serializable
public class CollisionElasticPdu extends EntityInformationFamilyPdu implements java.io.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
Fields Modifier and Type Field Description protected float
coefficientOfRestitution
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
collidingEntityID
This field shall identify the entity that has collided with the issuing entity.protected EventIdentifier
collisionEventID
This field shall contain an identification generated by the issuing simulation application to associate related collision events.protected float
collisionIntermediateResultXX
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
collisionIntermediateResultXY
tensor valuesprotected float
collisionIntermediateResultXZ
tensor valuesprotected float
collisionIntermediateResultYY
tensor valuesprotected float
collisionIntermediateResultYZ
tensor valuesprotected float
collisionIntermediateResultZZ
tensor valuesprotected Vector3Float
contactVelocity
This field shall contain the velocity at the time the collision is detected at the point the collision is detected.protected EntityID
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)protected Vector3Float
locationOfImpact
This field shall specify the location of the collision with respect to the entity with which the issuing entity collided.protected float
mass
This field shall contain the mass of the issuing entity and shall be represented by a 32-bit floating point number representing kilogramsprotected short
pad
some paddingprotected Vector3Float
unitSurfaceNormal
This record shall represent the normal vector to the surface at the point of collision detection.Fields inherited from class edu.nps.moves.dis7.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors Constructor Description CollisionElasticPdu()
Constructor -
Method Summary
Methods inherited from class edu.nps.moves.dis7.PduBase
getPadding, getPduStatus, setPadding, setPduStatus
Methods 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. 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 the size of this serialized object in bytes- Specified by:
getMarshalledSize
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
getMarshalledSize
in classEntityInformationFamilyPdu
-
setIssuingEntityID
Setter forissuingEntityID
-
getIssuingEntityID
Getter forissuingEntityID
-
setCollidingEntityID
Setter forcollidingEntityID
-
getCollidingEntityID
Getter forcollidingEntityID
-
setCollisionEventID
Setter forcollisionEventID
-
getCollisionEventID
Getter forcollisionEventID
-
setPad
Setter forpad
-
getPad
public short getPad()Getter forpad
-
setContactVelocity
Setter forcontactVelocity
-
getContactVelocity
Getter forcontactVelocity
-
setMass
Setter formass
-
getMass
public float getMass()Getter formass
-
setLocationOfImpact
Setter forlocationOfImpact
-
getLocationOfImpact
Getter forlocationOfImpact
-
setCollisionIntermediateResultXX
Setter forcollisionIntermediateResultXX
-
getCollisionIntermediateResultXX
public float getCollisionIntermediateResultXX()Getter forcollisionIntermediateResultXX
-
setCollisionIntermediateResultXY
Setter forcollisionIntermediateResultXY
-
getCollisionIntermediateResultXY
public float getCollisionIntermediateResultXY()Getter forcollisionIntermediateResultXY
-
setCollisionIntermediateResultXZ
Setter forcollisionIntermediateResultXZ
-
getCollisionIntermediateResultXZ
public float getCollisionIntermediateResultXZ()Getter forcollisionIntermediateResultXZ
-
setCollisionIntermediateResultYY
Setter forcollisionIntermediateResultYY
-
getCollisionIntermediateResultYY
public float getCollisionIntermediateResultYY()Getter forcollisionIntermediateResultYY
-
setCollisionIntermediateResultYZ
Setter forcollisionIntermediateResultYZ
-
getCollisionIntermediateResultYZ
public float getCollisionIntermediateResultYZ()Getter forcollisionIntermediateResultYZ
-
setCollisionIntermediateResultZZ
Setter forcollisionIntermediateResultZZ
-
getCollisionIntermediateResultZZ
public float getCollisionIntermediateResultZZ()Getter forcollisionIntermediateResultZZ
-
setUnitSurfaceNormal
Setter forunitSurfaceNormal
-
getUnitSurfaceNormal
Getter forunitSurfaceNormal
-
setCoefficientOfRestitution
Setter forcoefficientOfRestitution
-
getCoefficientOfRestitution
public float getCoefficientOfRestitution()Getter forcoefficientOfRestitution
-
marshal
public void marshal(java.io.DataOutputStream dos) throws java.lang.ExceptionSerializes an object to a DataOutputStream.- Specified by:
marshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
marshal
in 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:
unmarshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
unmarshal
in 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:
marshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
marshal
in 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:
unmarshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
unmarshal
in 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:
equals
in classEntityInformationFamilyPdu
-
equalsImpl
public boolean equalsImpl(java.lang.Object obj)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 classEntityInformationFamilyPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
public java.lang.String toString()- Overrides:
toString
in classEntityInformationFamilyPdu
-