Hinge Joint Limits

Post Reply
RedLagger
Posts: 4
Joined: Wed Mar 23, 2016 1:56 pm

Hinge Joint Limits

Post by RedLagger »

Hi everyone.

First I would like to just thank the Bullet SDK team for making an awesome product, and keeping it free :)

I would like to make a simple door using a hinge joint that rotates on the Y axis. The joint would only have 1 rigid body (the door rigid body), so it would be attached to the "world" and not another rigid body object. The specific issue I have is that when I specify the limits of rotation on the hinge joint, I'm not sure what these angles are relative to, so I would like to know where the "zero" degree rotation is. From playing around with the door in the constraints example, it looks like Zero degrees is always pointing along the specified "axisInA" X axis. But I have only determined this from the empirical evidence, would be nice to get a confirmation on this since I didn't see it in the documentation. I am using Bullet version 2.83.4.

Thanks for your help!
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Hinge Joint Limits

Post by Basroil »

An easy way to think of hinges are two separate axis definitions in local coordinates, one in the first body, second in another body (or world). The x-y plane of those two axes when viewed in the world frame is always the same, but the plane is rotated about z by some theta. Zero is when the two axis definitions result in a theta of zero, meaning if you define the two axes with rotation when you make the joint, they won't be a zero. If you want it to rotate in a different direction, simply redefine the axis definitions to include a rotation from the standard axis to one of the others (if you had x and want y, rotate both definitions about their origins in the z direction by 90 degrees)
RedLagger
Posts: 4
Joined: Wed Mar 23, 2016 1:56 pm

Re: Hinge Joint Limits

Post by RedLagger »

Thanks Basroil, that helps clear things up. One point of confusion for me was that Blender wasn't allowing the hinge to rotate at all, because I did not have the joint linked to another object. I was assuming that Blender would treat the joint as being linked to the world if you left the "Target" field blank, but it does not, you have to link it to a static rigid body and then it behaves properly as if it was linked to the world.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Hinge Joint Limits

Post by Basroil »

RedLagger wrote:Thanks Basroil, that helps clear things up. One point of confusion for me was that Blender wasn't allowing the hinge to rotate at all, because I did not have the joint linked to another object. I was assuming that Blender would treat the joint as being linked to the world if you left the "Target" field blank, but it does not, you have to link it to a static rigid body and then it behaves properly as if it was linked to the world.
Yea, blender is horrible and the leads actually have no idea how to use it. Hell, they tried to enable slow motion by just stepping every frame without ERP correction and ended up with some ridiculous scenarios like a wall that suddenly becomes infinitely strong or a batter that sends things flying at the speed of light!
Post Reply