I create a new Camera and set mask to a Layer in this way
// code inside init() method of my Layer class
auto s = Director::getInstance()->getWinSize();
auto visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
auto spritePos = Vec3(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y, 0);
camera = Camera::createPerspective(60, (float)s.width / s.height, 1.0, 1000);
camera->setCameraFlag(CameraFlag::USER2);
camera->setPosition3D(spritePos + Vec3(0, 0, s.height*.8));
setCameraMask((unsigned short)CameraFlag::USER2, true);
camera->lookAt(spritePos, Vec3(0.0, 1.0, 0.0));
on touchDown I set position of my player Sprite in this way but when I touch in middle of screen then that set position exact where I touched but when I move from center to any of side (in width or in height way). position of sprite start deviation from some value . In leftmost/ rightmost point deviation is width of player sprite.
player->setPosition(c.x,c.y);
How I set position without any deviation ?