Skip to content

Commit

Permalink
Revert previous fixes from c-frame#47 c-frame#52 and c-frame#54, as t…
Browse files Browse the repository at this point in the history
…he previous commit should make them not necessary anymore
  • Loading branch information
Antonio Pisano committed Dec 28, 2023
1 parent a9fc4e2 commit 18b0e69
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/components/body/ammo-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,24 +364,15 @@ let AmmoBody = {
if (this.triMesh) Ammo.destroy(this.triMesh);
if (this.localScaling) Ammo.destroy(this.localScaling);
if (this.compoundShape) Ammo.destroy(this.compoundShape);
if (this.body) {
Ammo.destroy(this.body);
delete this.body;
}
Ammo.destroy(this.rbInfo);
Ammo.destroy(this.msTransform);
Ammo.destroy(this.motionState);
Ammo.destroy(this.localInertia);
Ammo.destroy(this.rotation);
if (this.body) {
if (!this.data.emitCollisionEvents) {
// As per issue 47 / PR 48 there is a strange bug
// not yet understood, where destroying an Ammo body
// leads to subsequent issues reporting collision events.
//
// So if we are reporting collision events, preferable to
// tolerate a small memory leak, by not destroying the
// Ammo body, rather than missing collision events.
Ammo.destroy(this.body);
}
delete this.body;
}
},

beforeStep: function() {
Expand Down

0 comments on commit 18b0e69

Please # to comment.