![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NetworkPhysicsComponent.h>
Inheritance diagram for FNetworkPhysicsData:Public Attributes | |
| PRAGMA_ENABLE_DEPRECATION_WARNINGS TStrongObjectPtr< UActorComponent > | ImplementationComponent = nullptr |
| FNetworkPhysicsData * | DeltaSourceData = nullptr |
Public Attributes inherited from FNetworkPhysicsPayload | |
| int32 | ServerFrame = 0 |
| int32 | LocalFrame = 0 |
| bool | bDataAltered = false |
| bool | bReceivedData = false |
| bool | bImportant = false |
END Iris Compliant Data Base network physics data that will be used by physics
|
default |
|
virtualdefault |
|
default |
|
default |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
Define how to compare client and server data for the same frame, returning false means the data differ enough to trigger a resimulation.
| PredictedData | is data predicted on the client to compare with the current data received from the server. NOTE: To use this function, CVars np2.Resim.CompareStateToTriggerRewind and/or np2.Resim.CompareInputToTriggerRewind needs to be set to true or the equivalent settings overridden on the actor via UNetworkPhysicsSettingsComponent. |
|
inlineoverridevirtual |
Define how to compare client and server data for the same frame, returning false means the data differ enough to trigger a resimulation.
| PredictedData | is data predicted on the client to compare with the current data received from the server. NOTE: To use this function, CVars np2.Resim.CompareStateToTriggerRewind and/or np2.Resim.CompareInputToTriggerRewind needs to be set to true or the equivalent settings overridden on the actor via UNetworkPhysicsSettingsComponent. |
Reimplemented from FNetworkPhysicsPayload.
|
inlinevirtual |
Return string with custom debug data
Reimplemented from FNetworkPhysicsPayload.
Use to decay desired data during resimulation if data is forward predicted.
| DecayAmount | = Total amount of decay as a multiplier. 10% decay = 0.1. NOTE: Decay is not accumulated, the data will be in its original state each time DecayData is called. DecayAmount will increase each time the input is predicted (reused). EXAMPLE: Use to decay steering inputs to make resimulation not predict too much with a high steering value. Use DecayAmount of 0.1 to turn a steering value of 0.5 into 0.45 for example. |
Reimplemented from FNetworkPhysicsPayload.
|
inlineoverridevirtual |
Temporary virtual function for backwards compatibility with FNetworkPhysicsData.Use the InterpolateData function that passes the LerpAlpha instead
Reimplemented from FNetworkPhysicsPayload.
|
inlinevirtual |
Define how to interpolate between two data points if we have a gap between known data.
| MinData | is data from a previous frame. |
| MaxData | is data from a future frame. EXAMPLE: We have input data for frame 1 and 4 and we need to interpolate data for frame 2 and 3 based on frame 1 as MinData and frame 4 as MaxData. |
|
inlinevirtual |
Define how to interpolate between two data points if we have a gap between known data.
| MinData | is data from a previous frame. |
| MaxData | is data from a future frame. |
| LerpAlpha | is the 0.0 - 1.0 value of where this data is between MinData and MaxData calculated as so: float LerpAlpha = (LocalFrame - MinData.LocalFrame) / (MaxData.LocalFrame - MinData.LocalFrame) EXAMPLE: We have input data for frame 1 and 4 and we need to interpolate data for frame 2 and 3 based on frame 1 as MinData and frame 4 as MaxData, for frame 2 LerpAlpha will be 0.33 and for frame 3 LerpAlpha will be 0.66 |
Reimplemented from FNetworkPhysicsPayload.
|
inlinevirtual |
Define how to merge data together
| FromData | is data from a previous frame that is getting merged into the current data. EXAMPLE: Simulated proxies might receive two inputs at the same time after having used the same input twice, to not miss any important inputs we need to take both inputs into account and to not get behind in simulation we need to apply them both at the same simulation tick meaning we merge the two new inputs to one input. |
|
inlineoverridevirtual |
Define how to merge data together
| FromData | is data from a previous frame that is getting merged into the current data. EXAMPLE: Simulated proxies might receive two inputs at the same time after having used the same input twice, to not miss any important inputs we need to take both inputs into account and to not get behind in simulation we need to apply them both at the same simulation tick meaning we merge the two new inputs to one input. |
Reimplemented from FNetworkPhysicsPayload.
|
default |
|
default |
|
inline |
|
inline |
|
inline |
Set if this data is important(replicated reliably) or unimportant(replicated unreliably) NOTE: Default is to handle all inputs as unimportant, while one time events can be marked as important.
|
inlinevirtual |
Validate data received on the server from clients EXAMPLE: Validate incoming inputs from clients and correct any invalid input commands. NOTE: Changes to the data in this callback will be sent from server to clients.
| FNetworkPhysicsData* FNetworkPhysicsData::DeltaSourceData = nullptr |
Pointer to a previous FNetworkPhysicsData which is valid during NetSerialize() to be used for delta serialization
| PRAGMA_ENABLE_DEPRECATION_WARNINGS TStrongObjectPtr<UActorComponent> FNetworkPhysicsData::ImplementationComponent = nullptr |
Thread safe pointer to the UActorComponent that implements the derived type of this data Note: This pointer can be accessed on both Game Thread and Physics Thread but you still need to ensure the read and write calls inside the UActorComponent are thread safe.