private void rotate(float radians) { Geocentric lookVector = mUser.getLookDir(); Geocentric upVector = mUser.getLookNormal(); Matrix3x3 rotationMatrix = MathUtils.createRotationMatrix(radians, lookVector); Geocentric newUpVector = MathUtils.multiplyGeocentricAndMatrix3x3(rotationMatrix, upVector); newUpVector = MathUtils.normalize(newUpVector); mUser.setLookNormal(newUpVector); }
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); }