Page 1 of 1

Applied torque by angular motor?

Posted: Sat Apr 09, 2016 10:32 am
by Gregwar
Hello,

When using Hinge constraint and enableAngularMotor, how can I know the torque that is applied by the motor?
Looks like getAppliedImpulse() is not what I want (for example, it returns non-0 values even if the motor is disabled)

Thank you
Gregwar

Re: Applied torque by angular motor?

Posted: Sun Apr 10, 2016 2:53 am
by Basroil
Have you tried using btJointFeedback ?

Re: Applied torque by angular motor?

Posted: Mon Apr 11, 2016 8:47 am
by Gregwar
Actually, getJointFeedback returns always NULL, even when calling enableFeedback(true) on the hinge
Do I need to do something more?

Re: Applied torque by angular motor?

Posted: Mon Apr 11, 2016 9:00 am
by Gregwar
OK, I figured out that I actually need to instanciate the feedback and pass it to my constraint:

Code: Select all

auto fb = new btJointFeedback();
hinge->setJointFeedback(fb);

Re: Applied torque by angular motor?

Posted: Tue Apr 12, 2016 7:38 am
by Gregwar
However, this still returns both the torque applied by the motor and other values, I think that corresponds to the hinge constraint itself