Skip to content

Commit

Permalink
[New] Added raw4x4f32 as another union member in mat4_t
Browse files Browse the repository at this point in the history
 - this would allow us to easily convert mat4_t to _mat4_t
  • Loading branch information
ravi688 committed Jun 27, 2024
1 parent 8e4cabf commit da55334
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions include/hpml/mat4.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,30 @@ typedef struct mat4_t
{
union
{
// elements
struct
{
float m00, m01, m02, m03;
float m10, m11, m12, m13;
float m20, m21, m22, m23;
float m30, m31, m32, m33;
};

// sequential
float values[16];

// rows
struct
{
float r1[4];
float r2[4];
float r3[4];
float r4[4];
// elements
struct
{
float m00, m01, m02, m03;
float m10, m11, m12, m13;
float m20, m21, m22, m23;
float m30, m31, m32, m33;
};

// sequential
float values[16];

// rows
struct
{
float r1[4];
float r2[4];
float r3[4];
float r4[4];
};
};
_mat4_t raw4x4f32;
};
float* data[4];
} mat4_t;
Expand Down

0 comments on commit da55334

Please sign in to comment.