Hi.
I use btGeneric6DofConstaint.
But, there one problem.
Angular limit move like this btConeTwistConstraint.
It's very hard.
Is there good way??
PS. Sorry, my bad english.
btGeneric6DofConstraint + btConeTwistConstraint
-
- Posts: 3
- Joined: Mon Jan 05, 2009 2:00 am
-
- Posts: 3
- Joined: Mon Jan 05, 2009 2:00 am
Re: btGeneric6DofConstraint + btConeTwistConstraint
Another one problem.
180 degree over constraint in object angular motion.
Motion is very strange.
Is it bug?
Code: Select all
btGeneric6DofConstraint* pGen6Dof = new btGeneric6DofConstraint( *pBody, frameB, false );
const btScalar val = M_PI * .5f;
btVector3 angLow(.0f, -val, .0f);
btVector3 angHigh(.0f, val, .0f);
pGen6Dof->setAngularLowerLimit(angLow);
pGen6Dof->setAngularUpperLimit(angHigh);
Motion is very strange.
Is it bug?
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: btGeneric6DofConstraint + btConeTwistConstraint
What I tried and found before, is that, when I set the angle to be PI/2, it actually doesn't go the correct place. If you mean this ?
I don't know what's going wrong either, this should be a simple mistake we made somewhere, could anyone have similar experience and find out later?
I don't know what's going wrong either, this should be a simple mistake we made somewhere, could anyone have similar experience and find out later?
-
- Posts: 3
- Joined: Mon Jan 05, 2009 2:00 am
Re: btGeneric6DofConstraint + btConeTwistConstraint
Thank you for reply.
Yeah, I think it's right.
Set less than PI/2 correct this problem.
And,
the answer to first question?
Yeah, I think it's right.
Set less than PI/2 correct this problem.
And,
the answer to first question?
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: btGeneric6DofConstraint + btConeTwistConstraint
If you mean the difficulty is the intuitive expression onf btQuaternion, then I would suggest that:noirhero wrote:Hi.
I use btGeneric6DofConstaint.
But, there one problem.
Angular limit move like this btConeTwistConstraint.
It's very hard.
Is there good way??
PS. Sorry, my bad english.
Set an Angle to the constraint:
1. Set up an Angle in Degree expreesion, and definitely you know its rotation axis...
2. transform it into btQuaternion by one of btQuaternion's constructor:
Code: Select all
btQuaternion: btQuaternion (const btVector3 &axis, const btScalar &angle)
Code: Select all
btQuaternion: setRotation (const btVector3 &axis, const btScalar &angle)
You can get the Quaternion from the constraint first, then transform it into the normal angle expression.
Cheers, hope this is what you want !