Bullet2 constraints

JeffDJeffD Posts: 20

Yeah, I'm back again.

Bullet2/Bullet2Wrapper(in escher daily builds) handles constraints a bit differently than the original extension and I'm not quite sure things work now. Here's my current understanding, which of course could be incorrect.

Every constraint in B2 is a Bt2Constraint struct, which has 4 protected members.

struct Bt2Constraint : Bt2Item permits Bt2World
  protected btTypedConstraint constraint;
  protected btConeTwistConstraint coneTwistConstraint;
  protected btHingeConstraint hingeConstraint;
  protected btSliderConstraint sliderConstraint;

All constraints get assigned to constraint and can access the methods/functions of btTypedConstraint.

If the constraint is a btConeTwistConstraint, btHingeConstraint, or btSliderConstraint its add function assigns it to both constraint and it's matching type member. This should* allow access to the members and methods of it's specific type as well as those that belong to btTypeConstraint.

Now here's something I definitely don't understand. Most constraint types don't have a matching protected type member in Bt2Constraint. Is it possible to access the functions specific to those types without one? If so, how do you do that?

If the answer to the first question is 'no' I assume you have to add a new protected member type to Bt2Constraint and edit the add function for that constraint so that it is also assigned to this new member. I'm kind of dreading doing that, but you do what you've got to do.¯\_(ツ)_/¯


(*I say should because there appears to be some validity issues with at least btHingeConstraint that keeps you from accessing it's methods/functions. I've submitted a bug)

Sign In or Register to comment.