dispose physics on remove

This commit is contained in:
Evert Prants 2023-06-25 18:18:33 +03:00
parent 6510a493a0
commit 20acbbecaa
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -88,6 +88,10 @@ export class PhysicsService {
root.traverse((object) => { root.traverse((object) => {
if (trackedObjects.some((item) => item.uuid === object.uuid)) { if (trackedObjects.some((item) => item.uuid === object.uuid)) {
physicsLeaveUUIDs.push(object.uuid); physicsLeaveUUIDs.push(object.uuid);
if ((object as PhysicsObject).dispose) {
(object as PhysicsObject).dispose();
}
} }
}); });