![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NetworkPhysicsComponent.h>
Inheritance diagram for FNetworkPhysicsPayload:Public Member Functions | |
| virtual | ~FNetworkPhysicsPayload () |
| virtual void | InterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData, float LerpAlpha) |
| virtual void | MergeData (const FNetworkPhysicsPayload &FromData) |
| virtual void | DecayData (float DecayAmount) |
| virtual bool | CompareData (const FNetworkPhysicsPayload &PredictedData) const |
| virtual const FString | DebugData () |
| virtual const FString | DebugData () const |
| void | PrepareFrame (int32 CurrentFrame, bool bIsServer, int32 ClientFrameOffset) |
| virtual void | DoInterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData) |
Public Attributes | |
| int32 | ServerFrame = 0 |
| int32 | LocalFrame = 0 |
| bool | bDataAltered = false |
| bool | bReceivedData = false |
| bool | bImportant = false |
START Iris Compliant Data
|
inlinevirtual |
|
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. |
Reimplemented in FNetworkPhysicsData.
|
inlinevirtual |
Return string with custom debug data
Reimplemented in FNetworkPhysicsData.
|
inlinevirtual |
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 in FNetworkPhysicsData.
|
inlinevirtual |
Temporary virtual function for backwards compatibility with FNetworkPhysicsData.Use the InterpolateData function that passes the LerpAlpha instead
Reimplemented in FNetworkPhysicsData.
|
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 in FNetworkPhysicsData.
|
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. |
Reimplemented in FNetworkPhysicsData.
|
inline |
|
mutable |
| int32 FNetworkPhysicsPayload::ServerFrame = 0 |