Applied torque by angular motor?

Post Reply
Gregwar
Posts: 11
Joined: Mon Nov 16, 2015 6:27 pm

Applied torque by angular motor?

Post 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
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Applied torque by angular motor?

Post by Basroil »

Have you tried using btJointFeedback ?
Gregwar
Posts: 11
Joined: Mon Nov 16, 2015 6:27 pm

Re: Applied torque by angular motor?

Post by Gregwar »

Actually, getJointFeedback returns always NULL, even when calling enableFeedback(true) on the hinge
Do I need to do something more?
Gregwar
Posts: 11
Joined: Mon Nov 16, 2015 6:27 pm

Re: Applied torque by angular motor?

Post 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);
Gregwar
Posts: 11
Joined: Mon Nov 16, 2015 6:27 pm

Re: Applied torque by angular motor?

Post 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
Post Reply