Control over joints

henry
Posts: 1
Joined: Thu Dec 20, 2007 8:39 pm

Control over joints

Post by henry »

I've two blocks connected with a hinge joint:

J####
#
#
#


I'd like one block to always be upright, and be able to control the rotation of the other block.

After checking out docs, forums, demos, net etc., still can't find out how to do this. I can create the joint fine using either of the methods btHingeConstraint or btGeneric6DofConstraint, but any calls to setGravity() / setOrigin() / setLinearVelocity() etc. are of no help in trying to control the blocks.

Any ideas anyone ?


Or to put it another way, how does one make the rag-doll a) stand up straight and b) wave its arm ?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Control over joints

Post by Erwin Coumans »

Have you checked the motor demo in Bullet 2.66? It is located in Demos\DynamicControlDemo\MotorDemo.cpp

It uses a constraint motor to control the joints.

Hope this helps,
Erwin