Page 1 of 1

Transform all moment applied to a body to torque

Posted: Mon Nov 11, 2013 11:10 am
by vervatovskis
Hi gentlemen,

I have a cpBody in a chipmunk space, I am trying since three days the to detect when moment is applied on a body and apply a force against this one, in other words I want to transform all moment applied on this body to torque I want the body to turn around it self without changing its position, For more precision thr space have a gravity. Any ideas please?
Thanks in advance.

B R

Re: Transform all moment applied to a body to torque

Posted: Mon Nov 11, 2013 2:07 pm
by slembcke
I don't understand what you are trying to do.

It sounds like you just want to use the cpBodySetTorque() property maybe? Otherwise applying a force will always cause the body to move unless it's canceled out by another force.

Re: Transform all moment applied to a body to torque

Posted: Mon Nov 11, 2013 6:53 pm
by vervatovskis
Hi, Thank you for your answer, I am trying to develop a tower game, the game consist on superimposing sprites, when enough mass is above a sprite, it turn, what I want is that the sprite turn only without changing position. I hope this is better clear. Thanks

Re: Transform all moment applied to a body to torque

Posted: Mon Nov 18, 2013 9:56 am
by slembcke
You want to use the cpBodySetTorque() function then.