fromMatrix4 method

Matrix3 fromMatrix4(
  1. Matrix4 m
)

Sets the elements of this matrix by extracting the upper-left 3x3 portion from a 4x4 matrix.

Implementation

Matrix3 fromMatrix4(Matrix4 m ) {
	final e = elements;
	final me = m.elements;

	e[ 0 ] = me[ 0 ]; e[ 1 ] = me[ 1 ]; e[ 2 ] = me[ 2 ];
	e[ 3 ] = me[ 4 ]; e[ 4 ] = me[ 5 ]; e[ 5 ] = me[ 6 ];
	e[ 6 ] = me[ 8 ]; e[ 7 ] = me[ 9 ]; e[ 8 ] = me[ 10 ];

	return this;
}