Skip to content

DISSendComponent

huggins edited this page Apr 10, 2025 · 9 revisions

DIS Send Component

The DISSendComponent handles basic sending DIS functionality.
It should be attached to actors where sending DIS is desired.

By default the DISSendComponent offers automatic Entity State PDU sending
for the associated DIS Entity. Maintains a list of appropriate
DIS variables (such as Entity ID).

class UDISSendComponent
  : public UActorComponent

Includes

Back to Top


Members

Access Type Name Description
Public EDeadReckoningAlgorithm DeadReckoningAlgorithm The dead reckoning algorithm to use
Public float DeadReckoningOrientationThresholdDegrees If the dead reckoning orientation deviates more than this value away from the actual orientation, a new Entity State PDU will be sent
Public float DeadReckoningPositionThresholdMeters If the dead reckoning position deviates more than this value away from the actual position in any axis, a new Entity State PDU will be sent
Private double DeltaTimeSinceLastCalculationUpdate The time in seconds since the last linear velocity, linear acceleration, and angular velocity parameters were calculated.
Private double DeltaTimeSinceLastPDU The time in seconds since the last PDU was recieved for this entity
Private ADISGameManager* DISGameManager A reference to the DIS game manager
Public float DISHeartbeatSeconds How often an Entity State PDU should be sent out for this entity
Public int32 EntityAppearance Specifies the dynamic changes to the entities appearance attributes
Public EEntityCapabilities EntityCapabilities The DIS Capabilities that the entity should have
Public EForceID EntityForceID Specifies the team or side the DIS entity is on
Public int32 EntityID The Entity ID of the associated entity. Each Entity ID should be unique to an entity in the sim. The Site ID and Application ID will be retrieved from the DISGameManager
Public FString EntityMarking Designates a friendly name for the DIS entity
Public EEntityStateSendingMode EntityStatePDUSendingMode Dictates if none are sent, Entity State PDUs are sent, or Entity State Update PDUs are sent
Public FEntityType EntityType The Entity Type of the associated entity. Specifies the kind of entity, the country of design, the domain, the specific identification of the entity, and any extra information necessary for describing the entity.
Private AGeoReferencingSystem* GeoReferencingSystem A reference to Unreal Engine's GeoReferencing system
Private FVector LastCalculatedAngularVelocity The angluar velocity at the last calculation step
Private FVector LastCalculatedBodyLinearAcceleration The body linear acceleration at the last calculation step
Private FVector LastCalculatedBodyLinearVelocity The body linear velocity at the last calculation step
Private FVector LastCalculatedECEFLinearAcceleration The ECEF linear acceleration at the last calculation step
Private FVector LastCalculatedECEFLinearVelocity The ECEF linear velocity at the last calculation step
Private FVector LastCalculatedUnrealLinearVelocity The Unreal linear velocity at the last calculation step
Private FVector LastCalculatedUnrealLocation The Unreal location at the last calculation step
Private FRotator LastCalculatedUnrealRotation The Unreal rotation at the last calculation step
Public FEntityStatePDU MostRecentDeadReckonedEntityStatePDU The most recent Dead Reckoned Entity State PDU that has been calculated
Public FEntityStatePDU MostRecentEntityStatePDU The most recent Entity State PDU that has been received
Private UUDPSubSystem* UDPSubsystem A reference to the UDP subsystem

Back to Top


Constructors

Access Name Description
Public UDISSendComponent() Default constructor

Functions

Access Return Name Description
Protected virtual void BeginPlay() Called when the game starts
Public FVector CalculateAngularVelocity() Calculates the Angular Velocity of the entity that this component is attached to
Public void CalculateBodyLinearVelocityAndAcceleration(FVector AngularVelocity, FVector& BodyLinearVelocity, FVector& BodyLinearAcceleration) Calculates the Linear Velocity and Linear Acceleration of the entity that this component is attached to
Public void CalculateECEFLinearVelocityAndAcceleration(FVector& ECEFLinearVelocity, FVector& ECEFLinearAcceleration) Calculates the Linear Velocity and Linear Acceleration of the entity that this component is attached to
Public bool CheckDeadReckoningThresholds() Compares the current Dead Reckoning location/orientation to the actual location/orientation of the entity
Public bool CheckEcefPositionThreshold() Checks whether or not the ECEF position threshold between the actual position and Dead Reckoning position has been exceeded.
Public bool CheckOrientationMatrixThreshold() Checks whether or not the orientation threshold between the actual orientation and Dead Reckoning orientation has been exceeded
Public bool CheckOrientationQuaternionThreshold() Checks whether or not the orientation threshold between the actual orientation and Dead Reckoning orientation has been exceeded
Protected bool EmitAppropriatePDU(FEntityStatePDU pduToSend) Takes in an Entity State PDU and emits it as an Entity State or Entity State Update PDU
Protected virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) Overridable function called whenever this actor is being removed from a level
Public FEntityStatePDU FormEntityStatePDU() Forms an Entity State PDU based on current known information about the Entity
Public bool SendEntityStatePDU() Attempts to send an updated Entity State or Entity State Update PDU
Public void SetDeadReckoningAlgorithm(EDeadReckoningAlgorithm NewDeadReckoningAlgorithm) Updates the Dead Reckoning algorithm being used by the Send Component
Public void SetEntityAppearance(int32 NewEntityAppearance) Updates the appearance of the entity
Public void SetEntityCapabilities(EEntityCapabilities NewEntityCapabilities) Updates the Capabilities that the entity has
Public virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) Function called every frame on this ActorComponent
Protected void UpdateEntityStateCalculations() Updates last calculated linear velocity, linear acceleration, and angular velocity

Back to Top


Details

Dead Reckoning Algorithm

public EDeadReckoningAlgorithm DeadReckoningAlgorithm = EDeadReckoningAlgorithm::Static

The dead reckoning algorithm to use.

Category: GRILL DIS|DIS Send Component|DIS Settings

Back to Top


Dead Reckoning Orientation Threshold Degrees

public float DeadReckoningOrientationThresholdDegrees = 3

The orientation threshold to use for dead reckoning. If the dead reckoning orientation deviates more than this value away from the actual orientation, a new Entity State PDU will be sent.
This value should be in degrees.

Category: GRILL DIS|DIS Send Component|DIS Settings
Minimum Value: 0

Back to Top


Dead Reckoning Position Threshold Meters

public float DeadReckoningPositionThresholdMeters = 1

The position threshold to use for dead reckoning. If the dead reckoning position deviates more than this value away from the actual position in any axis, a new Entity State PDU will be sent.
This value should be in meters.

Category: GRILL DIS|DIS Send Component|DIS Settings
Minimum Value: 0

Back to Top


Delta Time Since Last Calculation Update

private double DeltaTimeSinceLastCalculationUpdate = 0

The time in seconds since the last linear velocity, linear acceleration, and angular velocity parameters were calculated.

Back to Top


Delta Time Since Last PDU

private double DeltaTimeSinceLastPDU = 0

The time in seconds since the last PDU was recieved for this entity.

Back to Top


DIS Game Manager

private ADISGameManager* DISGameManager

A reference to the DIS game manager.

Back to Top


DIS Heartbeat Seconds

public float DISHeartbeatSeconds = 5.0f

How often an Entity State PDU should be sent out for this entity.
Timer gets reset if an Entity State PDU gets sent out by this component by another means (ex: threshold clipping).

Category: GRILL DIS|DIS Send Component|DIS Settings
Minimum Value: 0

Back to Top


Entity Appearance

public int32 EntityAppearance = 0

Specifies the dynamic changes to the entities appearance attributes.

Category: GRILL DIS|DIS Send Component|DIS Settings
Minimum Value: 0

Back to Top


Entity Capabilities

public EEntityCapabilities EntityCapabilities = EEntityCapabilities::LandPlatformEntityCapabilities

The DIS Capabilities that the entity should have.

Category: GRILL DIS|DIS Send Component|DIS Settings

Back to Top


Entity Force ID

public EForceID EntityForceID

The Force ID of the associated entity. Specifies the team or side the DIS entity is on.

Category: GRILL DIS|DIS Send Component|DIS Info

Back to Top


Entity ID

public int32 EntityID

The Entity ID of the associated entity. Each Entity ID should be unique to an entity in the sim. The Site ID and Application ID will be retrieved from the DISGameManager

Category: GRILL DIS|DIS Send Component|DIS Info

Back to Top


Entity Marking

public FString EntityMarking

The Entity Marking of the associated entity. Designates a friendly name for the DIS entity.
Max of 11 characters should be used. If more than 11 are used, it will be truncated.

Category: GRILL DIS|DIS Send Component|DIS Info

Back to Top


Entity State PDU Sending Mode

public EEntityStateSendingMode EntityStatePDUSendingMode

The sending mode that this entity should use for Entity State PDUs.
Dictates if none are sent, Entity State PDUs are sent, or Entity State Update PDUs are sent.
Distribution of Entity State PDUs are handled internally by the DIS Component via the overridable "SendEntityStatePDU" function.

Category: GRILL DIS|DIS Send Component|DIS Settings

Back to Top


Entity Type

public FEntityType EntityType

The Entity Type of the associated entity. Specifies the kind of entity, the country of design,
the domain, the specific identification of the entity, and any extra information necessary for describing the entity.

Category: GRILL DIS|DIS Send Component|DIS Info

Back to Top


Geo Referencing System

private AGeoReferencingSystem* GeoReferencingSystem

A reference to Unreal Engine's GeoReferencing system.

Back to Top


Last Calculated Angular Velocity

private FVector LastCalculatedAngularVelocity

The angluar velocity at the last calculation step.

Back to Top


Last Calculated Body Linear Acceleration

private FVector LastCalculatedBodyLinearAcceleration

The body linear acceleration at the last calculation step.

Back to Top


Last Calculated Body Linear Velocity

private FVector LastCalculatedBodyLinearVelocity

The body linear velocity at the last calculation step.

Back to Top


Last Calculated ECEF Linear Acceleration

private FVector LastCalculatedECEFLinearAcceleration

The ECEF linear acceleration at the last calculation step.

Back to Top


Last Calculated ECEF Linear Velocity

private FVector LastCalculatedECEFLinearVelocity

The ECEF linear velocity at the last calculation step.

Back to Top


Last Calculated Unreal Linear Velocity

private FVector LastCalculatedUnrealLinearVelocity

The Unreal linear velocity at the last calculation step.

Back to Top


Last Calculated Unreal Location

private FVector LastCalculatedUnrealLocation

The Unreal location at the last calculation step.

Back to Top


Last Calculated Unreal Rotation

private FRotator LastCalculatedUnrealRotation

The Unreal rotation at the last calculation step.

Back to Top


Most Recent Dead Reckoned Entity State PDU

public FEntityStatePDU MostRecentDeadReckonedEntityStatePDU

The most recent Dead Reckoned Entity State PDU that has been calculated.

Category: GRILL DIS|DIS Receive Component|DIS Info

Back to Top


Most Recent Entity State PDU

public FEntityStatePDU MostRecentEntityStatePDU

The most recent Entity State PDU that has been received.

Category: GRILL DIS|DIS Receive Component|DIS Info

Back to Top


UDP Subsystem

private UUDPSubsystem* UDPSubsystem

A reference to the UDP subsystem.

Back to Top


UDISSendCompontent

public UDISSendComponent()

Default constructor.

Back to Top


Begin Play

virtual void BeginPlay() override

Called when the game starts.

Back to Top


Calculate Angular Velocity

public FVector CalculateAngularVelocity()

Calculates the Angular Velocity of the entity that this component is attached to.

Category: GRILL DIS|DIS Send Component

Returns
An FVector containing the angular velocity in radians per second.

Back to Top


Calculate Body Linear Velocity And Acceleration

public void CalculateBodyLinearVelocityAndAcceleration
(
  FVector AngularVelocity,
  FVector& BodyLinearVelocity,
  FVector& BodyLinearAcceleration
)

Calculates the Linear Velocity and Linear Acceleration of the entity that this component is attached to. Calculates them in terms of entity body coordinates.

Category: GRILL DIS|DIS Send Component

Parameter Description
AngularVelocity The current angular velocity of the entity
BodyLinearVelocity The linear velocity of the entity in Body coordinates
BodyLinearAcceleration The linear acceleration of the entity in Body coordinates

Back to Top


Calculate ECEF Linear Velocity And Acceleration

public void CalculateECEFLinearVelocityAndAcceleration
(
  FVector& ECEFLinearVelocity,
  FVector& ECEFLinearAcceleration
)

Calculates the Linear Velocity and Linear Acceleration of the entity that this component is attached to. Calculates them in terms of ECEF coordinates.

Category: GRILL DIS|DIS Send Component

Parameter Description
ECEFLinearVelocity The linear velocity of the entity in ECEF coordinates
ECEFLinearAcceleration The linear acceleration of the entity in ECEF coordinates

Back to Top


Check Dead Reckoning Thresholds

public bool CheckDeadReckoningThreshold()

Compares the current Dead Reckoning location/orientation to the actual location/orientation of the entity.

Category: GRILL DIS|DIS Send Component

Returns
True if the comparison is outside of the Dead Reckoning thresholds

Back to Top


Check Ecef Position Threshold

public bool CheckEcefPositionThreshold()

Checks whether or not the ECEF position threshold between the actual position and Dead Reckoning position has been exceeded.

Category: GRILL DIS|DIS Send Component

Returns
True if the comparison is outside of the position threshold

Back to Top


Check Orientation Matrix Threshold

public bool CheckOrientationMatrixThreshold()

Checks whether or not the orientation threshold between the actual orientation and Dead Reckoning orientation has been exceeded. Utilizes matrices to calculate it.

Category: GRILL DIS|DIS Send Component

Returns
True if the comparison is outside of the orientation threshold

Back to Top


Check Orientation Quaternion Threshold

public bool CheckOrientationQuaternionThreshold()

Checks whether or not the orientation threshold between the actual orientation and Dead Reckoning orientation has been exceeded. Utilizes quaternions to calculate it.

Category: GRILL DIS|DIS Send Component

Returns
True if the comparison is outside of the orientation threshold

Back to Top


Emit Appropriate PDU

protected bool EmitAppropriatePDU
(
  FEntityStatePDU pduToSend
)

Takes in an Entity State PDU and emits it as an Entity State or Entity State Update PDU. Decides based on what EntityStatePDUSendingMode is set to.

Parameter Description
pduToSend The Entity State PDU to emit
Returns
True if packets were sent correctly

Back to Top


End Play

protected virtual void EndPlay
(
  const EEndPlayReason::Type EndPlayReason
) override

Overridable function called whenever this actor is being removed from a level.

Parameter Description
EndPlayReason

Back to Top


Form Entity State PDU

public FEntityStatePDU FormEntityStatePDU()

Forms an Entity State PDU based on current known information about the Entity.

Category: GRILL DIS|DIS Send Component

Returns
The Entity State PDU that was formed

Back to Top


Send Entity State PDU

public bool SendEntityStatePDU()

Attempts to send an updated Entity State or Entity State Update PDU. Checks Dead Reckoning threshold prior to sending.

Category: GRILL DIS|DIS Send Component

Returns
True if an entity state PDU or entity state update PDU was sent

Back to Top


Set Dead Reckoning Algorithm

public void SetDeadReckoningAlgorithm
(
  EDeadReckoningAlgorithm NewDeadReckoningAlgorithm
)

Updates the Dead Reckoning algorithm being used by the Send Component.

Category: GRILL DIS|DIS Send Component

Parameter Description
NewDeadReckoningAlgorithm The new dead reckoning algorithm to use

Back to Top


Set Entity Appearance

public void SetEntityAppearance
(
  int32 NewEntityAppearance
)

Updates the appearance of the entity.

Category: GRILL DIS|DIS Send Component

Parameter Description
NewEntityAppearance The new appearance that the entity has

Back to Top


Set Entity Capabilities

public void SetEntityCapabilities
(
  EEntityCapabilities NewEntityCapabilities
)

Updates the Capabilities that the entity has.

Parameter Description
NewEntityCapabilities The new DIS capabilities that the entity has

Back to Top


Tick Component

public virtual void TickComponent
(
  float DeltaTime,
  ELevelTick TickType,
  FActorComponentTickFunction* ThisTickFunction
) override

Function called every frame on this ActorComponent.

See Unreal Engine|TickComponent for more information.

Parameter Description
DeltaTime The time since the last tick
TickType The kind of tick this is, for example, are we paused, or 'simulating' in the editor
ThisTickFunction Internal tick function struct that caused this to run

Back to Top


Update Entity State Calculations

protected void UpdateEntityStateCalculations()

Updates last calculated linear velocity, linear acceleration, and angular velocity.

Back to Top


Clone this wiki locally