object: Unmark body as dirty when destroyed
Fixes some crashes since this was introduced.
This commit is contained in:
parent
954d301a2b
commit
6767ca8f32
|
@ -68,6 +68,8 @@ JoltPhysicsObject::~JoltPhysicsObject()
|
||||||
for ( int i = m_destroyedListeners.Count() - 1; i >= 0; i-- )
|
for ( int i = m_destroyedListeners.Count() - 1; i >= 0; i-- )
|
||||||
m_destroyedListeners[ i ]->OnJoltPhysicsObjectDestroyed( this );
|
m_destroyedListeners[ i ]->OnJoltPhysicsObjectDestroyed( this );
|
||||||
|
|
||||||
|
m_pEnvironment->RemoveDirtyStaticBody( GetBodyID() );
|
||||||
|
|
||||||
JPH::BodyInterface& bodyInterface = m_pPhysicsSystem->GetBodyInterfaceNoLock();
|
JPH::BodyInterface& bodyInterface = m_pPhysicsSystem->GetBodyInterfaceNoLock();
|
||||||
bodyInterface.DestroyBody( GetBodyID() );
|
bodyInterface.DestroyBody( GetBodyID() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue