Closes https://github.com/assimp/assimp/issues/43 : provide different
matrix scheme via union.pull/779/head
parent
a1bd83d797
commit
aaec1656f3
|
@ -161,10 +161,15 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
union {
|
||||||
TReal a1, a2, a3;
|
struct {
|
||||||
TReal b1, b2, b3;
|
TReal a1, a2, a3;
|
||||||
TReal c1, c2, c3;
|
TReal b1, b2, b3;
|
||||||
|
TReal c1, c2, c3;
|
||||||
|
};
|
||||||
|
TReal m[ 3 ][ 3 ];
|
||||||
|
TReal mData[ 9 ];
|
||||||
|
};
|
||||||
} PACK_STRUCT;
|
} PACK_STRUCT;
|
||||||
|
|
||||||
typedef aiMatrix3x3t<float> aiMatrix3x3;
|
typedef aiMatrix3x3t<float> aiMatrix3x3;
|
||||||
|
@ -172,13 +177,18 @@ typedef aiMatrix3x3t<float> aiMatrix3x3;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
struct aiMatrix3x3 {
|
struct aiMatrix3x3 {
|
||||||
|
union {
|
||||||
float a1, a2, a3;
|
struct {
|
||||||
float b1, b2, b3;
|
float a1, a2, a3;
|
||||||
float c1, c2, c3;
|
float b1, b2, b3;
|
||||||
|
float c1, c2, c3;
|
||||||
|
};
|
||||||
|
float m[ 3 ][ 3 ];
|
||||||
|
float mData[ 9 ];
|
||||||
|
};
|
||||||
} PACK_STRUCT;
|
} PACK_STRUCT;
|
||||||
|
|
||||||
#endif
|
#endif // __cplusplus
|
||||||
|
|
||||||
#include "./Compiler/poppack1.h"
|
#include "./Compiler/poppack1.h"
|
||||||
|
|
||||||
|
|
|
@ -213,8 +213,8 @@ public:
|
||||||
/** @brief A function for creating a rotation matrix that rotates a
|
/** @brief A function for creating a rotation matrix that rotates a
|
||||||
* vector called "from" into another vector called "to".
|
* vector called "from" into another vector called "to".
|
||||||
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
||||||
* Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
* Output: mtx[3][3] -- a 3x3 matrix in column-major form
|
||||||
* Authors: Tomas M<EFBFBD>ller, John Hughes
|
* Authors: Tomas Mueller, John Hughes
|
||||||
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
||||||
* Journal of Graphics Tools, 4(4):1-4, 1999
|
* Journal of Graphics Tools, 4(4):1-4, 1999
|
||||||
*/
|
*/
|
||||||
|
@ -222,12 +222,16 @@ public:
|
||||||
const aiVector3t<TReal>& to, aiMatrix4x4t& out);
|
const aiVector3t<TReal>& to, aiMatrix4x4t& out);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
union {
|
||||||
TReal a1, a2, a3, a4;
|
struct {
|
||||||
TReal b1, b2, b3, b4;
|
TReal a1, a2, a3, a4;
|
||||||
TReal c1, c2, c3, c4;
|
TReal b1, b2, b3, b4;
|
||||||
TReal d1, d2, d3, d4;
|
TReal c1, c2, c3, c4;
|
||||||
|
TReal d1, d2, d3, d4;
|
||||||
|
};
|
||||||
|
TReal m[ 4 ][ 4 ];
|
||||||
|
TReal mData[ 16 ];
|
||||||
|
};
|
||||||
} PACK_STRUCT;
|
} PACK_STRUCT;
|
||||||
|
|
||||||
typedef aiMatrix4x4t<float> aiMatrix4x4;
|
typedef aiMatrix4x4t<float> aiMatrix4x4;
|
||||||
|
@ -235,11 +239,17 @@ typedef aiMatrix4x4t<float> aiMatrix4x4;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
struct aiMatrix4x4 {
|
struct aiMatrix4x4 {
|
||||||
float a1, a2, a3, a4;
|
union {
|
||||||
float b1, b2, b3, b4;
|
struct {
|
||||||
float c1, c2, c3, c4;
|
float a1, a2, a3, a4;
|
||||||
float d1, d2, d3, d4;
|
float b1, b2, b3, b4;
|
||||||
};
|
float c1, c2, c3, c4;
|
||||||
|
float d1, d2, d3, d4;
|
||||||
|
};
|
||||||
|
float m[ 4 ][ 4 ];
|
||||||
|
float mData[ 16 ];
|
||||||
|
};
|
||||||
|
} PACK_STRUCT;
|
||||||
|
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue