public Matrix3f set(float[] matrix, boolean rowMajor) {
        if (matrix.length != 9) {
            throw new IllegalArgumentException(
                    "Array must be of size 9.");
        }

        if (rowMajor) {
            m00 = matrix[0];
            m01 = matrix[1];
            m02 = matrix[2];
            m10 = matrix[3];
            m11 = matrix[4];
            m12 = matrix[5];
            m20 = matrix[6];
            m21 = matrix[7];
            m22 = matrix[8];
        } else {
            m00 = matrix[0];
            m01 = matrix[3];
            m02 = matrix[6];
            m10 = matrix[1];
            m11 = matrix[4];
            m12 = matrix[7];
            m20 = matrix[2];
            m21 = matrix[5];
            m22 = matrix[8];
        }
        return this;
    }
Copies all 9 elements from the specified array.

@param matrix the input array (not null, length=9, unaffected)
@param rowMajor true to read the elements in row-major order (m00, m01,
    ...) or false to read them in column-major order (m00, m10, ...)
@return the (modified) current instance (for chaining)
@throws IllegalArgumentException if the array has length != 9
jme3-core/src/main/java/com/jme3/math/Matrix3f.java