Joint controlled objects

Post Reply
josemarin
Posts: 38
Joined: Fri Aug 12, 2005 5:37 pm

Joint controlled objects

Post by josemarin »

Hi,

In my game I need that some objects only rotate (like in a windmill) and others that act like pistons (go from point A to B and back to A).

In this case, it's better to manually set the rotations and positions, or use joints? What joints would be better?

Thanks

Jose
josemarin
Posts: 38
Joined: Fri Aug 12, 2005 5:37 pm

Re: Joint controlled objects

Post by josemarin »

Well, I did some tests and I think that for the rotating objects the Hinge constraint will do, but I'm having a problem with the slider constraint (btSliderConstraint):
The behavior I need is a continuous piston movement (go from point A to point B, return to A and repeat the cycle forever).

But the controlled body stops the movement after a while.

That's the creation code:

btSliderConstraint* slider = new btSliderConstraint(*fixedBody1, *fixedBody2, frameInA, frameInB, true );

slider->setLowerAngLimit(0.0f);
slider->setUpperAngLimit(0.0f);
slider->setPoweredLinMotor(true);
slider->setTargetLinMotorVelocity(3);


Any tip?

Thanks.

Jose
Post Reply