// Path: src/main/java/org/n52/geoar/tracking/camera/RealityCamera.java
// public class RealityCamera {
// 	private static final String CAMERA_HEIGHT_PREF = "cameraHeight";
// 
// 	public interface CameraUpdateListener {
// 		void onCameraUpdate();
// 	}
// 
// 	public static float height = 1.6f; // "usage height", distance between
// 										// ground and device
// 	public static float fovY = 42.5f;
// 	// Viewport of camera preview
// 	public static int cameraViewportWidth;
// 	public static int cameraViewportHeight;
// 	private static boolean hasViewportSize = false;
// 
// 	private static List<CameraUpdateListener> listeners = new ArrayList<CameraUpdateListener>();
// 	public static float aspect;
// 
// 	public static void addCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.add(listener);
// 	}
// 
// 	public static void removeCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.remove(listener);
// 	}
// 
// 	private static void onUpdate() {
// 		for (CameraUpdateListener listener : listeners) {
// 			listener.onCameraUpdate();
// 		}
// 	}
// 
// 	public static void setFovY(float fov) {
// 		boolean changed = RealityCamera.fovY != fov;
// 		RealityCamera.fovY = fov;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static void setViewportSize(Size size) {
// 		setViewportSize(size.width, size.height);
// 	}
// 
// 	public static void setViewportSize(int width, int height) {
// 		boolean changed = cameraViewportHeight != height
// 				|| cameraViewportWidth != width;
// 		cameraViewportHeight = height;
// 		cameraViewportWidth = width;
// 		RealityCamera.aspect = width / (float) height;
// 		hasViewportSize = true;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static boolean hasViewportSize() {
// 		return hasViewportSize;
// 	}
// 
// 	@Deprecated
// 	public static void setAspect(float aspect) {
// 		// RealityCamera.aspect = aspect;
// 	}
// 
// 	public static void changeHeight(float inc) {
// 		height += inc;
// 		onUpdate();
// 	}
// 
// 	public static void setHeight(float height) {
// 		RealityCamera.height = height;
// 		onUpdate();
// 	}
// 
// 	public static void saveState() {
// 		SharedPreferences preferences = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		Editor editor = preferences.edit();
// 		editor.putFloat(CAMERA_HEIGHT_PREF, RealityCamera.height);
// 		editor.commit();
// 	}
// 
// 	public static void restoreState() {
// 		SharedPreferences prefs = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		RealityCamera.setHeight(prefs.getFloat(CAMERA_HEIGHT_PREF, 1.6f));
// 	}
// }
// 
// Path: src/main/java/org/n52/geoar/view/geoar/Settings.java
// public class Settings {
// 
// 	// AR view settings
// 	// Radius in meters for the interpolation in AR view
// 	public static final int SIZE_AR_INTERPOLATION = 1500;
// 	// Threshold in position to request new interpolation
// 	public static final int RELOAD_DIST_AR = 50;
// 	// Zoom used in AR view for interpolation, please make sure it fits somehow
// 	// with SIZE_AR_INTERPOLATION...
// 	public static final byte ZOOM_AR = 12;
// 
// 	// Buffer in px to request in advance around map extent
// 	public static final int BUFFER_MAPINTERPOLATION = 100;
// 
// }


import java.util.Arrays;
import org.n52.geoar.tracking.camera.RealityCamera;
import org.n52.geoar.view.geoar.Settings;
import android.opengl.Matrix;

	// m[5] = uy;
	// m[6] = -fy;
	// m[7] = 0.0f;
	//
	// m[8] = sz;
	// m[9] = uz;
	// m[10] = -fz;
	// m[11] = 0.0f;
	//
	// m[12] = 0.0f;
	// m[13] = 0.0f;
	// m[14] = 0.0f;
	// m[15] = 1.0f;
	//
	// // Matrix.m
	// // gl.glMultMatrixf(m, 0);
	// // gl.glTranslatef(-eyeX, -eyeY, -eyeZ);
	// }

	public static boolean pointInFrustum(float[] p) {
		for (int i = 0; i < frustumPlanes.length; i++) {
			if (!frustumPlanes[i].isOutside(p))
				return false;
		}
		return true;
	}

	public static void resetProjectionMatrix() {
		Matrix.setIdentityM(projectionMatrix, 0);
		perspectiveMatrix(projectionMatrix, 0, RealityCamera.fovY,

// Path: src/main/java/org/n52/geoar/tracking/camera/RealityCamera.java
// public class RealityCamera {
// 	private static final String CAMERA_HEIGHT_PREF = "cameraHeight";
// 
// 	public interface CameraUpdateListener {
// 		void onCameraUpdate();
// 	}
// 
// 	public static float height = 1.6f; // "usage height", distance between
// 										// ground and device
// 	public static float fovY = 42.5f;
// 	// Viewport of camera preview
// 	public static int cameraViewportWidth;
// 	public static int cameraViewportHeight;
// 	private static boolean hasViewportSize = false;
// 
// 	private static List<CameraUpdateListener> listeners = new ArrayList<CameraUpdateListener>();
// 	public static float aspect;
// 
// 	public static void addCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.add(listener);
// 	}
// 
// 	public static void removeCameraUpdateListener(CameraUpdateListener listener) {
// 		listeners.remove(listener);
// 	}
// 
// 	private static void onUpdate() {
// 		for (CameraUpdateListener listener : listeners) {
// 			listener.onCameraUpdate();
// 		}
// 	}
// 
// 	public static void setFovY(float fov) {
// 		boolean changed = RealityCamera.fovY != fov;
// 		RealityCamera.fovY = fov;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static void setViewportSize(Size size) {
// 		setViewportSize(size.width, size.height);
// 	}
// 
// 	public static void setViewportSize(int width, int height) {
// 		boolean changed = cameraViewportHeight != height
// 				|| cameraViewportWidth != width;
// 		cameraViewportHeight = height;
// 		cameraViewportWidth = width;
// 		RealityCamera.aspect = width / (float) height;
// 		hasViewportSize = true;
// 		if (changed)
// 			onUpdate();
// 	}
// 
// 	public static boolean hasViewportSize() {
// 		return hasViewportSize;
// 	}
// 
// 	@Deprecated
// 	public static void setAspect(float aspect) {
// 		// RealityCamera.aspect = aspect;
// 	}
// 
// 	public static void changeHeight(float inc) {
// 		height += inc;
// 		onUpdate();
// 	}
// 
// 	public static void setHeight(float height) {
// 		RealityCamera.height = height;
// 		onUpdate();
// 	}
// 
// 	public static void saveState() {
// 		SharedPreferences preferences = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		Editor editor = preferences.edit();
// 		editor.putFloat(CAMERA_HEIGHT_PREF, RealityCamera.height);
// 		editor.commit();
// 	}
// 
// 	public static void restoreState() {
// 		SharedPreferences prefs = GeoARApplication.applicationContext
// 				.getSharedPreferences(GeoARApplication.PREFERENCES_FILE,
// 						Context.MODE_PRIVATE);
// 		RealityCamera.setHeight(prefs.getFloat(CAMERA_HEIGHT_PREF, 1.6f));
// 	}
// }
// 
// Path: src/main/java/org/n52/geoar/view/geoar/Settings.java
// public class Settings {
// 
// 	// AR view settings
// 	// Radius in meters for the interpolation in AR view
// 	public static final int SIZE_AR_INTERPOLATION = 1500;
// 	// Threshold in position to request new interpolation
// 	public static final int RELOAD_DIST_AR = 50;
// 	// Zoom used in AR view for interpolation, please make sure it fits somehow
// 	// with SIZE_AR_INTERPOLATION...
// 	public static final byte ZOOM_AR = 12;
// 
// 	// Buffer in px to request in advance around map extent
// 	public static final int BUFFER_MAPINTERPOLATION = 100;
// 
// }


// Path: src/main/java/org/n52/geoar/ar/view/gl/GLESCamera.java
import java.util.Arrays;
import org.n52.geoar.tracking.camera.RealityCamera;
import org.n52.geoar.view.geoar.Settings;
import android.opengl.Matrix;

	// m[5] = uy;
	// m[6] = -fy;
	// m[7] = 0.0f;
	//
	// m[8] = sz;
	// m[9] = uz;
	// m[10] = -fz;
	// m[11] = 0.0f;
	//
	// m[12] = 0.0f;
	// m[13] = 0.0f;
	// m[14] = 0.0f;
	// m[15] = 1.0f;
	//
	// // Matrix.m
	// // gl.glMultMatrixf(m, 0);
	// // gl.glTranslatef(-eyeX, -eyeY, -eyeZ);
	// }

	public static boolean pointInFrustum(float[] p) {
		for (int i = 0; i < frustumPlanes.length; i++) {
			if (!frustumPlanes[i].isOutside(p))
				return false;
		}
		return true;
	}

	public static void resetProjectionMatrix() {
		Matrix.setIdentityM(projectionMatrix, 0);
		perspectiveMatrix(projectionMatrix, 0, RealityCamera.fovY,

				RealityCamera.aspect, zNear, zFar);
