// Path: gdx-vr/src/com/badlogic/gdx/vr/Stage3D.java
// public class Stage3D extends Stage {
// 
// 	private final Plane plane;
// 
// 	// private final Vector2 offsetOnPlane;
// 
// 	public Stage3D() {
// 		super();
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Viewport viewport) {
// 		super(viewport);
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Viewport viewport, SpriteBatch batch) {
// 		super(viewport, batch);
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Plane plane, Viewport viewport, SpriteBatch batch) {
// 		super(viewport, batch);
// 		this.plane = plane;
// 	}
// 
// 	private static final Vector3 tmp = new Vector3();
// 
// 	@Override
// 	public Vector2 screenToStageCoordinates(Vector2 screenCoords) {
// 		Ray pickRay = getViewport().getPickRay(screenCoords.x, screenCoords.y);
// 		Vector3 intersection = tmp;
// 		if (Intersector.intersectRayPlane(pickRay, plane, intersection)) {
// 			screenCoords.x = intersection.x;
// 			screenCoords.y = intersection.y;
// 		} else {
// 			screenCoords.x = Float.MAX_VALUE;
// 			screenCoords.y = Float.MAX_VALUE;
// 		}
// 		return screenCoords;
// 	}
// 
// 	@Override
// 	public void calculateScissors(Rectangle localRect, Rectangle scissorRect) {
// 		super.calculateScissors(localRect, scissorRect);
// 		scissorRect.set(Float.MIN_VALUE, Float.MIN_VALUE, Float.MAX_VALUE, Float.MAX_VALUE);
// 	}
// 
// 	private static final Matrix4 transform = new Matrix4();
// 
// 	@Override
// 	public void draw() {
// 		transform.idt();
// 		transform.setToLookAt(plane.normal, Vector3.Z);
// 		// TODO: no cpy()
// 		transform.translate(plane.normal.cpy().nor().scl(plane.d));
// 
// 		getBatch().setTransformMatrix(transform);
// 
// 		super.draw();
// 	}
// 
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/VirtualReality.java
// public class VirtualReality {
// 
// 	public static HeadMountedDisplay headMountedDisplay;
// 
// 	public static Head head;
// 
// 	public static Body body;
// 
// 	public static VirtualRealityRenderer renderer;
// 
// 	static VirtualRealityImplementation implementation;
// 
// 	static DistortionRenderer distortionRenderer;
// 
// 	// TODO: remove from here and javadoc
// 	public static void update(float deltaTime) {
// 		implementation.update(deltaTime);
// 	}
// 
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/VirtualRealityRenderListener.java
// public interface VirtualRealityRenderListener {
// 
// 	/**
// 	 * This is called before any rendering is triggered. It can be implemented
// 	 * to clear the screen before each frame for example.
// 	 */
// 	void frameStarted();
// 
// 	/**
// 	 * This is called after the rendering of all eyes is finished.
// 	 */
// 	void frameEnded();
// 
// 	/**
// 	 * TODO: make this viewport, not camera.
// 	 * 
// 	 * Called once or twice, depending on the settings of the renderer.
// 	 */
// 	void render(Camera camera);
// 
// }


import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Environment;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.Config;
import com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ShaderProvider;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.vr.Stage3D;
import com.badlogic.gdx.vr.VirtualReality;
import com.badlogic.gdx.vr.VirtualRealityRenderListener;
package com.badlogic.gdx.vr.simpleroom;


public class SimpleRoom extends ApplicationAdapter implements VirtualRealityRenderListener {

	private ModelBatch modelBatch;
	private ModelInstance modelInstance;
	private ModelInstance ground;
	private AssetManager assets;
	private Environment environment;
// Path: gdx-vr/src/com/badlogic/gdx/vr/Stage3D.java
// public class Stage3D extends Stage {
// 
// 	private final Plane plane;
// 
// 	// private final Vector2 offsetOnPlane;
// 
// 	public Stage3D() {
// 		super();
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Viewport viewport) {
// 		super(viewport);
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Viewport viewport, SpriteBatch batch) {
// 		super(viewport, batch);
// 		this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
// 	}
// 
// 	public Stage3D(Plane plane, Viewport viewport, SpriteBatch batch) {
// 		super(viewport, batch);
// 		this.plane = plane;
// 	}
// 
// 	private static final Vector3 tmp = new Vector3();
// 
// 	@Override
// 	public Vector2 screenToStageCoordinates(Vector2 screenCoords) {
// 		Ray pickRay = getViewport().getPickRay(screenCoords.x, screenCoords.y);
// 		Vector3 intersection = tmp;
// 		if (Intersector.intersectRayPlane(pickRay, plane, intersection)) {
// 			screenCoords.x = intersection.x;
// 			screenCoords.y = intersection.y;
// 		} else {
// 			screenCoords.x = Float.MAX_VALUE;
// 			screenCoords.y = Float.MAX_VALUE;
// 		}
// 		return screenCoords;
// 	}
// 
// 	@Override
// 	public void calculateScissors(Rectangle localRect, Rectangle scissorRect) {
// 		super.calculateScissors(localRect, scissorRect);
// 		scissorRect.set(Float.MIN_VALUE, Float.MIN_VALUE, Float.MAX_VALUE, Float.MAX_VALUE);
// 	}
// 
// 	private static final Matrix4 transform = new Matrix4();
// 
// 	@Override
// 	public void draw() {
// 		transform.idt();
// 		transform.setToLookAt(plane.normal, Vector3.Z);
// 		// TODO: no cpy()
// 		transform.translate(plane.normal.cpy().nor().scl(plane.d));
// 
// 		getBatch().setTransformMatrix(transform);
// 
// 		super.draw();
// 	}
// 
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/VirtualReality.java
// public class VirtualReality {
// 
// 	public static HeadMountedDisplay headMountedDisplay;
// 
// 	public static Head head;
// 
// 	public static Body body;
// 
// 	public static VirtualRealityRenderer renderer;
// 
// 	static VirtualRealityImplementation implementation;
// 
// 	static DistortionRenderer distortionRenderer;
// 
// 	// TODO: remove from here and javadoc
// 	public static void update(float deltaTime) {
// 		implementation.update(deltaTime);
// 	}
// 
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/VirtualRealityRenderListener.java
// public interface VirtualRealityRenderListener {
// 
// 	/**
// 	 * This is called before any rendering is triggered. It can be implemented
// 	 * to clear the screen before each frame for example.
// 	 */
// 	void frameStarted();
// 
// 	/**
// 	 * This is called after the rendering of all eyes is finished.
// 	 */
// 	void frameEnded();
// 
// 	/**
// 	 * TODO: make this viewport, not camera.
// 	 * 
// 	 * Called once or twice, depending on the settings of the renderer.
// 	 */
// 	void render(Camera camera);
// 
// }


// Path: gdx-vr-simpleroom-core/src/com/badlogic/gdx/vr/simpleroom/SimpleRoom.java
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
import com.badlogic.gdx.graphics.g3d.Environment;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.environment.DirectionalLight;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.Config;
import com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ShaderProvider;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.vr.Stage3D;
import com.badlogic.gdx.vr.VirtualReality;
import com.badlogic.gdx.vr.VirtualRealityRenderListener;

package com.badlogic.gdx.vr.simpleroom;


public class SimpleRoom extends ApplicationAdapter implements VirtualRealityRenderListener {

	private ModelBatch modelBatch;
	private ModelInstance modelInstance;
	private ModelInstance ground;
	private AssetManager assets;
	private Environment environment;
	private Stage3D stage;