コード例 #1
0
mat3 toMat3( const Leap::Matrix& m )
{
	mat3 mat;
	Leap::FloatArray a = m.toArray3x3();
	for ( size_t x = 0; x < 3; ++x ) {
		for ( size_t y = 0; y < 3; ++y ) {
			mat[ x ][ y ] = a[ y * 3 + x ];
		}
	}
	return mat;
}
コード例 #2
0
Matrix33f toMatrix33f( const Leap::Matrix& m )
{
	Matrix33f mtx;
	Leap::FloatArray a = m.toArray3x3();
	for ( size_t i = 0; i < 3; ++i ) {
		size_t j = i * 3;
		Vec3f row( a[ j + 0 ], a[ j + 1 ], a[ j + 2 ] );
		mtx.setRow( i, row );
	}
	return mtx;
}