diff --git a/src/model/obj.h b/src/model/obj.h index 49e96a7..cfad21e 100644 --- a/src/model/obj.h +++ b/src/model/obj.h @@ -2,6 +2,7 @@ #define OBJ_H #include "aliases.h" +#include "constants.h" #include "img.h" #include "mem_arena.h" #include "typed_list.h" @@ -12,15 +13,30 @@ typedef struct triangle Triangle; struct triangle { - u64 p0; - u64 p1; - u64 p2; - u64 n0; - u64 n1; - u64 n2; - u64 tx0; - u64 tx1; - u64 tx2; + union { + u64 positions[TRIANGLE_VERTICES]; + struct { + u64 p0; + u64 p1; + u64 p2; + }; + }; + union { + u64 normals[TRIANGLE_VERTICES]; + struct { + u64 n0; + u64 n1; + u64 n2; + }; + }; + union { + u64 coordinates[TRIANGLE_VERTICES]; + struct { + u64 tx0; + u64 tx1; + u64 tx2; + }; + }; }; MAKE_LIST_TYPE(Triangle);