I'm trying to reset the forces applied to a body, but calling this function doesn't seem to do it, as the forces are still present after this call. Is there anything I'm missing? I've looked through all the documentation and searched these forums and I've not found any specific information or cases of it not working for others.
Cheers
cpBodyResetForces
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpBodyResetForces
The function is trivially simple. I'm not sure how it could go wrong exactly. Try setting a breakpoint in the debugger for cpBodyResetForces(). Maybe you are just resetting the forces on the wrong body?
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/
- pat
- Posts: 53
- Joined: Tue Jul 20, 2010 7:55 pm
- Contact:
Re: cpBodyResetForces
Not sure if this is the problem, but if your trying to stop the object. you need to call cpBodyResetVelocity too.badgerr wrote:I'm trying to reset the forces applied to a body, but calling this function doesn't seem to do it, as the forces are still present after this call. Is there anything I'm missing? I've looked through all the documentation and searched these forums and I've not found any specific information or cases of it not working for others.
Cheers
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpBodyResetForces
Never heard of cpBodyResetVelocity(), are you using a wrapper or something? Presumably such a thing would just do: body->v = cpvzero; body->w = 0.0f;pat wrote:Not sure if this is the problem, but if your trying to stop the object. you need to call cpBodyResetVelocity too.
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/
- pat
- Posts: 53
- Joined: Tue Jul 20, 2010 7:55 pm
- Contact:
Re: cpBodyResetForces
er, oops. Nah i'm not using a wrapper i was just wrong. I was using cpBodySetVel(body, cpvzero)
-
- Posts: 2
- Joined: Tue Aug 10, 2010 1:50 pm
- Contact:
Re: cpBodyResetForces
cpBodySetVel did the trick. Thanks.
Who is online
Users browsing this forum: No registered users and 14 guests