Hey!
I am having real trouble implementing constraints in C++ since there is absolutely no documentation on how to setup things correctly, there is not even one code-example out there, only Ramas Wiki article on how to set basic values.
My target is to create the principal of a self-closing door. When something opened the door, it will close automatically.
Or more abstract: I need a way to say the constraint to rotate the constrainted object.
But I have no success in implementing it. The constraint itself now works and reacts properly to external forces, but all the motors don’t have any effect on them.
The movement:
this->steerElement->getConstrainedComponent()->SetAngularVelocityDrive(true, true);
this->steerElement->getConstrainedComponent()->SetAngularDriveParams(50000, 100, 100000);
this->steerElement->getConstrainedComponent()->SetAngularVelocityTarget(rot.Vector() * 50);
Settings: Linear Axis all locked. Angular axis all limited, Twist locked.
Breaking the constraint in code does work, so I have the right pointer there, also my values I pass get updated (they show up correctly in the editor when I select the constraint when I eject from the game), but it doesn’t move a single millimeter. I tried tons of settings but I not once succeeded in just moving it one idea of a centimeter…
Am I missing something? I tried everything, enable linear axis, linear motor, everything…
I would really appreciate some help.
Thanks