Body *BodyManager::RemoveBodyInternal(const BodyID &inBodyID)
{
// Get body
uint32 idx = inBodyID.GetIndex();
Body *body = mBodies[idx];
// Validate that it can be removed
JPH_ASSERT(body->GetID() == inBodyID);
JPH_ASSERT(!body->IsActive());
JPH_ASSERT(!body->IsInBroadPhase());
// Push the id onto the freelist
mBodies[idx] = (Body *)mBodyIDFreeListStart;
mBodyIDFreeListStart = (uintptr_t(idx) << cFreedBodyIndexShift) | cIsFreedBody;
return body;
}
Describe the bug | Bug描述 在实现运行时切换Level的功能时,尝试重新加载Level时,会报错退出
每次运行都会卡在JoltPhysics的这个函数中,
JPH_ASSERT(!body->IsInBroadPhase());
,导致无法重新加载Level