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.
cpBodySetVelLimit with negative value
-
- Posts: 2
- Joined: Tue Sep 20, 2011 1:44 pm
- Contact:
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpBodySetVelLimit with negative value
You need to write your own integration callback. See the planet demo for an example.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 2
- Joined: Tue Sep 20, 2011 1:44 pm
- Contact:
Re: cpBodySetVelLimit with negative value
Great!.
Thanks for the prompt reply.
Thanks for the prompt reply.
Who is online
Users browsing this forum: No registered users and 35 guests