package com.google.ar.core.examples.java.common.framework.gameMain;

import android.os.Bundle;

import com.google.ar.core.examples.java.common.framework.RWT.RWTSurfaceView;
import com.google.ar.core.examples.java.common.framework.model3D.Universe;
import com.google.ar.core.examples.java.common.framework.view3D.Camera3D;

public abstract class RealTime3DActivity extends RealTimeActivity {
	protected Universe universe;
	protected Camera3D camera;
	protected RWTSurfaceView view;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		universe = new Universe();
			
		camera = new Camera3D(universe);
		
		view = new RWTSurfaceView(this);
		view.setRenderMode(RWTSurfaceView.RENDERMODE_WHEN_DIRTY);
//		view.attachCamera(camera);
		setContentView(view);
	}

	protected void update(long interval) {
		progress(interval);
		universe.update(interval);
		camera.adjust(interval);
		view.requestRender();
	}
	
	abstract protected void progress(long interval);
}
