Hello,
That is most likely because the car object isn't centered for the camera.
The camera (using regular implementation) will zoom towards the center of the camera. (which is the exact center of the screen)
Since now the car is off-centered, you'd probably also need to apply either:
- transformation/translation to camera (to compensate for car offset)
- rotation of camera to follow the car (to compensate for car offset as well)
while zooming
Both implementations should work and keep the car above the center line as you wished for.
Suggestions:
camera.moveCamera(Camera.CAMERA_MOVEUP, zoomFloat*0.01f);
camera.rotateZ(zoomFloat*0.01f); // Or it's rotateX or rotateY... not sure
Where zoomFloat is some value passed from your zoom listener implementation.
Good luck