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); }
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); }