I'd like to use limits on a dCustomBallAndSocket Joint. Here I limited the twist angle only. It's difficult to see but it works . The twist angle (vertical axis) is bounded between -30° and +30° as desired and the other angles are free:
Here I also limited the cone angle to 30°:
But it behaves like the cone angle were limited to 0°. I mean, only the twist dof is free.
Here is close to what I expected, setting the stiffness to 0.999:
But it's not very clean as sometimes it gets stuck at mid-flexion and sometimes not. with lower stiffness values, the pinpoint can move too so the joint is loose, with higher values the cone angles keep frozen.
Last edited by blackbird_dream on Sun Nov 22, 2020 7:37 pm, edited 1 time in total.
what do you mean ? Yes I can run the sandbox demos. But these are other demos built with the sdk. I don't know if this answers your question I can send you the files if you want.
what I mean is that you are are doing is complex. and is hard to work with just pieces of code here and there. most demos in the demos sand box start by some user trying something they want to do and I make a black demo where stuff can be added and after that is easier to make repro for particular test cases.
I am trying to remedy that by adding xml serialization but that's only for the new version of newton which is not has nay joints yet.
Here I duplicated my demo in the sandbox collection. I modified FlatLandGame demo (2 methods changed only. AttachLimbBody & AddRagdollBodies) to model the 2 bodies connected with eachother by means of a dCustomBallAndSocket with angle limits of 30°. Only the twistlimits are active. The other axes are frozen.
// constrain these object to motion on the plane only dMatrix matrix; NewtonBodyGetMatrix(rootBody, &matrix[0][0]); // new dCustomPlane(matrix.m_posit, matrix.m_front, rootBody);
// now make some limb body and attach them to the root body // AttachLimbBody (scene, matrix.m_right.Scale ( 1.0f), rootBody); AttachLimbBody(scene, matrix.m_right.Scale(-1.0f), rootBody, 1.f); // AttachLimbBody(scene, matrix.m_right.Scale(-1.0f), rootBody, 0.01f);
ok I added a new demo BlackbirdDreamTest and pasted the tow method that you added, and cleanup of the other stuff. I think It play like is the video. after you get it and see if I what you did, tell me what it is you seek?
Perfect. That's it. As you can see the horizontal box can rotate along one axis only (the vertical axis) although it should rotate along the 3 axis. I set the 2 other axis with:
oh, I see. there was bug there, whe the control axis is with is a very small limit the the joint threat the angles as cartesian values, because small angles commute and use Euler decomposition lead to weak joint. this is the case when teh joint lock some angles.
but there was a bug the the Cartesian cone angles projection were check against the small value but never again the actual cone angle. adding the check fixes the bug.