title: How to move camera within bound in cocos2d box2d
body: <pre><code>-(void)moveCamera:(CGpoint)resultVector {
  float centerX, centerY, centerZ;
  float eyeX, eyeY, eyeZ;
  
  [self.camera centerX:&amp;centerX centerY=&amp;centerY centerZ=&amp;centerZ];
  [self.camera eyeX:&amp;eyeX eyeY:&amp;eyeY eyeZ:&amp;eyeZ];
  
  float newX = (resultVector.x - actorOriginalPosition.x) + (actorOriginalPosition.x - screenSize.width/2);
  float newY = (resultVector.y - actorOriginalPosition.y) + (actorOriginalPosition.y - screenSize.height/2);
  
  [self.camera setCenterX:newX centerY=newY centerZ:-150.0f];
  [self.camera setEyeX:newX eyeY=newY eyeZ:eyeZ];
  
  }
  </code></pre>
  
  <p>Here resultVector is actor currentPosition</p>