Fixed bug with multiple collider removals
This commit is contained in:
parent
4f28161e45
commit
12758878c5
|
@ -575,7 +575,9 @@ namespace SHADE
|
|||
if (REMOVED_ID == COLLIDER_ID)
|
||||
{
|
||||
// Remove all colliders
|
||||
for (uint32_t i = 0; i < physicsObject->rp3dBody->getNbColliders(); ++i)
|
||||
const int NUM_COLLIDERS = static_cast<int>(physicsObject->rp3dBody->getNbColliders());
|
||||
|
||||
for (int i = NUM_COLLIDERS - 1; i >= 0; --i)
|
||||
{
|
||||
auto* collider = physicsObject->rp3dBody->getCollider(i);
|
||||
physicsObject->rp3dBody->removeCollider(collider);
|
||||
|
|
Loading…
Reference in New Issue