Hello,
I am not able to understand how does parameters in raAFrame,rbBFrame are used in creating the btHingeConstraint.
btHingeConstraint(btRigidBody& rbA,
btRigidBody& rbB,
const btTransform& rbAFrame,
const btTransform& rbBFrame,
bool useReferenceFrameA = false)
Especially I am struck with understanding of "raAFrame.getBasis().setEulerZYX(XX , XX, XX) "
Also the name is showing as "setEulerZYX()" but the actual code is taking it as "X Y Z" parameters - This is also confusing.
What does setting the Euler's angles means in the context of rigidBody,btTransform and btHingeConstraint ??
To be precise I am refering to ForkLiftDemo example.
Any help is much appreciated.
raAFrame,rbBFrame in btHingeConstraint ?
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: raAFrame,rbBFrame in btHingeConstraint ?
Constraints are defined by local axis locations rather than world definitions when using those frames, so a pair with world coordinates of 0,0,0 and 2,0,0 and joint directly in the center will have local coordinates of 1,0,0 and -1,0,0. Since a hinge is defined with rotation in positive Z axis direction, the joint orientation needs to also match that. Changing frames lets you make joints with initial angle values if you define a rotation about Z for one of the two. Take a look at ODE's documentation for a bit more in-depth explanation on the subject of joint constraints.
As for EulerZYX taking X,Y,Z, yes, it's confusing as hell and the source of plenty of bugs!
As for EulerZYX taking X,Y,Z, yes, it's confusing as hell and the source of plenty of bugs!
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: raAFrame,rbBFrame in btHingeConstraint ?
A btTypedConstraint attaches two bodies, body A and body B. The attachment frame is expressed in local coordinate of each body, hence the name rbAframe and rbBframe.
If your application uses Euler angles, convert them yourself to a quaternion or 3x3 matrix and pass that to Bullet.
I should never have introduced or accepted patches to add the option for Euler angle conversion in Bullet,
it is better to only use quaternion and matrices. It is probably best to remove all Euler parts from the API in a future update.
It is best to avoid any Euler APIs in Bullet, just use a btQuaternion or a btMatrix3x3 directly.Basroil wrote: As for EulerZYX taking X,Y,Z, yes, it's confusing as hell and the source of plenty of bugs!
If your application uses Euler angles, convert them yourself to a quaternion or 3x3 matrix and pass that to Bullet.
I should never have introduced or accepted patches to add the option for Euler angle conversion in Bullet,
it is better to only use quaternion and matrices. It is probably best to remove all Euler parts from the API in a future update.
-
- Posts: 7
- Joined: Wed May 13, 2015 10:57 am
Re: raAFrame,rbBFrame in btHingeConstraint ?
Thanks much for your explanation and reply !!!!
Now i am struct at a problem. I did success in simulating a sliderConstraint by reading values from another application.
Now the situation is - I will get slider joint movements in terms of distance moved, i.e. in millimeters.
Am not able find a solution.
Can you give your thoughts and possible solutions for do this.
Best Regards
Now i am struct at a problem. I did success in simulating a sliderConstraint by reading values from another application.
Now the situation is - I will get slider joint movements in terms of distance moved, i.e. in millimeters.
Am not able find a solution.
Can you give your thoughts and possible solutions for do this.
Best Regards