Beispiel #1
0
 @Override
 public void _c_addActionsToEvents(
     EventManager eventManager, CustomGLSurfaceView arView, SystemUpdater updater) {
   ActionMoveCameraBuffered move = new ActionMoveCameraBuffered(camera, 5, 25);
   arView.addOnTouchMoveAction(move);
   eventManager.addOnTrackballAction(move);
   Action rot = new ActionRotateCameraBuffered(camera);
   updater.addObjectToUpdateCycle(rot);
   eventManager.addOnOrientationChangedAction(rot);
   eventManager.addOnLocationChangedAction(new ActionCalcRelativePos(world, camera));
 }
Beispiel #2
0
  @Override
  public void addActionsToEvents(
      final EventManager eventManager, CustomGLSurfaceView arView, SystemUpdater updater) {
    mWasdAction = new ActionWASDMovement(mCamera, XREDUCTION, YREDUCTION, MAXWASDSPEED);
    mRotateGLCameraAction = new ActionRotateCameraBuffered(mCamera);
    eventManager.addOnOrientationChangedAction(mRotateGLCameraAction);

    arView.addOnTouchMoveListener(mWasdAction);
    eventManager.addOnTrackballAction(
        new ActionMoveCameraBuffered(mCamera, TRACKBALLFACTOR, TOUCHSCREENFACTOR));
    eventManager.addOnLocationChangedAction(new ActionCalcRelativePos(mWorld, mCamera));

    eventManager.addOnOrientationChangedAction(
        new ActionUseCameraAngles2() {
          @Override
          public void onAnglesUpdated(float pitch, float roll, float compassAzimuth) {
            mCameraAngleData.x = pitch;
            mCameraAngleData.y = roll;
            mCameraAngleData.z = compassAzimuth;
          }
        });

    if (mWaitForValidGps) {
      mMinAccuracyAction =
          new ActionWaitForAccuracy(getActivity(), MINGPSACCURACY, MAXGPSPOSUPDATECOUNT) {
            @Override
            public void minAccuracyReachedFirstTime(Location l, ActionWaitForAccuracy a) {
              callAddObjectsToWorldIfNotCalledAlready();
              if (!eventManager.getOnLocationChangedAction().remove(a)) {
                ARLogger.debug(
                    LOG_TAG,
                    "Could not remove minAccuracyAction from the onLocationChangedAction list");
              }
            }
          };
      eventManager.addOnLocationChangedAction(mMinAccuracyAction);
    }
  }