Package edu.nps.moves.dis7.pdus
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 EntityTypealternativeEntityType is an undescribed parameter...protected ByteArrayOutputStreambyteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected EntityCapabilitiesa series of bit flags uid 55protected DataOutputStreamdataOutputStream (dos) is used for marshal/unmarshal serializationprotected DeadReckoningParametersparameters used for dead reckoningprotected inta series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.protected EntityIDUnique ID for an entity that is tied to this state informationprotected Vector3FloatDescribes the speed of the entity in the worldprotected Vector3Doubledescribes the location of the entity in the worldprotected EulerAnglesdescribes the orientation of the entity, in euler angles with units of radiansprotected EntityTypeDescribes the type of entity in the worldprotected ForceIDWhat force this entity is affiliated with, eg red, blue, neutral, etc uid 6protected EntityMarking11 characters that can be used for entity identification, debugging, or to draw unique strings on the side of entities in the worldstatic final StringThe name of this PDU typeprotected byteHow 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_NAMEFields 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.booleanbooleanequalsImpl(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectGetter foralternativeEntityTypeGetter forcapabilitiesGetter fordeadReckoningParametersintGetter forentityAppearanceGetter forentityIDGetter forentityLinearVelocityGetter forentityLocationGetter forentityOrientationGetter forentityTypeGetter forforceIdGetter formarkingMarking utility to get character values as a stringintReturns size of this serialized (marshalled) object in bytesGetter forvariableParametersinthashCode()voidmarshal(DataOutputStream dos) Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setAlternativeEntityType(EntityType pAlternativeEntityType) Setter foralternativeEntityTypesetCapabilities(EntityCapabilities pCapabilities) Setter forcapabilitiessetDeadReckoningParameters(DeadReckoningParameters pDeadReckoningParameters) Setter fordeadReckoningParameterssetEntityAppearance(int pEntityAppearance) Setter forentityAppearancesetEntityID(EntityID pEntityID) Setter forentityIDfinal EntityStatePdusetEntityLinearVelocity(float speed, EntityStatePdu.Direction direction) Utility method to set entity linear velocity using speed and directionsetEntityLinearVelocity(Vector3Float pEntityLinearVelocity) Setter forentityLinearVelocitysetEntityLocation(double x, double y, double z) Setter forentityLocationsetEntityLocation(Vector3Double pEntityLocation) Setter forentityLocationsetEntityOrientation(float phi, float theta, float psi) Setter forentityOrientationsetEntityOrientation(EulerAngles pEntityOrientation) Setter forentityOrientationsetEntityType(EntityType pEntityType) Setter forentityTypesetForceId(ForceID pForceId) Setter forforceIdsetMarking(EntityMarking pMarking) Setter formarkingsetMarking(String newMarking) Marking utility to set character values, 11 characters maximumsetVariableParameters(List<VariableParameter> pVariableParameters) Setter forvariableParameterstoString()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
-
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:
getMarshalledSizein interfaceMarshaller- Overrides:
getMarshalledSizein 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:
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
-
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
-