title: Box2D Gravity to specific object?
body: <p>I see everyone saying that you add gravity like so in a Box2D world:</p>
  
  <pre><code>b2Vec2 gravity = b2Vec2(0.0f, -10.0f);
  bool doSleep = false;
  world = new b2World(gravity, doSleep);
  </code></pre>
  
  <p>The thing is though, what if I want gravity only on a specific b2Body which contains userData from a CCSprite? AFAIK this will apply gravity to everything in the world which I do not want, so can someone explain to me how I can apply this gravity only to a specific b2Body?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit1:</strong>
  Can I just do this line,</p>
  
  <pre><code>_bottomBody-&gt;ApplyForce(gravity, _bottomBody-&gt;GetPosition());
  </code></pre>
  
  <p>Instead of the world = new b2World... etc... Wouldn't that work with gravity only on that b2Body?</p>