public static Quaternion stripToYaw(Quaternion q) {
        float yaw;
        float w = q.getW();
        float x = q.getX();
        float y = q.getY();
        float z = q.getZ();
        float sqx = x*x;
        float sqy = y*y;
        float sqz = z*z;
        float sqw = w*w;
        float unit = sqx + sqy + sqz + sqw; // if normalized is one, otherwise
        // is correction factor
        float test = x * y + z * w;
        if (test > 0.499 * unit) { // singularity at north pole
            yaw = 2 * FastMath.atan2(x, w);
        } else if (test < -0.499 * unit) { // singularity at south pole
            yaw = -2 * FastMath.atan2(x, w);
        } else {
            yaw = FastMath.atan2(2 * y * w - 2 * x * z, sqx - sqy - sqz + sqw); // roll or heading 
        }
        FastFullAngles(q, yaw, 0f, 0f);
        return q;
    }
A private constructor to inhibit instantiation of this class.
jme3-vr/src/main/java/com/jme3/util/VRUtil.java