Charles wrote:But i have an question here: How can i rotate the handle around the axis of itself, say the z axis of the handle? Each time i try to do that, the handle always rotate about the world axis not axis of itself. And i tried many ways but the result are all the same.
I said I have not done that yet, I will add a test later today.
but the way to go about is that you use a joint to fix the root body in place.
the closer stock joint I can think of would be the corkscrew.
this joint has one degree of longitudinal translation and one degree of axial rotation.
but most likely this will not be enough so the best is to make a custom joint the allow three degrees of translation and one or two degrees or rotation.
this free dof are a dry friction, by the I mean you apply a motion and when the motion is stronger than the dry friction the root body moves, but as soon as you let go is stops because of the high dry friction.
then is just a matter of applying the desire linear an angular impulse to the root body you move anyway you want.
I will make the joint in the demo, and will add some kind of control so that you see how I do it and you can go from there.
one of the feature of newton is that is easy to make these kind of custom functionality,
plus the plugin design let the end user extended and expose the functionality they want.
it is not a one fix all solution.
In that regard, if you look at the demo, to get a quick result I used a stock ball and socket joint and
relaxed the cone stiffness. This makes the joint somewhat elastic but is also make it too plastic.
this is because when a link violates the cone limit, zero in this case, it tries to recover at a constant velocity. this is by design in newton.
you probably noticed this when the Cather twist and get entangled that is difficult to get it untangled.
in your case you probably want a link to be more elastic, so that when you twist the root node, it is capable is transmit the angular rotation a easier.
given the difficult of the problem, with any other engine you would probably live with that and did not even noticed the problem, but this is Newton we can do better than that.
for that we can make the cone a legitimate spring damper, with a low coefficient of drag.
if you did not get what I was trying to explain, do not worry, just wait until I add it all together, then you can add it to your plugin.