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
});
}
}
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-176474 in the post.
| 0 |
| Component | UE - Simulation - Physics - Destruction |
|---|---|
| Affects Versions | 5.1 |
| Target Fix | 5.5 |
| Created | Feb 8, 2023 |
|---|---|
| Resolved | Sep 13, 2024 |
| Updated | Sep 13, 2024 |