Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/FCustomPhysXSyncActors
Description
Syncing between PhysX and Unreal Engine can be tricky. The challenge is that PhysX gives us an array of raw pointers that require updating. However, Unreal Engine has many mechanisms for triggering arbitrary callbacks. Since the callbacks can invalidate the PhysX data it's critical to break the update into two steps. The first step moves the data from PhysX into Unreal Engine safe structures (see TWeakObjectPtr). The second step updates the actual Unreal Engine data (components, actors, etc...) It's up to the client code to ensure this is handled correctly. No PhysX raw data should be stored. Do not update component/actor data in step 1 unless you're absolutely sure it will not trigger a callback This is step 1 of the sync. Do not store any raw PhysX data or update any Unreal Engine component/actors which may trigger a callback. Ideally this should build an array of TWeakObjectPtr
| Name | BuildSyncData_AssumesLocked |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Public/CustomPhysXPayload.h |
| Include Path | #include "CustomPhysXPayload.h" |
void BuildSyncData_AssumesLocked
(
const TArray < physx::PxRigidActor * > & RigidActors
)