Hi,
I’m trying to make a mouse picker for my scene called Ammo_Ragdoll
. You can find it in the project here:
https://playcanvas.com/project/998667
My code is in scripts/ammo/ammoJointPicker.js
What I thought would work was:
var pickPos = rayCallback.get_m_hitPointWorld();
var localPivot = body.getCenterOfMassTransform().inverse().op_mul(pickPos);
var p2p = new Ammo.btPoint2PointConstraint(body,localPivot);
this.dynamicsWorld.addConstraint(p2p);
Bot the pivot position on the joint is incorrect, im sure the error is in this code because if I set localPivot to 0,0,0 it seems to work fine.
Hope someone can point me in the right direction!
Best,
Erik