From f51aec93e015bbe8bac4be0190eff62711beee27 Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 10 Oct 2023 00:07:12 +0200 Subject: [PATCH] Do not destroy bodyTransform, as this is in fact the btTranform returned 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 --- src/components/ammo-constraint.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ammo-constraint.js b/src/components/ammo-constraint.js index b1d68a2..87a5f68 100644 --- a/src/components/ammo-constraint.js +++ b/src/components/ammo-constraint.js @@ -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;