Class EntityStatePdu
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.EntityStatePdu
- All Implemented Interfaces:
Marshaller
,Serializable
7.2.2. Represents the position and state of one entity in the world. See 5.3.2.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EntityType
alternativeEntityType is an undescribed parameter...protected ByteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected EntityCapabilities
a series of bit flags uid 55protected DataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serializationprotected DeadReckoningParameters
parameters used for dead reckoningprotected int
a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.protected EntityID
Unique ID for an entity that is tied to this state informationprotected Vector3Float
Describes the speed of the entity in the worldprotected Vector3Double
describes the location of the entity in the worldprotected EulerAngles
describes the orientation of the entity, in euler angles with units of radiansprotected EntityType
Describes the type of entity in the worldprotected ForceID
What force this entity is affiliated with, eg red, blue, neutral, etc uid 6protected EntityMarking
11 characters that can be used for entity identification, debugging, or to draw unique strings on the side of entities in the worldstatic final String
The name of this PDU typeprotected byte
How many variable parameters are in the variable length list.protected List
<VariableParameter> variable length list of variable parameters.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadvanceEntityLocation
(double timestep) Advance location using linear velocities for a single timestepMarking utility to clear character valuescopy()
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 objectGetter foralternativeEntityType
Getter forcapabilities
Getter fordeadReckoningParameters
int
Getter forentityAppearance
Getter forentityID
Getter forentityLinearVelocity
Getter forentityLocation
Getter forentityOrientation
Getter forentityType
Getter forforceId
Getter formarking
Marking utility to get character values as a stringint
Returns size of this serialized (marshalled) object in bytesGetter forvariableParameters
int
hashCode()
void
marshal
(DataOutputStream dos) Serializes an object to a DataOutputStream.void
marshal
(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setAlternativeEntityType
(EntityType pAlternativeEntityType) Setter foralternativeEntityType
setCapabilities
(EntityCapabilities pCapabilities) Setter forcapabilities
setDeadReckoningParameters
(DeadReckoningParameters pDeadReckoningParameters) Setter fordeadReckoningParameters
setEntityAppearance
(int pEntityAppearance) Setter forentityAppearance
setEntityID
(EntityID pEntityID) Setter forentityID
final EntityStatePdu
setEntityLinearVelocity
(float speed, EntityStatePdu.Direction direction) Utility method to set entity linear velocity using speed and directionsetEntityLinearVelocity
(Vector3Float pEntityLinearVelocity) Setter forentityLinearVelocity
setEntityLocation
(double x, double y, double z) Setter forentityLocation
setEntityLocation
(Vector3Double pEntityLocation) Setter forentityLocation
setEntityOrientation
(float phi, float theta, float psi) Setter forentityOrientation
setEntityOrientation
(EulerAngles pEntityOrientation) Setter forentityOrientation
setEntityType
(EntityType pEntityType) Setter forentityType
setForceId
(ForceID pForceId) Setter forforceId
setMarking
(EntityMarking pMarking) Setter formarking
setMarking
(String newMarking) Marking utility to set character values, 11 characters maximumsetVariableParameters
(List<VariableParameter> pVariableParameters) Setter forvariableParameters
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
-
entityID
Unique ID for an entity that is tied to this state information -
forceId
What force this entity is affiliated with, eg red, blue, neutral, etc uid 6 -
numberOfVariableParameters
protected byte numberOfVariableParametersHow many variable parameters are in the variable length list. In earlier versions of DIS these were known as articulation parameters -
entityType
Describes the type of entity in the world -
alternativeEntityType
alternativeEntityType is an undescribed parameter... -
entityLinearVelocity
Describes the speed of the entity in the world -
entityLocation
describes the location of the entity in the world -
entityOrientation
describes the orientation of the entity, in euler angles with units of radians -
entityAppearance
protected int entityAppearancea series of bit flags that are used to help draw the entity, such as smoking, on fire, etc. -
deadReckoningParameters
parameters used for dead reckoning -
marking
11 characters that can be used for entity identification, debugging, or to draw unique strings on the side of entities in the world -
capabilities
a series of bit flags uid 55 -
variableParameters
variable length list of variable parameters. In earlier DIS versions this was articulation parameters. -
byteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serialization- See Also:
-
dataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serialization- See Also:
-
-
Constructor Details
-
EntityStatePdu
public EntityStatePdu()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:
-
setEntityID
Setter forentityID
- Parameters:
pEntityID
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityID
-
setForceId
Setter forforceId
- Parameters:
pForceId
- new value of interest- Returns:
- same object to permit progressive setters
-
getForceId
-
setEntityType
Setter forentityType
- Parameters:
pEntityType
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityType
-
setAlternativeEntityType
Setter foralternativeEntityType
- Parameters:
pAlternativeEntityType
- new value of interest- Returns:
- same object to permit progressive setters
-
getAlternativeEntityType
Getter foralternativeEntityType
- Returns:
- value of interest
-
setEntityLinearVelocity
Setter forentityLinearVelocity
- Parameters:
pEntityLinearVelocity
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityLinearVelocity
Getter forentityLinearVelocity
- Returns:
- value of interest
-
setEntityLocation
Setter forentityLocation
- Parameters:
pEntityLocation
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityLocation
-
setEntityOrientation
Setter forentityOrientation
- Parameters:
pEntityOrientation
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityOrientation
-
setEntityAppearance
Setter forentityAppearance
- Parameters:
pEntityAppearance
- new value of interest- Returns:
- same object to permit progressive setters
-
getEntityAppearance
-
setDeadReckoningParameters
Setter fordeadReckoningParameters
- Parameters:
pDeadReckoningParameters
- new value of interest- Returns:
- same object to permit progressive setters
-
getDeadReckoningParameters
Getter fordeadReckoningParameters
- Returns:
- value of interest
-
setMarking
Setter formarking
- Parameters:
pMarking
- new value of interest- Returns:
- same object to permit progressive setters
-
getMarking
-
setCapabilities
Setter forcapabilities
- Parameters:
pCapabilities
- new value of interest- Returns:
- same object to permit progressive setters
-
getCapabilities
-
setVariableParameters
Setter forvariableParameters
- Parameters:
pVariableParameters
- new value of interest- Returns:
- same object to permit progressive setters
-
getVariableParameters
Getter forvariableParameters
- 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
-
setEntityLinearVelocity
public final EntityStatePdu setEntityLinearVelocity(float speed, EntityStatePdu.Direction direction) Utility method to set entity linear velocity using speed and direction- Parameters:
speed
- in meters/seconddirection
- using Directions enumerations- Returns:
- same object to permit progressive setters
- See Also:
-
setEntityLocation
Setter forentityLocation
- Parameters:
x
- locationy
- locationz
- location- Returns:
- same object to permit progressive setters
-
advanceEntityLocation
Advance location using linear velocities for a single timestep- Parameters:
timestep
- duration of travel- Returns:
- same object to permit progressive setters
-
setEntityOrientation
Setter forentityOrientation
- Parameters:
phi
- new value of interesttheta
- new value of interestpsi
- new value of interest- Returns:
- same object to permit progressive setters
-
clearMarking
Marking utility to clear character values- Returns:
- same object to permit progressive setters
-
setMarking
Marking utility to set character values, 11 characters maximum- Parameters:
newMarking
- new 11-character string to assign as marking value- Returns:
- same object to permit progressive setters
-
getMarkingString
Marking utility to get character values as a string- Returns:
- 11-character String value corresponding to marking
-