Orientation Constraint

Oct 13, 2010 at 6:14 PM

I will soon need an orientation constraint for my game, where an object will attempt to reorient itself to match another quaternion.  I do not have a full comprehension of how constraints work, so I am probably going to goof up a lot before I get anywhere near right.

I made a quick test where I figure out the angular difference along an axis, and then apply an angular flash impulse along that axis to correct.  It appears to work pretty well.  I haven't tested it with multiple axes at once though, and I am not exactly sure how (or what is the best/proper way) to implement that within a constraint. 

I have yet to test my 3-axis constraint version... but I'm pretty sure it's pretty botched and won't even bother posting it :-P.

Suggestions?

Coordinator
Oct 13, 2010 at 7:59 PM

You  might want to look at GenericConstraint, as it provides limits for both linear and angular movement. It's based on Bullet's 6D-of-freedom constraint. You might be able to base your own constraint type off of it, although the angular behavior can get kind of funky sometimes.