# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Need some help with btGeneric6DofConstraintPosted: Thu Jan 06, 2011 6:40 am

Joined: Thu Jan 06, 2011 6:10 am
Posts: 1
So, here's my story. I just registered here (but I've been visiting this site quite often lately) because I'm using Bullet Physics for a game. I've checked out the ragdoll demo that uses the btGeneric6DofConstraint and it did not really help me much with my problem. I am not quite sure which bullet version I am using, I just know it's less than or equal to 2.70. The game I am developing is for the PSP and the ITouch, it is a ragdoll physics game and the details are really not that important.

ANYWAY, my problem is that I can not for the life of me lock or limit the freedom of any of the rotation axes. Maybe I'm not doing something right? Forgive me if that is so, I'm still relatively new to Bullet and I could not find a solution to my problem anywhere.

Here is the code that creates the joint:
Code:
for(int i = 0;i < JointObjectCount;i++)
{
btVector3 APos,BPos;
APos = btVector3(JointPositions1[i].X,JointPositions1[i].Y,JointPositions1[i].Z);
BPos = btVector3(JointPositions2[i].X,JointPositions2[i].Y,JointPositions2[i].Z);
btGeneric6DofConstraint *Constraint = new btGeneric6DofConstraint(*Bodies[Joint1Objects[i]]->Body,*Bodies[Joint2Objects[i]]->Body,btTransform(btQuaternion(0,1,0,0),APos),btTransform(btQuaternion(0,1,0,0),BPos),true);

Vector3D ULimit = JointULimits[i]; //upper limit
Vector3D LLimit = JointLLimits[i];  //lower limit

Constraint->setAngularUpperLimit(btVector3(ULimit.X,ULimit.Y,ULimit.Z));
Constraint->setAngularLowerLimit(btVector3(LLimit.X,LLimit.Y,LLimit.Z));

}

Don't mind all the arrays and stuff, that is all generated from sort of a script file that loads the body part meshes and adds them to the dynamics world and creates constraints between them to make a ragdoll. I've already checked that process for errors several times and I have found none. So the problem is not with that.

To test it out I just tried to constrain the pelvis object with an ellipsoid that connects the torso to the pelvis, and they stick together nicely like they should except the ellipsoid rotates freely. Even if I set ULimit and LLimit both to 0,0,0.

Could this be a problem with my bullet version? Or am I doing something wrong?

If it's me I have a feeling it may be with the third and fourth parameter of the btGeneric6DofConstraint constructor.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: Google [Bot], xexuxjy and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities