public Quaternion getRotation(Quaternion quat) {
        if (quat == null) {
            quat = new Quaternion();
        }
        quat.set(rot);
        return quat;
    }
Copies the rotation component to the argument. If the argument is null, a
new Quaternion is created to hold the value. Either way, the current
instance is unaffected.

@param quat storage for the result (modified if not null)
@return the rotation value (either <code>quat</code> or a new Quaternion)
jme3-core/src/main/java/com/jme3/math/Transform.java