public void set(Quaternion quaternion) { m00 = (float) (1.0 - 2.0 * quaternion.y * quaternion.y - 2.0 * quaternion.z * quaternion.z); m10 = (float) (2.0 * quaternion.x * quaternion.y + 2.0 * quaternion.w * quaternion.z); m20 = (float) (2.0 * quaternion.x * quaternion.z - 2.0 * quaternion.w * quaternion.y);  m01 = (float) (2.0 * quaternion.x * quaternion.y - 2.0 * quaternion.w * quaternion.z); m11 = (float) (1.0 - 2.0 * quaternion.x * quaternion.x - 2.0 * quaternion.z * quaternion.z); m21 = (float) (2.0 * quaternion.y * quaternion.z + 2.0 * quaternion.w * quaternion.x);  m02 = (float) (2.0 * quaternion.x * quaternion.z + 2.0 * quaternion.w * quaternion.y); m12 = (float) (2.0 * quaternion.y * quaternion.z - 2.0 * quaternion.w * quaternion.x); m22 = (float) (1.0 - 2.0 * quaternion.x * quaternion.x - 2.0 * quaternion.y * quaternion.y);
public void set(int i, int j, float value) { if (i < 0 || i > 2 || j < 0 || j > 2) { LoggingSystem.getLogger().log(Level.WARNING, "Invalid matrix index."); throw new JmeException("Invalid indices into matrix."); } if (i == 0) { if (j == 0) { m00 = value; } else if (j == 1) { m01 = value; } else if (j == 2) { m02 = value; } } else if (i == 1) { if (j == 0) { m10 = value; } else if (j == 1) { m11 = value; } else if (j == 2) { m12 = value; } } else if (i == 2) { if (j == 0) { m20 = value; } else if (j == 1) { m21 = value; } else if (j == 2) { m22 = value; } }
    public void set(Quaternion quaternion) {        m00 = (float) (1.0 - 2.0 * quaternion.y * quaternion.y - 2.0                * quaternion.z * quaternion.z);        m10 = (float) (2.0 * quaternion.x * quaternion.y + 2.0 * quaternion.w                * quaternion.z);        m20 = (float) (2.0 * quaternion.x * quaternion.z - 2.0 * quaternion.w                * quaternion.y);        m01 = (float) (2.0 * quaternion.x * quaternion.y - 2.0 * quaternion.w                * quaternion.z);        m11 = (float) (1.0 - 2.0 * quaternion.x * quaternion.x - 2.0                * quaternion.z * quaternion.z);        m21 = (float) (2.0 * quaternion.y * quaternion.z + 2.0 * quaternion.w                * quaternion.x);        m02 = (float) (2.0 * quaternion.x * quaternion.z + 2.0 * quaternion.w                * quaternion.y);        m12 = (float) (2.0 * quaternion.y * quaternion.z - 2.0 * quaternion.w                * quaternion.x);        m22 = (float) (1.0 - 2.0 * quaternion.x * quaternion.x - 2.0                * quaternion.y * quaternion.y);    }