示例#1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    options = setupOptions();

    LoadingThread.OLD_MODEL_ORIENTATION_FIX = false;
    MTLOBJLoader.loadFromLocalAssets(getApplicationContext());
    dataManager = setupDataManager();
    sensorManager = setupSensorManager();

    setupScenes(dataManager);

    arViewPlaceHolder = new RelativeLayout(this);
    setupUILayout(arViewPlaceHolder);

    initARViews();

    // setup compass
    setupCompass(); // we create it anyway to show if needed later
    if ((options & OAARComponentBase.OPTION_HIDE_COMPASS_VIEW) != 0)
      compassView.setWillNotDraw(true);

    initScenes();
  }
示例#2
0
  @Override
  protected void onPause() {
    Log.d("ARComponentBase", "onPause()");

    sensorManager.pause();
    sceneView.onPause();
    arView.onPause();

    super.onPause();
  }
示例#3
0
  @Override
  protected void onDestroy() {
    Log.d("ARComponentBase", "onDestroy()");
    sceneView
        .onDestroy(); // should call to destroy gl context which was intentionally left in onPause
    sceneView
        .getSceneGraph()
        .destroySceneGraph(); // necessary to make work again when started again
    // registration.releaseCamera();

    super.onDestroy();
    System.gc();
  }
示例#4
0
  @Override
  protected void onResume() {
    Log.d("ARComponentBase", "onResume()");
    super.onResume();

    arView.onResume();
    sceneView.onResume();
    sensorManager.resume();

    /*/ // no use
    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {

    	@Override
    	public void run() {
    		sceneView.bringToFront();
    		if(compassView != null) compassView.bringToFront();
    	}

    }, 2500);
    /**/
  }
示例#5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    options = setupOptions();

    dataManager = setupDataManager();
    sensorManager = setupSensorManager();

    listView = new ListViewComponent(this, setupAdapter());
    listView.addListViewListener(
        new ListViewComponentListener() {
          @Override
          public void onListEvent(SceneData data) {
            onSceneSelected((OAScene) data);
          }
        });

    dataManager.addDataListener(
        new OADataListener() {
          @Override
          public void dataUpdate(OADataEvent event) {
            if (event.getScene() != null) {
              listView.addItem(event.getScene());
            }
          }
        });

    // load up scenes already in the data manager
    List<OAScene> initialScenes = dataManager.getSceneList();
    for (OAScene scene : initialScenes) {
      listView.addItem(scene);
    }

    // trigger to start loading up new scenes to the data manager
    setupScenes(dataManager);

    setupUILayout(listView);
  }
示例#6
0
 @Override
 protected void onResume() {
   super.onResume();
   sensorManager.resume();
 }
示例#7
0
 @Override
 protected void onPause() {
   super.onPause();
   sensorManager.pause();
 }