Page 1 of 1

Problem with ApplyForce

Posted: Fri Feb 01, 2013 3:15 pm
by Daboog
Hello, I need help!
I am loaded rube scene in world and create body 'rocket'... but when I use method ApplyForce, object is goes on. If I exchange to ApplyImpulse, rocket is soars. Could you ask me, why ApplyForce dont work?

This is link to test project http://winafterwin.com/test/rockets/

Re: Problem with ApplyForce

Posted: Fri Feb 01, 2013 9:01 pm
by iforce2d
The box2d forums might be a better place for this: http://box2d.org/forum/

How does that test project work, do I need to push a key or something? I'm not sure what you mean by 'goes on', and why that is bad...

Re: Problem with ApplyForce

Posted: Sat Feb 02, 2013 12:27 pm
by Daboog
Sorry, this is my inadvertence. After every step I clear all forces "ClearForces()", thats why object dont move...

Re: Problem with ApplyForce

Posted: Sun Feb 03, 2013 6:00 pm
by Daboog
Iforce, could you tell me, why is rocket behaves poorly when I load in rube world? I had а simulator rocket http://winafterwin.com/test/rockets2/, you can control rocket by arrow keys. But, when I load rocket in Rube world, she behaves like a feather... I am check mass of rocket and it is the same and forces same.

this is link to rocket rube:
http://winafterwin.com/test/rockets/

Re: Problem with ApplyForce

Posted: Sun Feb 03, 2013 8:01 pm
by iforce2d
Hey that looks pretty cool! Really looks like a rocket :)

I don't know about your question though... are you using the same time step length (editor uses 60fps by default). I'm not exactly sure what you mean by 'like a feather' - I imagine something fluttering and tumbling while it falls, but probably you mean something different.

Re: Problem with ApplyForce

Posted: Mon Feb 04, 2013 8:23 am
by Daboog
After some tests I guess that this is because of new version Box2d 2.1 ... The first version rocket was created by Box2d 2.0, but I dont know, why such a difference :?:

Re: Problem with ApplyForce

Posted: Mon Feb 04, 2013 8:41 am
by Daboog
http://winafterwin.com/test/rockets2/ This is on 2.1 version and I reduced the forces and torque of 10, but rocket not realistic

Re: Problem with ApplyForce

Posted: Mon Feb 04, 2013 11:59 am
by iforce2d
It seems like the thrust is always pushing the rocket upwards, when it should be going in the opposite direction to the smoke particles, right? As far as I can tell, the particles are always going in the right direction, so how about just using the reverse of that direction for the thrust force.

Re: Problem with ApplyForce

Posted: Mon Feb 04, 2013 1:16 pm
by Daboog
Problem solved by method ClearForces() before each step. Thanks for debate Iforce :)