本文整理汇总了Java中com.badlogic.gdx.graphics.Camera.update方法的典型用法代码示例。如果您正苦于以下问题:Java Camera.update方法的具体用法?Java Camera.update怎么用?Java Camera.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.Camera
的用法示例。
在下文中一共展示了Camera.update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCamera
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
private void updateCamera()
{
if (!GameEntityManager.getGameEntities().contains(this.level.getShip()))
{
return;
}
Camera camera = SpaceTravels3.gameViewport.getCamera();
camera.position.set(
this.level.getShip().physicsComponent.getPosition().x,
this.level.getShip().physicsComponent.getPosition().y,
0f);
camera.update();
SpaceTravels3.spriteBatch.setProjectionMatrix(camera.combined);
}
示例2: resize
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
@Override
public void resize(int width, int height) {
super.resize(width, height);
if (activeScene == scene) {
Camera camera = scene.getCameraUI();
camera.viewportHeight = height;
camera.viewportWidth = width;
camera.update();
scene.getBatchUI().setProjectionMatrix(camera.combined);
scene.setupCamera();
}
}
示例3: process
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
@Override
protected void process(int entityId) {
CameraComponent cameraComponent = cameraMapper.get(entityId);
NodeComponent nodeComponent = nodeMapper.get(entityId);
Camera camera = cameraComponent.camera;
camera.position.set(0, 0, 0);
camera.direction.set(0, 0, -1);
camera.up.set(0, 1, 0);
camera.transform(nodeComponent.getTransform());
/*camera.position.set(nodeComponent.getTranslation());
Quaternion rotation = nodeComponent.getRotationQuaternion();
camera.direction.rotate(camera.up, -rotation.getYaw());
camera.up.rotate(camera.direction, rotation.getRoll());
vec.set(camera.direction).crs(camera.up).nor();
camera.direction.rotate(vec, rotation.getPitch());*/
camera.update();
if (!cameras.contains(camera, true)) {
cameras.add(camera);
}
}
示例4: renderWorld
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
private void renderWorld(float deltaTime) {
Camera camera = viewport.getCamera();
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
super.update(deltaTime);
batch.end();
}
示例5: render
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
public void render(float delta){
Camera camera = getCamera();
SpriteBatch batch = getBatch();
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
Dungeon.getActiveDungeon().renderer.devRender(delta, batch);
PlayerCharacterEntity.getInstance().renderer.devRender(delta, batch);
batch.end();
}
示例6: adjustCamera
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
private void adjustCamera(int index) {
Camera camera = cameras[index];
Vector2 viewport = viewports[index];
camera.update();
Gdx.gl10.glMatrixMode(GL10.GL_PROJECTION);
Gdx.gl10.glLoadMatrixf(camera.combined.val, 0);
Gdx.gl10.glMatrixMode(GL10.GL_MODELVIEW);
Gdx.gl10.glLoadIdentity();
Gdx.gl10.glViewport((int) viewport.x, (int) viewport.y, (int) camera.viewportWidth, (int) camera.viewportHeight);
}
示例7: apply
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
/**
* Does not call {@link com.badlogic.gdx.graphics.glutils.HdpiUtils#glViewport(int, int, int, int)}.
*/
@Override
public void apply(boolean centerCamera) {
Camera camera = getCamera();
camera.viewportWidth = getWorldWidth();
camera.viewportHeight = getWorldHeight();
if (centerCamera) {
camera.position.set(getWorldWidth() / 2, getWorldHeight() / 2, 0);
}
camera.update();
}
示例8: CameraController
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
public CameraController(Camera camera) {
this.camera = camera;
camera.position.set(0, 6.5f, 0);
camera.direction.set(1, 0, 0);
camera.update();
}
示例9: CameraController
import com.badlogic.gdx.graphics.Camera; //导入方法依赖的package包/类
public CameraController(Camera camera) {
this.camera = camera;
camera.position.set(0, 6.5f, 0);
camera.direction.set(1, 0, 0);
camera.update();
}