当前位置: 首页>>代码示例>>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;未经允许,请勿转载。