Datatypes: add missing unions for vector + color types.

pull/779/head
Kim Kulling 2016-02-02 00:59:47 +01:00
parent aaec1656f3
commit 59ece7b9fa
3 changed files with 37 additions and 7 deletions

View File

@ -86,7 +86,12 @@ public:
public:
// Red, green, blue and alpha color values
TReal r, g, b, a;
union {
struct {
TReal r, g, b, a;
};
TReal c[ 4 ];
};
} PACK_STRUCT; // !struct aiColor4D
typedef aiColor4t<float> aiColor4D;
@ -94,7 +99,12 @@ typedef aiColor4t<float> aiColor4D;
#else
struct aiColor4D {
float r, g, b, a;
union {
struct {
float r, g, b, a;
};
float c[ 4 ];
};
} PACK_STRUCT;
#endif // __cplusplus

View File

@ -95,7 +95,13 @@ public:
template <typename TOther>
operator aiVector2t<TOther> () const;
TReal x, y;
union {
struct {
TReal x, y;
};
TReal v[ 2 ];
};
} PACK_STRUCT;
typedef aiVector2t<float> aiVector2D;
@ -103,7 +109,12 @@ typedef aiVector2t<float> aiVector2D;
#else
struct aiVector2D {
float x,y;
union {
struct {
float x, y;
};
float v[ 2 ];
};
};
#endif // __cplusplus

View File

@ -125,7 +125,12 @@ public:
* @param o Second factor */
const aiVector3t SymMul(const aiVector3t& o);
TReal x, y, z;
union {
struct {
TReal x, y, z;
};
TReal v[ 3 ];
};
} PACK_STRUCT;
@ -134,8 +139,12 @@ typedef aiVector3t<float> aiVector3D;
#else
struct aiVector3D {
float x,y,z;
union {
struct {
float x, y, z;
};
float v[ 3 ];
};
} PACK_STRUCT;
#endif // __cplusplus