-
Notifications
You must be signed in to change notification settings - Fork 20
DISSendComponent
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- CoreMinimal
- TimerManager.h
- DISEnumsAndStructs.h
- PDUMasterInclude.h
- UDPSubsystem.h
- Components/ActorComponent.h
| 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 |
| Access | Name | Description |
|---|---|---|
| Public | UDISSendComponent() | Default constructor |
| 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 |
public EDeadReckoningAlgorithm DeadReckoningAlgorithm = EDeadReckoningAlgorithm::StaticThe dead reckoning algorithm to use.
Category: GRILL DIS|DIS Send Component|DIS Settings
public float DeadReckoningOrientationThresholdDegrees = 3The 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
public float DeadReckoningPositionThresholdMeters = 1The 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
private double DeltaTimeSinceLastCalculationUpdate = 0The time in seconds since the last linear velocity, linear acceleration, and angular velocity parameters were calculated.
private double DeltaTimeSinceLastPDU = 0The time in seconds since the last PDU was recieved for this entity.
private ADISGameManager* DISGameManagerA reference to the DIS game manager.
public float DISHeartbeatSeconds = 5.0fHow 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
public int32 EntityAppearance = 0Specifies the dynamic changes to the entities appearance attributes.
Category: GRILL DIS|DIS Send Component|DIS Settings
Minimum Value: 0
public EEntityCapabilities EntityCapabilities = EEntityCapabilities::LandPlatformEntityCapabilitiesThe DIS Capabilities that the entity should have.
Category: GRILL DIS|DIS Send Component|DIS Settings
public EForceID EntityForceIDThe Force ID of the associated entity. Specifies the team or side the DIS entity is on.
Category: GRILL DIS|DIS Send Component|DIS Info
public int32 EntityIDThe 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
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 Send Component|DIS Info
public EEntityStateSendingMode EntityStatePDUSendingModeThe 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
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 Send Component|DIS Info
private AGeoReferencingSystem* GeoReferencingSystemA reference to Unreal Engine's GeoReferencing system.
private FVector LastCalculatedAngularVelocityThe angluar velocity at the last calculation step.
private FVector LastCalculatedBodyLinearAccelerationThe body linear acceleration at the last calculation step.
private FVector LastCalculatedBodyLinearVelocityThe body linear velocity at the last calculation step.
private FVector LastCalculatedECEFLinearAccelerationThe ECEF linear acceleration at the last calculation step.
private FVector LastCalculatedECEFLinearVelocityThe ECEF linear velocity at the last calculation step.
private FVector LastCalculatedUnrealLinearVelocityThe Unreal linear velocity at the last calculation step.
private FVector LastCalculatedUnrealLocationThe Unreal location at the last calculation step.
private FRotator LastCalculatedUnrealRotationThe Unreal rotation at the last calculation step.
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 UUDPSubsystem* UDPSubsystemA reference to the UDP subsystem.
public UDISSendComponent()Default constructor.
virtual void BeginPlay() overrideCalled when the game starts.
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
protected virtual void EndPlay
(
const EEndPlayReason::Type EndPlayReason
) overrideOverridable function called whenever this actor is being removed from a level.
| Parameter | Description |
|---|---|
| EndPlayReason |
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 |
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 |
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 |
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 |
public void SetEntityCapabilities
(
EEntityCapabilities NewEntityCapabilities
)Updates the Capabilities that the entity has.
| Parameter | Description |
|---|---|
| NewEntityCapabilities | The new DIS capabilities that the entity has |
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 |
protected void UpdateEntityStateCalculations()Updates last calculated linear velocity, linear acceleration, and angular velocity.