-
Notifications
You must be signed in to change notification settings - Fork 16
DISReceiveComponent
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
- CoreMinimal
- Components/ActorComponent.h
- DISEnumsAndStructs.h
- PDUMasterInclude.h
- GeoReferencingSystem.h
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 |
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 |
Access | Name | Description |
---|---|---|
Public | UDISReceiveComponent() | Default constructor |
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 |
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
private float DeltaTimeSinceLastPDU = 0
The time in seconds since the last PDU was received.
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
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
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
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.
Category: GRILL DIS|DIS Receive Component|DIS Info
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
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
private FRotator EntityRotationDifference
The difference between the entity's current and previous rotations.
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
private AGeoReferencingSystem* GeoReferencingSystem
A reference to the Unreal Engine georeferencing system.
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
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
public FEntityStatePDU MostRecentDeadReckonedEntityStatePDU
The most recent Dead Reckoned Entity State PDU that has been calculated.
Category: GRILL DIS|DIS Receive Component|DIS Info
public FEntityStatePDU MostRecentEntityStatePDU
The most recent Entity State PDU that has been received.
Category: GRILL DIS|DIS Receive Component|DIS Info
private int NumberEntityStatePDUsReceived = 0
The number of entity state pdus that have been received for this entity.
public bool PerformDeadReckoning = true
Whether or not dead reckoning should be performed for this entity.
Category: GRILL DIS|DIS Receive Component|DIS Settings
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
public EGroundClampingMode PerformGroundClamping = EGroundClampingMode::GroundClampWithDISOptions
Determines how this entity should be ground clamped.
Category: GRILL DIS|DIS Receive Component|DIS Settings
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
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
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
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
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
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
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
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
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
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
public UDISReceiveComponent()
Default constructor.
virtual void BeginPlay() override
Called when the game starts.
public void DoDeadReckoning
(
float DeltaTime
)
Calculates the dead reckoned PDU with given time DeltaTime.
Parameter | Description |
---|---|
DeltaTime | The time since the last tick |
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. |
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. |
public void HandleDetonationPDU
(
FDetonationPDU DetonationPDUIn
)
Handles receipt of a new detonation PDU.
Parameter | Description |
---|---|
DetonationPDUIn | The detonation PDU being handled |
public void HandleEntityStatePDU
(
FEntityStatePDU NewEntityStatePDU
)
Handles receipt of a new entity state PDU.
Parameter | Description |
---|---|
NewEntityStatePDU | The entity state PDU being handled |
public void HandleEntityStateUpdatePDU
(
FEntityStateUpdatePDU NewEntityStateUpdatePDU
)
Handles receipt of a new entity state update PDU.
Parameter | Description |
---|---|
NewEntityStateUpdatePDU | The entity state update PDU being handled |
public void HandleFirePDU
(
FFirePDU FirePDUIn
)
Handles receipt of a new fire PDU.
Parameter | Description |
---|---|
FirePDUIn | The fire PDU being handled |
public void HandleRemoveEntityPDU
(
FRemoveEntityPDU RemoveEntityPDUIn
)
Handles receipt of a new remove entity PDU.
Parameter | Description |
---|---|
RemoveEntityPDUIn | The remove entity PDU being handled |
public void HandleStartResumePDU
(
FStartResumePDU StartResumePDUIn
)
Handles receipt of a new start resume PDU.
Parameter | Description |
---|---|
StartResumePDUIn | The start/resume PDU being handled |
public void HandleStopFreezePDU
(
FStopFreezePDU StopFreezePDUIn
)
Handles receipt of a new stop freeze PDU.
Parameter | Description |
---|---|
StopFreezePDUIn | The stop/freeze PDU being handled |
public virtual void InitializeComponent() override
Initializes the component.
See Unreal Enigine Docs|Initialize Component for more information.
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|
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 |
private void UpdateCommonEntityStateInfo
(
FEntityStatePDU NewEntityStatePDU
)
Updates information from an entity state PDU to this actor.
Parameter | Description |
---|---|
NewEntityStatePDU | The entity state PDU being handled |