Question about the velocity

Post Reply
Tony
Posts: 6
Joined: Tue Sep 03, 2013 1:36 pm

Question about the velocity

Post by Tony »

hi,
I use a hinge constraint, and use hinge->enableAngularMotor(true,m_fVelocity,50) to enable the motor. However, what's the unit of m_fVelocity? rad/s or degree/s or anything else? Also, what are the meanings about the velocity and angular velocity when i use:
btBody->getLinearVelocity();
btBody->getAngularVelocity();

when i set the targetVelocity Value larger, the constraint seems weaker? Can anything be done to improve the result?

if i want to keep the velocity of the hinge a constant, how can i get it?

Thanks!
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Question about the velocity

Post by Flix »

[OT] Your question is out of theme here (I hope it will be moved to the "General Bullet Physics Support and Feedback forum").
Tony wrote:what's the unit of m_fVelocity?
AFAIR rad/s (but I'm not 100% sure about it).
Tony wrote:what are the meanings about the velocity and angular velocity when i use:
btBody->getLinearVelocity();
btBody->getAngularVelocity();
Well, as far as I remember:
btBody->getLinearVelocity() is the linear velocity (linear units, usually meters/second) measured in the world space (not in the coordinate space of btBody).
btBody->getAngularVelocity() is the angular velocity (angular units, rad/second) around the center of mass of btBody measured in the world space (not in the coordinate space of btBody).
m_fVelocity is the target angular velocity of the hinge motor (it's a scalar): this velocity is not the actual instant velocity: the motor tries to apply this velocity using the maxMotorForce (you used 50).
Tony wrote:if i want to keep the velocity of the hinge a constant, how can i get it?
You can try increasing the max motor force if the constraint is weak (however this does not work in all cases). To make the hinge motor keep spinning, you can try setting the lower limit bigger than the upper limit (so that it's free to spin) and providing a suitable maxMotorForce (expecially if the masses of the bodies are big).
Tony
Posts: 6
Joined: Tue Sep 03, 2013 1:36 pm

Re: Question about the velocity

Post by Tony »

Flix wrote:[OT] Your question is out of theme here (I hope it will be moved to the "General Bullet Physics Support and Feedback forum").
Tony wrote:what's the unit of m_fVelocity?
AFAIR rad/s (but I'm not 100% sure about it).
Tony wrote:what are the meanings about the velocity and angular velocity when i use:
btBody->getLinearVelocity();
btBody->getAngularVelocity();
Well, as far as I remember:
btBody->getLinearVelocity() is the linear velocity (linear units, usually meters/second) measured in the world space (not in the coordinate space of btBody).
btBody->getAngularVelocity() is the angular velocity (angular units, rad/second) around the center of mass of btBody measured in the world space (not in the coordinate space of btBody).
m_fVelocity is the target angular velocity of the hinge motor (it's a scalar): this velocity is not the actual instant velocity: the motor tries to apply this velocity using the maxMotorForce (you used 50).
Tony wrote:if i want to keep the velocity of the hinge a constant, how can i get it?
You can try increasing the max motor force if the constraint is weak (however this does not work in all cases). To make the hinge motor keep spinning, you can try setting the lower limit bigger than the upper limit (so that it's free to spin) and providing a suitable maxMotorForce (expecially if the masses of the bodies are big).
Flix, Sorry to post it in an inappropriate forum, but i don't know how to move it to the right position with your reply. i will pay much attention to it the next time.

Also thank you very much for your reply, with which i understand it better. :D
Post Reply