-
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
| 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* | GeoReferenceingSystem | 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 |
| Name | Description | |
|---|---|---|
| Public | UDISReceiveComponent() | Default constructor |
| 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 | void | GroundClamping() | Clamps an entity to the ground | |
| Private | virtual | void | 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.5fCategory: GRILL DIS|DIS Receive Component|DIS Settings
Edit Condition: PerformDeadReckoning && PerformDeadReckoningSmoothing
Number of seconds to smooth between dead reckoned information and packet information if dead reckoning is enabled.
private float DeltaTimeSinceLastPDU = 0The time in seconds since the last PDU was received.
public float DISCullingDistance = 0.0fCategory: GRILL DIS|DIS Receive Component|DIS Settings
The distance in Unreal units from the camera that culling should begin happening.
EDISCullingMode DISCullingMode = EDISCullingMode::NoneCategory: GRILL DIS|DIS Receive Component|DIS Settings
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.
public float DISTimeoutSeconds = 30.0fCategory: GRILL DIS|DIS Receive Component|DIS Settings
The time to live for the entity. Gets reset every time a new Entity State PDU is received by the sim.
private TArray<double> EntityECEFLocationDifferenceThe difference between the entity's current and previous ECEF locations.
public EForceID EntityForceIDCategory: GRILL DIS|DIS Receive Component|DIS Info
The Force ID of the associated entity. Specifies the team or side the DIS entity is on.
public FEntityID EntityIDCategory: GRILL DIS|DIS Receive Component|DIS Info
The Entity ID of the associated entity. Each Entity ID should be unique to an entity in the sim.
public FString EntityMarkingCategory: GRILL DIS|DIS Receive Component|DIS Info
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.
private FRotator EntityRotationDifferenceThe difference between the entity's current and previous rotations.
public FEntityType EntityTypeCategory: GRILL DIS|DIS Receive Component|DIS Info
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* GeoReferencingSystemA reference to the Unreal Engine georeferencing system.
public TEnumAsByte<ETraceTypeQuery> GoundClampingCollisionChannel = UEngineTypes::ConvertToTraceType(ECollisionChannel::ECC_Visibility)Category: GRILL DIS|DIS Receive Component|DIS Settings
The collision channel to use for ground clamping.
public FDateTime LatestEntityStatePDUTimestampCategory: GRILL DIS|DIS Receive Component|DIS Info
The timestamp that the most recent Entity State PDU was received at by the DISComponent.
public FEntityStatePDU MostRecentDeadReckonedEntityStatePDUCategory: GRILL DIS|DIS Receive Component|DIS Info
The most recent Dead Reckoned Entity State PDU that has been calculated.
public FEntityStatePDU MostRecentEntityStatePDUCategory: GRILL DIS|DIS Receive Component|DIS Info
The most recent Entity State PDU that has been received.
private int NumberEntityStatePDUsReceived = 0The number of entity state pdus that have been received for this entity.
public bool PerformDeadReckoning = trueCategory: GRILL DIS|DIS Receive Component|DIS Settings
Whether or not dead reckoning should be performed for this entity.
public bool PerformDeadReckoningSmoothing = trueCategory: GRILL DIS|DIS Receive Component|DIS Settings
Edit Condition: PerformDeadReckoning
Whether or not dead reckoning should be locally smoothed for this entity.
public EGroundClampingMode PerformGroundClamping = EGroundClampingMode::GroundClampWithDISOptionsCategory: GRILL DIS|DIS Receive Component|DIS Settings
Determines how this entity should be ground clamped.
public bool SpawnedFromNetwork = falseCategory: GRILL DIS|DIS Receive Component|DIS Info
Whether or not the associated entity was spawned by the network or not.
public FDeadReckoningUpdate OnDeadReckoningUpdateCategory: GRILL DIS|DIS Receive Component|Event
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.
public FGroundClampingUpdate OnGroundClampingUpdateCategory: GRILL DIS|DIS Receive Component|Event
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.
public FReceivedDetonationPDU OnReceivedDetonationPDUCategory: GRILL DIS|DIS Receive Component|Event
Called after a Detonation PDU is received by the component.
Passes the Detonation PDU that was received as a parameter.
public FReceivedEntityStatePDU OnReceivedEntityStatePDUCategory: GRILL DIS|DIS Receive Component|Event
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.
public FReceivedEntityStateUpdatePDU OnReceivedEntityStateUpdatePDUCategory: GRILL DIS|DIS Receive Component|Event
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.
public FReceivedFirePDU OnReceivedFirePDUCategory: GRILL DIS|DIS Receive Component|Event
Called after a Fire PDU is received by the component.
Passes the Fire PDU that was received as a parameter.
public FReceivedRemoveEntityPDU OnReceivedRemoveEntityPDUCategory: GRILL DIS|DIS Receive Component|Event
Called after a Remove Entity PDU is received by the component.
Passes the Remove Entity PDU that was received as a parameter.
public FReceivedStartResumePDU OnReceivedStartResumePDUCategory: GRILL DIS|DIS Receive Component|Event
Called after a Start/Resume PDU is received by the component.
Passes the Start/Resume PDU that was received as a parameter.
public FReceivedStopFreezePDU OnReceivedStopFreezePDUCategory: GRILL DIS|DIS Receive Component|Event
Called after a Stop/Freeze PDU is received by the component.
Passes the Stop/Freeze PDU that was received as a parameter.
public UDISReceiveComponent()Default constructor.
virtual void BeginPlay() overrideCalled when the game starts.
public DoDeadReckoning
(
float DeltaTime
)Calculates the dead reckoned PDU with given time DeltaTime.
| Parameter | Description |
|---|---|
| DeltaTime | The time since the last tick |
public void GroundClamping()Category: GRILL DIS|DIS Receive Component
Clamps an entity to the ground. Should call OnGroundClampingUpdate event when finished.
private virtual void 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.
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() 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.