cpBodySetVelLimit with negative value
Posted: Thu Sep 22, 2011 4:16 pm
Hello,
I am simulating an object going up and down. I want to limit the upward velocity to a certain negative value, for instance:
cpBodySetVelLimit(_ballBody, -60.0);
But as far as I can see the speed is limited also for downward direction because when the object goes down it reaches a limit velocity of:
+60.0
Furthermore, once the object reaches the limit velocity (either -60 when going upwards or +60 when going downwards) it begins to bounce between -60 and +60.
QUESTION:
How can I limit the velocity of the object but only in a particular direction?
Thanks in advance.
I am simulating an object going up and down. I want to limit the upward velocity to a certain negative value, for instance:
cpBodySetVelLimit(_ballBody, -60.0);
But as far as I can see the speed is limited also for downward direction because when the object goes down it reaches a limit velocity of:
+60.0
Furthermore, once the object reaches the limit velocity (either -60 when going upwards or +60 when going downwards) it begins to bounce between -60 and +60.
QUESTION:
How can I limit the velocity of the object but only in a particular direction?
Thanks in advance.