title: Box2d polygon and circle shape conflicts FixtureA->GetBody() and FixtureB->GetBody()
body: <p>I follow Raywenderlich tutorial on Cocos2d using Box2d to detect collision</p>
  
  <p>My problem is ...</p>
  
  <p>at first I use a polygon shape on both of my Box2d bodies.</p>
  
  <p>when it collide the method is working fine.</p>
  
  <p>However, when I change one of the bodies to Box2d circle shape, the method does not work correctly.</p>
  
  <p><strong>FixtureA->GetBody();</strong> return <strong>FixtureB->GetBody();</strong></p>
  
  <p><strong>FixtureB->GetBody();</strong> return <strong>FixtureA->GetBody();</strong></p>
  
  <p>What I am trying to say is..</p>
  
  <p>when I use circle shape instead of polygon shape on one of the body, it return the other way around (regarding 2 polygon shapes)</p>
  
  <p>can someone explain how fixtureA and fixtureB is determined. Thanks! :)</p>
  
  <p><strong>This is my collision method. I got it from GMTDev and Raywenderlich.</strong></p>
  
  <pre><code>std::vector&lt;ContactData&gt;::iterator pos;
  for(pos = _contactListener-&gt;_contacts.begin(); pos != _contactListener-&gt;_contacts.end(); ++pos)
  {
      ContactData contact = *pos;
  
      b2Body *bodyA = contact.fixtureA-&gt;GetBody();
      b2Body *bodyB = contact.fixtureB-&gt;GetBody();
      if (bodyA-&gt;GetUserData() != NULL &amp;&amp; bodyB-&gt;GetUserData() != NULL)
      {
          Sprite *spriteA = (Sprite *) bodyA-&gt;GetUserData();
          Sprite *spriteB = (Sprite *) bodyB-&gt;GetUserData();
          int iTagA = spriteA-&gt;getTag();
          int iTagB = spriteB-&gt;getTag();
  
          if ((iTagA == 1 &amp;&amp; iTagB == 2) ){
              //something is hit
          }
  
      }
  
  }
  </code></pre>