當前位置: 首頁>>代碼示例>>Java>>正文


Java Camera.update方法代碼示例

本文整理匯總了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);
}
 
開發者ID:overengineering,項目名稱:space-travels-3,代碼行數:17,代碼來源:GameScreen.java

示例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();
}
   }
 
開發者ID:game-libgdx-unity,項目名稱:GDX-Engine,代碼行數:13,代碼來源:TowerDefenseGame.java

示例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);
    }
}
 
開發者ID:MovementSpeed,項目名稱:nhglib,代碼行數:28,代碼來源:CameraSystem.java

示例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();
}
 
開發者ID:saltares,項目名稱:libgdxjam,代碼行數:9,代碼來源:RenderingSystem.java

示例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();

}
 
開發者ID:Tatskaari,項目名稱:DungeonCrawler,代碼行數:13,代碼來源:DevScreen.java

示例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);
}
 
開發者ID:navossoc,項目名稱:vrmleditor,代碼行數:11,代碼來源:Renderer.java

示例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();
}
 
開發者ID:code-disaster,項目名稱:libgdx-snippets,代碼行數:14,代碼來源:VirtualScreenViewport.java

示例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();
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:7,代碼來源:CameraController.java

示例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();
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:7,代碼來源:CameraController.java


注:本文中的com.badlogic.gdx.graphics.Camera.update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。