title: update on different type node
body: <p>I am trying to draw body node type and also polygonesprite.  when i am going to update both type on update method.  i got issues.</p>
  
  <p>This is polygone type:</p>
  
  <pre><code>BombBallSprite *bomb = BombBallSprite::spriteWithWorld(world);
  bomb-&gt;getBody()-&gt;SetType(b2_staticBody);
  bomb-&gt;activateCollisions();
  
  this-&gt;addChild(bomb);
  </code></pre>
  
  <p>This is body node type:</p>
  
  <pre><code> this-&gt;addBodyNode(node, 0);
   node-&gt;release();
  </code></pre>
  
  <p>This above two types are drawing in single scene.</p>
  
  <p>When i update on both, i have issues:</p>
  
  <pre><code> void HelloWorld::update(float dt)
   {
       if( gameState_ != kGameStatePaused )
       {
          world_-&gt;Step(dt, velocityIterations, positionIterations);
       }
  
       this-&gt;checkAndSliceObjects();
  
  }
  
  
  void HelloWorld::checkAndSliceObjects()
  {
  double curTime = getTimeTick();
  
  for (b2Body* b = world_-&gt;GetBodyList(); b; b = b-&gt;GetNext())
  {
      if (b-&gt;GetUserData() != NULL)
      {
  
          PolygonSprite *sprite = (PolygonSprite*)b-&gt;GetUserData();
          BodyNode *node = (BodyNode*) b-&gt;GetUserData();
          if( node &amp;&amp; (node-&gt;properties_ &amp; BN_PROPERTY_SPRITE_UPDATED_BY_PHYSICS) ) {
  
            -------
  
          }
  
          if (sprite-&gt;getSliceEntered() &amp;&amp; curTime &gt; sprite-&gt;getSliceEntryTime())
          {
              sprite-&gt;setSliceEntered(false);
          }
          else if (sprite-&gt;getSliceEntered() &amp;&amp; sprite-&gt;getSliceExited())
          {
              this-&gt;splitPolygonSprite(sprite); 
          }                      
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am clueless how will handle the followings on update method</p>
  
  <pre><code>    PolygonSprite *sprite = (PolygonSprite*)b-&gt;GetUserData();
      BodyNode *node = (BodyNode*) b-&gt;GetUserData();
  </code></pre>
  
  <p>Can any one assist me?</p>