我遇到了 libGDX 中的 Camera 类的问题,即使它的位置发生变化,我也无法在视觉上移动它。
这就是我设置相机的方式:
camera = new OrthographicCamera(frustumWidth, frustumHeight);
这就是我改变其位置的方式:
world.onUpdate(deltaTime, camera);
    renderer.render(world);
    camera.position.set(MathUtils.random(0, 800), MathUtils.random(0, 480), 0);
    //camera.position.set(
        //  world.dynamicObjects.get(GameWorld.MainPgID).pos.x * GameWorld.frustumToWorldRatio,
            //world.dynamicObjects.get(GameWorld.MainPgID).pos.y * GameWorld.frustumToWorldRatio, 0);
我在 .render 函数的开头提交了更改:
camera.update();
        batcher.setProjectionMatrix(camera.combined);
        batcher.begin();
        polygonBatcher.begin();
正如我所说的那样,位置确实发生了变化,但在我尝试过的许多组合中,都没有奏效。也许我误解了相机的工作原理,我需要移动物体而不是相机?对我来说似乎很愚蠢,毕竟它被称为相机是有原因的。