c-frame / aframe-physics-system

community-maintained fork of n5ro's aframe-physics-system
https://c-frame.github.io/aframe-physics-system/
MIT License
43 stars 11 forks source link

Do not destroy bodyTransform #46

Closed Elettrotecnica closed 1 year ago

Elettrotecnica commented 1 year ago

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

I also attach a toy example where I continuously toggle a constraint between an object and the camera and a screenshot of the error.

Error Screenshot toy-example.zip

diarmidmackenzie commented 1 year ago

Yes, agreed. Thank you for the fix.