mat4 toMat4( const Leap::Matrix& m ) { mat4 mat; Leap::FloatArray a = m.toArray4x4(); for ( size_t x = 0; x < 4; ++x ) { for ( size_t y = 0; y < 4; ++y ) { mat[ x ][ y ] = a[ y * 4 + x ]; } } return mat; }
Matrix44f toMatrix44f( const Leap::Matrix& m ) { Matrix44f mtx; Leap::FloatArray a = m.toArray4x4(); for ( size_t i = 0; i < 4; ++i ) { size_t j = i * 4; Vec4f row( a[ j + 0 ], a[ j + 1 ], a[ j + 2 ], a[ j + 3 ] ); mtx.setRow( i, row ); } return mtx; }