Strange behaviour of btSliderConstraint in Bullet 2.76

marcimatz
Posts: 34
Joined: Fri Sep 18, 2009 5:41 am

Strange behaviour of btSliderConstraint in Bullet 2.76

Post by marcimatz »

Hello,

I am not sure if this was meant, but since Bullet 2.76, the btSliderConstraint moves along the NEGATIVE x-axis (was the POSITIVE x-axis in Bullet 2.75). I corrected for that by adjusting the frames that I feed to Bullet, but I am now wondering if this change was meant or accidental?
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by rponomarev »

Hello,

This "feature" could be introduced in r1832, committed on Nov 25, 2009
Did you use earlier version of 2.75?
Could you send me the code snippet where you define the slider?

Thanks,
Roman
marcimatz
Posts: 34
Joined: Fri Sep 18, 2009 5:41 am

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by marcimatz »

Thanks roman,

Yes, the 2.75 version I used was released on the 17th of September 2009.
Here my code for the slider:

btSliderConstraint* slider;

btTransform jtrA;
jtrA.setOrigin(btVector3(jtrRelToBodyA.X(0),jtrRelToBodyA.X(1),jtrRelToBodyA.X(2)));
jtrA.setRotation(btQuaternion(jtrRelToBodyA.Q(1),jtrRelToBodyA.Q(2),jtrRelToBodyA.Q(3),jtrRelToBodyA.Q(0)));

btTransform jtrB;
jtrB.setOrigin(btVector3(jtrRelToBodyB.X(0),jtrRelToBodyB.X(1),jtrRelToBodyB.X(2)));
jtrB.setRotation(btQuaternion(jtrRelToBodyB.Q(1),jtrRelToBodyB.Q(2),jtrRelToBodyB.Q(3),jtrRelToBodyB.Q(0)));

slider=new btSliderConstraint(*parentBody->getBtRigidBody(),*childBody->getBtRigidBody(),jtrA,jtrB,false);
_constraint=slider;
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by rponomarev »

Hello,

This bug should be fixed as of r1958, Feb 03, 2010

Thanks for pointing on that,
Roman
marcimatz
Posts: 34
Joined: Fri Sep 18, 2009 5:41 am

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by marcimatz »

Hello Roman,

Actually I realized that since version 2.76, there is a define as following for btSliderConstraint:

#define USE_OFFSET_FOR_CONSTANT_FRAME true

if I set it to false, then all seems ok. Same with btGeneric6DofConstraint, in version 2.76 it behaves strangely. There is also a similar define:

#define D6_USE_FRAME_OFFSET true

if I set it to false, then it also behaves normally (i.e. as in version 2.75).

I also found a similar define in btHingeConstraint, but hinges didn't change behaviour from version 2.75 (or at least not that apparent).
My question now is, what is the purpose of those defines?

I will start a new topic on those defines, if you feel this is redundant, feel free to remove it. Thanks
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by Erwin Coumans »

the btSliderConstraint moves along the NEGATIVE x-axis (was the POSITIVE x-axis in Bullet 2.75). I
Are you happy with the fix in the latest svn trunk?
(please keep the offset issue separate)

Thanks,
Erwin
marcimatz
Posts: 34
Joined: Fri Sep 18, 2009 5:41 am

Re: Strange behaviour of btSliderConstraint in Bullet 2.76

Post by marcimatz »

Hello Erwin,

Yes, I just dowloaded the latest source (2.76, r1963) and the problem is fixed, thanks a lot!