Description

Non-clustered geometry collections applied RemoveAllAnchors are not put into FPBDRigidsSOAs::DynamicGeometryCollectionArray, so acceleration is not reset every tick and they fall super fast.
The following workarounds will work.

void FGeometryCollectionPhysicsProxy::RemoveAllAnchors_External()
{
	check(IsInGameThread());

	if (Chaos::FPhysicsSolver* RBDSolver = GetSolver<Chaos::FPhysicsSolver>())
	{
		RBDSolver->EnqueueCommandImmediate([this, RBDSolver]()
			{
				Chaos::FPBDRigidsEvolution* Evolution = RBDSolver->GetEvolution();

				// disable anchoring where relevant and collect the nodes to update
				Chaos::FKinematicTarget NoKinematicTarget;
				for (FClusterHandle* ParticleHandle : GetSolverParticleHandles())
				{
					if (ParticleHandle)
					{
						ParticleHandle->SetIsAnchored(false);
						if (!ParticleHandle->IsDynamic())
						{
							Evolution->SetParticleObjectState(ParticleHandle, Chaos::EObjectStateType::Dynamic);
							Evolution->SetParticleKinematicTarget(ParticleHandle, NoKinematicTarget);
						}
					}
				}
				Evolution->GetParticles().UpdateGeometryCollectionViews(); //workaround
			});
	}
}
Steps to Reproduce
  1. Open attached project on ue5.1 [Link Removed]
  2. Start PIE
  3. After 2 seconds, RemoveAllAnchors is applied to the left cube and it falls extremely fast.

 

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-176474 in the post.

0
Login to Vote

Cannot Reproduce
ComponentUE - Simulation - Physics - Destruction
Affects Versions5.1
Target Fix5.5
CreatedFeb 8, 2023
ResolvedSep 13, 2024
UpdatedSep 13, 2024
View Jira Issue