Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Physics
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UNetworkPhysicsComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Public/Physics/NetworkPhysicsComponent.h |
| Include | #include "Physics/NetworkPhysicsComponent.h" |
Syntax
UCLASS (BlueprintType, MinimalAPI)
class UNetworkPhysicsComponent : public UActorComponent
Remarks
Network physics component to add to actors or pawns that control their physic simulation through applying inputs, and should support networking through physics resimulation.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FNetworkPhysicsRewindDataImportantInputProxy | ReplicatedImportantInput | Replicated important physics input | |
| FNetworkPhysicsRewindDataImportantStateProxy | ReplicatedImportantState | Replicated important physics state | |
| FNetworkPhysicsRewindDataInputProxy | ReplicatedInputs | Replicated physics inputs | |
| FNetworkPhysicsRewindDataStateProxy | ReplicatedStates | Replicated physics states |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UNetworkPhysicsComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Add state/input history to rewind data. | ||
| void | |||
| void | CorrectServerToLocalOffset
(
const int32 LocalToServerOffset |
Correct the player controller Server to local offset based on the received replicated states | |
| void | CreateDataHistory
(
UActorComponent* HistoryComponent |
Register and create both state and input to be both networked and cached in history | |
| void | CreateDatasHistory
(
UActorComponent* HistoryComponent |
DEPRECATED UE 5.4 | |
| void | CreateInputHistory
(
UActorComponent* HistoryComponent |
Register and create input history Please use CreateDataHistory() if both input and custom state are supposed to be networked and cached in history. | |
| const float | GetCurrentInputDecay
(
FNetworkPhysicsData* PhysicsData |
Returns the current amount of input decay during resimulation as a magnitude from 0.0 to 1.0. | |
| TSharedPtr< Chaos::FBaseRewindHistory > & | |||
| TSharedPtr< Chaos::FBaseRewindHistory > & | Get the GameThread input history (not guaranteed to be the exact data used in physics, for that use GetInputHistory_Internal on PhysicsThread) | ||
| TSharedPtr< Chaos::FBaseRewindHistory > & | Get the PhysicsThread input history (if there is none it returns the GameThread history) | ||
| TSharedPtr< Chaos::FBaseRewindHistory > & | |||
| const bool | Check if this is controlled locally through relayed inputs from autonomous proxy. | ||
| FAsyncNetworkPhysicsComponent * | Get FAsyncNetworkPhysicsComponent on the Physics Thread | ||
| APlayerController * | Get the player controller. | ||
| TSharedPtr< Chaos::FBaseRewindHistory > & | |||
| TSharedPtr< Chaos::FBaseRewindHistory > & | Get the GameThread state history (not guaranteed to be the exact data used in physics, for that use GetStateHistory_Internal on PhysicsThread) | ||
| TSharedPtr< Chaos::FBaseRewindHistory > & | Get the PhysicsThread state history (if there is none it returns the GameThread history) | ||
| TSharedPtr< Chaos::FBaseRewindHistory > & | |||
| bool | Check if the player controller exists and is local | ||
| bool | Check if the world is on server. | ||
| void | InitPhysics () |
Init the network physics component. | |
| bool | Check if this is controlled locally through relayed inputs or an existing local player controller. | ||
| void | MulticastReceiveImportantInputData
(
const FNetworkPhysicsRewindDataImportantInputProxy& ServerInputs |
Client RPC to receive important inputs from server. | |
| void | MulticastReceiveImportantStateData
(
const FNetworkPhysicsRewindDataImportantStateProxy& ServerStates |
Client RPC to receive important states from server. | |
| void | OnPostProcessInputsInternal
(
const int32 PhysicsStep |
Delegate linked to the physics rewind callback to send record local inputs/states | |
| void | OnPreProcessInputsInternal
(
const int32 PhysicsStep |
Delegate linked to the physics rewind callback to send record local inputs/states | |
| void | Repnotify for the inputs on the client | ||
| void | Repnotify for the states on the client | ||
| void | Remove state/input history from rewind data. | ||
| void | |||
| void | Replicate input data | ||
| void | |||
| void | |||
| void | Replicate state data | ||
| void | ServerReceiveImportantInputData
(
const FNetworkPhysicsRewindDataImportantInputProxy& ClientInputs |
Server RPC to receive important inputs from client. | |
| void | ServerReceiveInputData
(
const FNetworkPhysicsRewindDataInputProxy& ClientInputs |
Server RPC to receive inputs from client. | |
| void | ServerReceiveInputsDatas
(
const FNetworkPhysicsRewindDataInputProxy& ClientInputs |
-- Deprecated API -- | |
| void | SetIsRelayingLocalInputs
(
bool bInRelayingLocalInputs |
Mark this as controlled through locally relayed inputs rather than controlled as a pawn through a player controller. | |
| int32 | Enable RewindData history caching and return the history size | ||
| void | Stop relaying local inputs after next network send. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | BeginPlay () |
Used to create any physics engine information for this component. | |
| void | Register the component into the network manager. | ||
| void | TickComponent
(
float DeltaTime, |
Called every frame. | |
| void | Unregister the component from the network manager. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifeTimeProps |
Function to init the replicated properties. |