Skip to content

Commit

Permalink
Do not destroy bodyTransform, as this is in fact the btTranform retur…
Browse files Browse the repository at this point in the history
…ned by .getCenterOfMassTransform, that is, protected member m_worldTransform of the btCollisionObject class and not an object instantiated locally

Deleting this object will eventually lead to an out of bound access error that will prevent any further constraint

See https://pybullet.org/Bullet/BulletFull/classbtRigidBody.html#a5eaee89e89e7498cfb39709e58fdc477
  • Loading branch information
Elettrotecnica committed Oct 9, 2023
1 parent ea1630d commit f51aec9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/ammo-constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ module.exports = AFRAME.registerComponent("ammo-constraint", {
throw new Error("[constraint] Unexpected type: " + data.type);
}

Ammo.destroy(bodyTransform);
Ammo.destroy(targetTransform);

return constraint;
Expand Down

0 comments on commit f51aec9

Please # to comment.