Libgdx: Moving a rotated perspective camera

允我心安 提交于 2019-12-04 17:41:46

Instead of applying the gestures directly to the camera, apply them to a pair of Matrix4's that you use to store the orientation and position separately. Then in the render method, multiply the two matrices and apply them to your camera's view.

In the render() method:

camera.view.set(orientation).mul(position); //Might need to swap orientation/position--don't remember. 
camera.update();

Your zoom method is fine because field of view affects the camera's projection matrix rather than its view matrix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!