Ejemplo n.º 1
0
  private void changeMapY(float radians) {
    Geocentric lookVector = mUser.getLookDir();
    Geocentric upVector = mUser.getLookNormal();

    Geocentric deltaLookVector =
        new Geocentric(upVector.x * -radians, upVector.y * -radians, upVector.z * -radians);
    Geocentric newLookDir = MathUtils.add(lookVector, deltaLookVector);
    newLookDir = MathUtils.normalize(newLookDir);

    Geocentric deltaUpVector =
        new Geocentric(lookVector.x * radians, lookVector.y * radians, lookVector.z * radians);
    Geocentric newUpDir = MathUtils.add(upVector, deltaUpVector);
    newUpDir = MathUtils.normalize(newUpDir);

    mUser.setLookDir(newLookDir);
    mUser.setLookNormal(newUpDir);
  }
Ejemplo n.º 2
0
  private void changeMapX(float radians) {
    Geocentric lookVector = mUser.getLookDir();
    Geocentric crossVector = MathUtils.crossProduct(lookVector, mUser.getLookNormal());
    Geocentric deltaLookVector =
        new Geocentric(crossVector.x * radians, crossVector.y * radians, crossVector.z * radians);

    Geocentric newLookDir = MathUtils.add(lookVector, deltaLookVector);
    newLookDir = MathUtils.normalize(newLookDir);

    mUser.setLookDir(newLookDir);
  }