Skip to content

DISReceiveComponent

jhuggins0214 edited this page Aug 24, 2023 · 6 revisions

DIS Receive Component

The DISReceiveComponent handles basic receiving DIS functionality.
It should be attached to actors where receiving DIS is desired.

By default the DISReceiveComponent offers packet handling for the associated DIS entity,
basic dead reckoning, basic ground clamping, and maintains a living list of appropriate
DIS variables (such as Entity ID).

class UDISReceiveComponent
  : public UActorComponent

Includes

Back to Top


Members

Access Type Name Description
Public float DeadReckoningSmoothingPeriodSeconds Number of seconds to smooth between dead reckoned information and packet information if dead reckoning is enabled
Private float DeltaTimeSinceLastPDU The time in seconds since the last PDU was received
Public float DISCullingDistance The distance in Unreal units from the camera that culling should begin happening
Public EDISCullingMode DISCullingMode Determines what all DIS info should be culled
Public float DISTimeoutSeconds The time to live for the entity. Gets reset every time a new Entity State PDU is received by the sim
Private TArray<double> EntityECEFLocationDifference The difference between the entity's current and previous ECEF locations
Public EForceID EntityForceID The Force ID of the associated entity. Specifies the team or side the DIS entity is on
Public FEntityID EntityID A unique identifier to this entity in the sim.
Public FString EntityMarking A friendly name for the DIS entity
Private FRotator EntityRotationDifference The difference between the entity's current and previous rotations
Public FEntityType EntityType 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 the Unreal Engine georeferencing system
Public TEnumAsByte<ETraceTypeQuery> GroundClampingCollisionChannel The collision channel to use for ground clamping
Public FDateTime LatestEntityStatePDUTimestamp The timestamp that the most recent Entity State PDU was received at by the DISComponent
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 int NumberEntityStatePDUsReceived The number of entity state pdus that have been received for this entity
Public bool PerformDeadReckoning Whether or not dead reckoning should be performed for this entity
Public bool PerformDeadReckoningSmoothing Whether or not dead reckoning should be locally smoothed for this entity
Public EGroundClampingMode PerformGroundClamping Determines how this entity should be ground clamped
Public bool SpawnedFromNetwork Whether or not the associated entity was spawned by the network or not

Back to Top


Events

Delegate Name Event Name Description
FDeadReckoningUpdate OnDeadReckoningUpdate(FEntityStatePDU DeadReckonedEntityStatePDU) Passes out an Entity State PDU with updated dead reckoning variables as a parameter
FGroundClampingUpdate OnGroundClampingUpdate(TArray<FTransform> ClampTransforms) Passes ground clamp transforms (if clamping multiple points) as a parameter
FReceivedDetonationPDU OnReceivedDetonationPDU(FDetonationPDU DetonationPDU) Passes the Detonation PDU that was received as a parameter
FReceivedEntityStatePDU OnReceivedEntityStatePDU(FEntityStatePDU EntityStatePDU) Passes the Entity State PDU that was received as a parameter
FReceivedEntityStateUpdatePDU OnReceivedEntityStateUpdatePDU(FEntityStateUpdatePDU EntityStateUpdatePDU) Called after an Entity State Update PDU is received by the component
FReceivedFirePDU OnReceivedFirePDU(FFirePDU FirePDU) Called after a Fire PDU is received by the component
FReceivedRemoveEntityPDU OnReceivedRemoveEntityPDU([FRemoveEntityPDU] RemoveEntityPDU) Called after a Remove Entity PDU is received by the component
FReceivedStartResumePDU OnReceivedStartResumePDU(FStartResumePDU StartResumePDU) Called after a Start/Resume PDU is received by the component
FReceivedStopFreezePDU OnReceivedStopFreezePDU(FStopFreezePDU StopFreezePDU) Called after a Stop/Freeze PDU is received by the component

Constructors

Access Name Description
Public UDISReceiveComponent() Default constructor

Functions

Access Return Name Description
Protected virtual void BeginPlay() Called when the game starts
Public void DoDeadReckoning(float DeltaTime) Calculates the dead reckoned PDU with given time DeltaTime
Public bool GroundClamping() Clamps an entity to the ground
Private virtual bool GroundClamping_Implementation() Clamps an entity to the ground
Public void HandleDetonationPDU(FDetonationPDU DetonationPDUIn) Handles receipt of a new detonation PDU
Public void HandleEntityStatePDU(FEntityStatePDU NewEntityStatePDU) Handles receipt of a new entity state PDU
Public void HandleEntityStateUpdatePDU(FEntityStatePDU NewEntityStateUpdatePDU) Handles receipt of a new entity state update PDU
Public void HandleFirePDU(FFirePDU FirePDUIn) Handles receipt of a new fire PDU
Public void HandleRemoveEntityPDU(FRemoveEntityPDU RemoveEntityPDUIn) Handles receipt of a new remove entity PDU
Public void HandleStartResumePDU(FStartResumePDU StartResumePDUIn) Handles receipt of a new start resume PDU
Public void HandleStopFreezePDU(FStopFreezePDU StopFreezePDUIn) Handles receipt of a new stop freeze PDU
Public virutal void InitializeComponent() Initializes the component
Private FEntityStatePDU SmoothDeadReckoning(FEntityStatePDU DeadReckonPDUToSmooth) Smooths the dead reckoned PDUs over a set time frame
Public virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) Function called every frame on this ActorComponent
Private void UpdateCommoneEntityStateInfo(FEntityStatePDU NewEntityStatePDU) Updates information from an entity state PDU to this actor

Back to Top


Details

Dead Reckoning Smoothing Period Seconds

public float DeadReckoningSmoothingPeriodSeconds = 0.5f

Number of seconds to smooth between dead reckoned information and packet information if dead reckoning is enabled.

Category: GRILL DIS|DIS Receive Component|DIS Settings
Edit Condition: PerformDeadReckoning && PerformDeadReckoningSmoothing

Back to Top


Delta Time Since Last PDU

private float DeltaTimeSinceLastPDU = 0

The time in seconds since the last PDU was received.

Back to Top


DIS Culling Distance

public float DISCullingDistance = 0.0f

The distance in Unreal units from the camera that culling should begin happening.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


DIS Culling Mode

EDISCullingMode DISCullingMode = EDISCullingMode::None

Determines what all DIS info should be culled. Allows for updates to happen less frequently for entities that aren't currently important.
The distance that culling should happen is handled by the DISCullingDistance variable.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


DIS Timeout Seconds

public float DISTimeoutSeconds = 30.0f

The time to live for the entity. Gets reset every time a new Entity State PDU is received by the sim.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


Entity ECEF Location Difference

private TArray<double> EntityECEFLocationDifference

The difference between the entity's current and previous ECEF locations.

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 Receive Component|DIS Info

Back to Top


Entity ID

public FEntityID EntityID

The Entity ID of the associated entity. Each Entity ID should be unique to an entity in the sim.

Category: GRILL DIS|DIS Receive 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 Receive Component|DIS Info

Back to Top


Entity Rotation Difference

private FRotator EntityRotationDifference

The difference between the entity's current and previous rotations.

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 Receive Component|DIS Info

Back to Top


Geo Referencing System

private AGeoReferencingSystem* GeoReferencingSystem

A reference to the Unreal Engine georeferencing system.

Back to Top


Ground Clamping Collision Channel

public TEnumAsByte<ETraceTypeQuery> GoundClampingCollisionChannel = UEngineTypes::ConvertToTraceType(ECollisionChannel::ECC_Visibility)

The collision channel to use for ground clamping.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


Latest Entity State PDU Timestamp

public FDateTime LatestEntityStatePDUTimestamp

The timestamp that the most recent Entity State PDU was received at by the DISComponent.

Category: GRILL DIS|DIS Receive Component|DIS Info

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


Number Entity State PDUs Received

private int NumberEntityStatePDUsReceived = 0

The number of entity state pdus that have been received for this entity.

Back to Top


Perform Dead Reckoning

public bool PerformDeadReckoning = true

Whether or not dead reckoning should be performed for this entity.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


Perform DeadReckoning Smoothing

public bool PerformDeadReckoningSmoothing = true

Whether or not dead reckoning should be locally smoothed for this entity.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Edit Condition: PerformDeadReckoning

Back to Top


Perform Ground Clamping

public EGroundClampingMode PerformGroundClamping = EGroundClampingMode::GroundClampWithDISOptions

Determines how this entity should be ground clamped.

Category: GRILL DIS|DIS Receive Component|DIS Settings

Back to Top


Spawned From Network

public bool SpawnedFromNetwork = false

Whether or not the associated entity was spawned by the network or not.

Category: GRILL DIS|DIS Receive Component|DIS Info

Back to Top


On Dead Reckoning Update

public FDeadReckoningUpdate OnDeadReckoningUpdate

Called after a dead reckoning update is performed by the component.
Passes out an Entity State PDU with updated dead reckoning variables as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Ground Clamping Update

public FGroundClampingUpdate OnGroundClampingUpdate

Called after Ground Clamping is performed by the component.
Passes ground clamp transforms (if clamping multiple points) as a parameter.

NOTE: Gets called after receiving Entity State PDUs or finishing Dead Reckoning Updates if Ground Clamping is enabled on the DISComponent.
Respective Entity State and Dead Reckoning events are called first. Implementing Ground Clamping location updates on top of these event may cause jitter in actor location.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Detonation PDU

public FReceivedDetonationPDU OnReceivedDetonationPDU

Called after a Detonation PDU is received by the component.
Passes the Detonation PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Entity State PDU

public FReceivedEntityStatePDU OnReceivedEntityStatePDU

Called after an Entity State PDU is received by the component. The component updates associated variables prior to broadcasting this event.
Passes the Entity State PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Entity State Update PDU

public FReceivedEntityStateUpdatePDU OnReceivedEntityStateUpdatePDU

Called after an Entity State Update PDU is received by the component. The component updates associated variables prior to broadcasting this event.
Passes the Entity State Update PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Fire PDU

public FReceivedFirePDU OnReceivedFirePDU

Called after a Fire PDU is received by the component.
Passes the Fire PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Remove Entity PDU

public FReceivedRemoveEntityPDU OnReceivedRemoveEntityPDU

Called after a Remove Entity PDU is received by the component.
Passes the Remove Entity PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Start Resume PDU

public FReceivedStartResumePDU OnReceivedStartResumePDU

Called after a Start/Resume PDU is received by the component.
Passes the Start/Resume PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


On Received Stop Freeze PDU

public FReceivedStopFreezePDU OnReceivedStopFreezePDU

Called after a Stop/Freeze PDU is received by the component.
Passes the Stop/Freeze PDU that was received as a parameter.

Category: GRILL DIS|DIS Receive Component|Event

Back to Top


UDISReceiveComponent

public UDISReceiveComponent()

Default constructor.

Back to Top


Begin Play

virtual void BeginPlay() override

Called when the game starts.

Back to Top


Do Dead Reckoning

public void DoDeadReckoning
(
  float DeltaTime
)

Calculates the dead reckoned PDU with given time DeltaTime.

Parameter Description
DeltaTime The time since the last tick

Back to Top


Ground Clamping

public bool GroundClamping()

Clamps an entity to the ground. Should call OnGroundClampingUpdate event when finished.

Category: GRILL DIS|DIS Receive Component

Returns
True if ground clamping was attempted, false otherwise.

Back to Top


Ground Clamping_Implementation

private virtual bool GroundClamping_Implementation()

Clamps an entity to the ground. Verifies that the entity is of ground domain, is not a munition, and is owned by a different sim prior to clamping.
Calls OnGroundClampingUpdate event when finished.

Returns
True if ground clamping was attempted, false otherwise.

Back to Top


Handle Detonation PDU

public void HandleDetonationPDU
(
  FDetonationPDU DetonationPDUIn
)

Handles receipt of a new detonation PDU.

Parameter Description
DetonationPDUIn The detonation PDU being handled

Back to Top


Handle Entity State PDU

public void HandleEntityStatePDU
(
  FEntityStatePDU NewEntityStatePDU
)

Handles receipt of a new entity state PDU.

Parameter Description
NewEntityStatePDU The entity state PDU being handled

Back to Top


Handle Entity State Update PDU

public void HandleEntityStateUpdatePDU
(
  FEntityStateUpdatePDU NewEntityStateUpdatePDU
)

Handles receipt of a new entity state update PDU.

Parameter Description
NewEntityStateUpdatePDU The entity state update PDU being handled

Back to Top


Handle Fire PDU

public void HandleFirePDU
(
  FFirePDU FirePDUIn
)

Handles receipt of a new fire PDU.

Parameter Description
FirePDUIn The fire PDU being handled

Back to Top


Handle Remove Entity PDU

public void HandleRemoveEntityPDU
(
  FRemoveEntityPDU RemoveEntityPDUIn
)

Handles receipt of a new remove entity PDU.

Parameter Description
RemoveEntityPDUIn The remove entity PDU being handled

Back to Top


Handle Start Resume PDU

public void HandleStartResumePDU
(
  FStartResumePDU StartResumePDUIn
)

Handles receipt of a new start resume PDU.

Parameter Description
StartResumePDUIn The start/resume PDU being handled

Back to Top


Handle Stop Freeze PDU

public void HandleStopFreezePDU
(
  FStopFreezePDU StopFreezePDUIn
)

Handles receipt of a new stop freeze PDU.

Parameter Description
StopFreezePDUIn The stop/freeze PDU being handled

Back to Top


Initialize Component

public virtual void InitializeComponent() override

Initializes the component.

See Unreal Enigine Docs|Initialize Component for more information.

Back to Top


Smooth Dead Reckoning

private FEntityStatePDU SmoothDeadReckoning
(
  FEntityStatePDU DeadReckonPDUToSmooth
)

Smooths the dead reckoned PDUs over a set time frame.

Parameter Description
DeadReckonPDUToSmooth The dead reckoning pdu to use for this smoothing

|Returns| |A new entity state PDU to use with smoothed values|

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 Common Entity State Info

private void UpdateCommonEntityStateInfo
(
  FEntityStatePDU NewEntityStatePDU
)

Updates information from an entity state PDU to this actor.

Parameter Description
NewEntityStatePDU The entity state PDU being handled

Back to Top


Clone this wiki locally