FCustomPhysXSyncActors::BuildSyncData_AssumesLocked

Syncing between PhysX and UE4 can be tricky.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/CustomPhysXPayload.h

Include

#include "CustomPhysXPayload.h"

Syntax

void BuildSyncData_AssumesLocked
(
    const TArray< physx::PxRigidActor * > & RigidActors
)

Remarks

Syncing between PhysX and UE4 can be tricky. The challenge is that PhysX gives us an array of raw pointers that require updating. However, UE4 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 UE4 safe structures (see TWeakObjectPtr). The second step updates the actual UE4 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 callbackThis is step 1 of the sync. Do not store any raw PhysX data or update any UE4 component/actors which may trigger a callback. Ideally this should build an array of TWeakObjectPtr, Transform pairs

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback