-
Notifications
You must be signed in to change notification settings - Fork 20
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 | bool | ApplyToOwner | To automatically apply entity states to the owner actor. | |
| 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 | FVector | 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 | FTimestamp | 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 |
| FReceivedDesignatorPDU | OnReceivedDesignatorPDU(FDesignatorPDU DesignatorPDU) | Passes the Designator PDU that was received as a parameter |
| FReceivedDetonationPDU | OnReceivedDetonationPDU(FDetonationPDU DetonationPDU) | Passes the Detonation PDU that was received as a parameter |
| FReceivedElectromagneticEmissionsPDU | OnReceivedElectromagneticEmissionsPDU(FElectromagneticEmissionsPDU ElectromagneticEmissionsPDU) | Passes the Electromagnetic Emissions 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 | |
|---|---|---|---|---|
| Private | void | ApplyToOwnerIfActivated(FEntityStatePDU const& StatePDU) | Applies the location and rotation to the given Entity State PDU to the owning actor | |
| 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 | HandleDesignatorPDU(FDesignatorPDU DesignatorPDUIn) | Handles receipt of a new designator PDU | |
| Public | void | HandleDetonationPDU(FDetonationPDU DetonationPDUIn) | Handles receipt of a new detonation PDU | |
| Public | void | HandleElectromagneticEmissionsPDU(FElectromagneticEmissionsPDU ElectromagneticEmissionsPDUIn) | Handles receipt of a new electromagnetic emissions 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 bool ApplyToOwner = falseTo automatically apply entity states to the owner actor.
Category: GRILL DIS|DIS Receive Component|DIS Settings
public float DeadReckoningSmoothingPeriodSeconds = 0.5fNumber 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 = 0The time in seconds since the last PDU was received.
public float DISCullingDistance = 0.0fThe distance in Unreal units from the camera that culling should begin happening.
Category: GRILL DIS|DIS Receive Component|DIS Settings
EDISCullingMode DISCullingMode = EDISCullingMode::NoneDetermines 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.0fThe 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
FVector EntityECEFLocationDifferenceThe difference between the entity's current and previous ECEF locations.
public EForceID EntityForceIDThe 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 EntityIDThe 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 EntityMarkingThe 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 EntityRotationDifferenceThe difference between the entity's current and previous rotations.
public FEntityType EntityTypeThe 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* GeoReferencingSystemA 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 LatestEntityStatePDUTimestampThe timestamp that the most recent Entity State PDU was received at by the DISComponent.
Category: GRILL DIS|DIS Receive Component|DIS Info
public FEntityStatePDU MostRecentDeadReckonedEntityStatePDUThe most recent Dead Reckoned Entity State PDU that has been calculated.
Category: GRILL DIS|DIS Receive Component|DIS Info
public FEntityStatePDU MostRecentEntityStatePDUThe most recent Entity State PDU that has been received.
Category: GRILL DIS|DIS Receive Component|DIS Info
private int NumberEntityStatePDUsReceived = 0The number of entity state pdus that have been received for this entity.
public bool PerformDeadReckoning = trueWhether or not dead reckoning should be performed for this entity.
Category: GRILL DIS|DIS Receive Component|DIS Settings
public bool PerformDeadReckoningSmoothing = trueWhether 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::GroundClampWithDISOptionsDetermines how this entity should be ground clamped.
Category: GRILL DIS|DIS Receive Component|DIS Settings
public bool SpawnedFromNetwork = falseWhether or not the associated entity was spawned by the network or not.
Category: GRILL DIS|DIS Receive Component|DIS Info
public FDeadReckoningUpdate OnDeadReckoningUpdateCalled 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 OnGroundClampingUpdateCalled 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 FReceivedDesignatorPDU OnReceivedDesignatorPDUCalled after a Designator PDU is received by the component.
Passes the Designator PDU that was received as a parameter.
Category: GRILL DIS|DIS Receive Component|Event
public FReceivedDetonationPDU OnReceivedDetonationPDUCalled 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 FReceivedElectromagneticEmissionsPDU OnReceivedElectromagneticEmissionsPDUCalled after a ElectromagneticEmissions PDU is received by the component. Passes the ElectromagneticEmissions PDU that was received as a parameter.
Category: GRILL DIS|DIS Receive Component|Event
public FReceivedEntityStatePDU OnReceivedEntityStatePDUCalled 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 OnReceivedEntityStateUpdatePDUCalled 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 OnReceivedFirePDUCalled 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 OnReceivedRemoveEntityPDUCalled 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 OnReceivedStartResumePDUCalled 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 OnReceivedStopFreezePDUCalled 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.
private void ApplyToOwnerIfActivated
(
FEntityStatePDU const& StatePDU
)Applies the location and rotation to the given Entity State PDU to the owning actor.
| Parameter | Description |
|---|---|
| StatePDU | The Entity State PDU that contains the location and rotation to apply to the owning actor. |
virtual void BeginPlay() overrideCalled 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 HandleDesignatorPDU
(
FDesignatorPDU DesignatorPDUIn
)Handles receipt of a new designator PDU.
| Parameter | Description |
|---|---|
| DesignatorPDUIn | The designator PDU being handled |
public void HandleDetonationPDU
(
FDetonationPDU DetonationPDUIn
)Handles receipt of a new detonation PDU.
| Parameter | Description |
|---|---|
| DetonationPDUIn | The detonation PDU being handled |
void HandleElectromagneticEmissionsPDU
(
FElectromagneticEmissionsPDU ElectromagneticEmissionsPDUIn
)Handles receipt of a new electromagnetic emissions PDU.
| Parameter | Description |
|---|---|
| ElectromagneticEmissionsPDUIn | The electromagnetic emissions 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() overrideInitializes 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
) overrideFunction 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 |