use of com.badlogic.gdx.graphics.OrthographicCamera in project libgdx by libgdx.
the class GestureDetectorTest method create.
@Override
public void create() {
texture = new Texture("data/stones.jpg");
batch = new SpriteBatch();
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
controller = new CameraController();
gestureDetector = new GestureDetector(20, 0.5f, 2, 0.15f, controller);
Gdx.input.setInputProcessor(gestureDetector);
}
use of com.badlogic.gdx.graphics.OrthographicCamera in project libgdx by libgdx.
the class MultitouchTest method create.
@Override
public void create() {
Gdx.app.log("Multitouch", "multitouch supported: " + Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen));
renderer = new ShapeRenderer();
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.position.set(Gdx.graphics.getWidth() / 2.0f, Gdx.graphics.getHeight() / 2.0f, 0);
Gdx.input.setInputProcessor(this);
}
use of com.badlogic.gdx.graphics.OrthographicCamera in project libgdx by libgdx.
the class InverseKinematicsTest method create.
@Override
public void create() {
float aspect = Gdx.graphics.getWidth() / (float) Gdx.graphics.getHeight();
camera = new OrthographicCamera(15 * aspect, 15);
camera.update();
renderer = new ShapeRenderer();
renderer.setProjectionMatrix(camera.combined);
bones = new Bone[] { new Bone("bone0", 0, 0, 0), new Bone("bone1", 0, 2, 2), new Bone("bone2", 0, 4, 2), new Bone("bone3", 0, 6, 2), new Bone("end", 0, 8, 2) };
globalCoords.set(bones[0].position);
}
use of com.badlogic.gdx.graphics.OrthographicCamera in project libgdx by libgdx.
the class CullTest method create.
@Override
public void create() {
ModelBuilder builder = new ModelBuilder();
sphere = builder.createSphere(2f, 2f, 2f, 16, 16, new Material(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), Usage.Position | Usage.Normal);
// cam = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam = new OrthographicCamera(45, 45 * (Gdx.graphics.getWidth() / (float) Gdx.graphics.getHeight()));
cam.near = 1;
cam.far = 200;
Random rand = new Random();
for (int i = 0; i < instances.length; i++) {
pos.set(rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * -100 - 3);
instances[i] = new ModelInstance(sphere, pos);
}
modelBatch = new ModelBatch();
batch = new SpriteBatch();
font = new BitmapFont();
// Gdx.graphics.setVSync(true);
// Gdx.app.log("CullTest", "" + Gdx.graphics.getBufferFormat().toString());
}
use of com.badlogic.gdx.graphics.OrthographicCamera in project libgdx by libgdx.
the class DecalTest method resize.
@Override
public void resize(int width, int height) {
w = Gdx.graphics.getWidth() / 0.8f;
h = Gdx.graphics.getHeight() / 0.8f;
cam = new OrthographicCamera(width, height);
cam.near = 0.1f;
cam.far = 10f;
cam.position.set(0, 0, 0.1f);
cam.direction.set(0, 0, -1f);
}
Aggregations