本文整理匯總了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();
}