Skip to content

Commit

Permalink
[New] Added _mat4_t in hpml/mat4.h (it is a plain 4x4 float matrix)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi688 committed Jun 17, 2024
1 parent 434fbe4 commit 8e4cabf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/hpml/mat4.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
#include <stdarg.h> // for variable arugments
#include <string.h> // memcpy

/* plain mat4 object */
typedef union _mat4_t
{
// 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;


typedef struct mat4_t
{
Expand Down

0 comments on commit 8e4cabf

Please sign in to comment.