1

我需要在我的 libgdx 游戏中应用一些纹理。其中包括空气曲棍球桌的背景图像。它是 800x480 像素。我像这样加载它:

backgroundTexture = new Texture(Gdx.files.internal("images/background.png"));  

我的 box2d 世界每米分频器为 100。

当我在渲染方法中这样做时,我得到了我需要的东西:

debugRenderer.batch.begin();
debugRenderer.batch.draw(backgroundTexture, 0, 0);
debugRenderer.batch.end();
debugRenderer.render(world, camera.combined); 
// camera with viewport 8.0x4.8 - 100 times smaller
// than actual window

问题是,在那之后,身体开始以 100 倍的速度移动。我究竟做错了什么?

更新:
我使用的是 VirtualBox 和 Android x86。事实证明,它没有硬件 OpenGL 支持,所以当我应用纹理时,渲染速度下降到 2-3 FPS。现在我正在使用带有 x86 系统映像、KVM 和 GPU 加速的模拟器,所以感觉就像真正的设备。
问题是物理世界的更新速度比渲染速度快。

4

0 回答 0