btPoint2PointConstraint for orientation.

Squrky
Posts: 1
Joined: Sun Apr 05, 2009 1:58 pm

btPoint2PointConstraint for orientation.

Post by Squrky »

Hi there,

I am currently writing a 3d chess game in which each piece is a rigid body. I am attempting to add a feature in which dislodged pieces move back towards their designated board square when I press and hold a key.

My method is to attach a pair of btPoint2PointConstraint objects to each rigid body, one at the head, and one at the foot, and to connect each point constraint to the world in the appropriate locations above each board square.

This works nicely, except that sometimes the rigid bodies come to rest upside down, seemingly because the generated impulses lie on the same vector. In this case neither point-to-point constraint is met particularly closely.

Is there another approach I could try? Would the btConeTwistConstraint be better for this?

Thanks,
Nathan.