Teleporting dynamic prop in sleeping state

Hello,

I’m trying to teleport a dynamic actor, in sleeping state instantly as an optimisation.

It seems the teleport request awakes the actor and is ignoring the sleeping state request made just after the teleport.

I’m using this call to teleport the actor => SetActorTransform

then immediately call PutAllRigidBodiesToSleep to the root SM component.

Tracing the code a bit, everything is processed properly.

The SetActorTransform call will awake the body in UPrimitiveComponent::SendPhysicsTransform => BodyInstance.SetBodyTransform => FPhysicsInterface::SetGlobalPose_AssumesLocked

Notice that bAutoWake param is ignored and not forwarded to low level API.

I have tried to forward this into SetGlobalPose_AssumesLocked then Body_External.SetX/SetR API using bInvalidate param, but this is getting worse as the internal Chaos transform is not refreshed if the actor is already sleeping (I guess the bInvalidate is not only used for dynamic state, but also for refreshing some internal data).

PutAllRigidBodiesToSleep call will properly set the sleeping state on the actor game thread particle handle.

But, later on the body will be awake by internal Chaos island sleeping refresh, for unknown reason (I have been using hardware breakpoint to catch this, I could repro and give the full callstack if you need it)

You’ll probably get some insight and easy repro for this.

Hope you can help.

Cheers,

Hi Romain,

I could see some reasons why this could be implemented this way, but this could also be a quirk. If you are already in the code, can you see why the island code is waking it up? What condition is it breaking?

Geoff