Page 1 of 1

AppTor

Posted: Mon Feb 28, 2011 5:51 am
by Mixel
When I try to rotate a vehicle's wheel by using ApplyForce on and parallel to its edge, translational movement also occurs, so instead I have to set the shape's torque manually. Could an ApplyTorque function be added?

Re: AppTor

Posted: Mon Feb 28, 2011 8:05 am
by slembcke
I guess I could add one, but it would just be this:

Code: Select all

body->t += torque;

Re: AppTor

Posted: Mon Feb 28, 2011 9:53 am
by Mixel
That is what I currently do. But is not ApplyForce also body->f += force;

Re: AppTor

Posted: Mon Feb 28, 2011 10:04 am
by slembcke
If the offset is the zero vecter yes. If it's not, then it also generates a torque. http://code.google.com/p/chipmunk-physi ... Body.c#160

Re: AppTor

Posted: Mon Feb 28, 2011 10:08 am
by Mixel
What is the reason that my using ApplyForce on and parallel to a circle's edge also causes translational movement? Is is that a pinjoint and springjoints are attached to its center?

Re: AppTor

Posted: Mon Feb 28, 2011 11:09 am
by slembcke
Applying a force always causes linear acceleration, if the force is off center then it also generates a torque.