Refactor rotationValuesFromTransform