Why are vectors a struct?
awsdert opened this issue · 1 comments
awsdert commented
Looking at the headers I saw this:
struct vector3 {
union {
HYP_FLOAT v[3];
struct {
HYP_FLOAT x, y, z;
};
struct {
HYP_FLOAT yaw, pitch, roll;
};
};
};
Why bother with the outer struct when you could've done this:
union vector3 {
HYP_FLOAT v[3];
struct {
HYP_FLOAT x, y, z;
};
struct {
HYP_FLOAT yaw, pitch, roll;
};
};
dagostinelli commented
That's an interesting idea.
I used the struct because I thought it was an intuitive choice.