Generic 6DOF Constraint vs. slider, hinge etc

chucksspencer
Posts: 35
Joined: Wed Jun 25, 2008 2:52 pm

Generic 6DOF Constraint vs. slider, hinge etc

Post by chucksspencer »

Am I correct in my understanding that you could, theoretically, emulate the behavior of most (any?) of the specialized constraints (e.g. hinge, slider, cone etc) with a properly configured 6DOF constraint? If that's so, are the other constraint types just for convenience, or are they superior in other ways?

To put it more concisely - why would I use a hinge constraint, for instance, rather than a 6DOF constraint with all but one of the axes locked?

- Chuck
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Generic 6DOF Constraint vs. slider, hinge etc

Post by Erwin Coumans »

The generic 6DOF constrains can emulate most other constraints indeed, but there are some practical issues:

The specific constraints, such as btPoint2PointConstraint, btSliderConstraint and btHingeConstraint are
  • easier to setup, a bit more intuitive to understand and debug
  • take less memory
  • might perform slightly better (although this might be negligible in most cases)
  • might not have certain restrictions for a particular axis, for example the btGeneric6DofConstraint y-axis should stay in range [-PI/2 , PI/2]
None of those should be show stoppers to exclusively use the btGeneric6DofConstraint or btGeneric6DofSpringConstraint indeed.
Thanks,
Erwin
chucksspencer
Posts: 35
Joined: Wed Jun 25, 2008 2:52 pm

Re: Generic 6DOF Constraint vs. slider, hinge etc

Post by chucksspencer »

Thanks Erwin - that's helpful.