From: Matthew Owens Date: Fri, 20 Nov 2020 08:41:54 +0000 (+0000) Subject: Revert "updated positioning for mat4_t" X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=4ec496df3c7b0c4a767b2cb4287a5b41d87e7705;p=forks%2Fsingle-header-file-c-libs.git Revert "updated positioning for mat4_t" This reverts commit af179f3b12fc1f1770bdda63937c0df0e9e9c9f2. --- diff --git a/math_3d.h b/math_3d.h index 78da4aa..05f71af 100644 --- a/math_3d.h +++ b/math_3d.h @@ -98,19 +98,19 @@ v1.0 2016-02-15 Initial release typedef struct { float x, y; } vec2_t; typedef struct { float x, y, z; } vec3_t; -typedef struct { float x, y, z, w; } vec4_t; +typedef struct { float w, x, y, z; } vec4_t; typedef struct { int x, y; } vec2i_t; typedef struct { int x, y, z; } vec3i_t; -typedef struct { int x, y, z, w; } vec4i_t; +typedef struct { int w, x, y, z; } vec4i_t; static inline vec3_t vec3(float x, float y, float z) { return (vec3_t){ x, y, z }; } static inline vec2_t vec2(float x, float y) { return (vec2_t){ x, y }; } -static inline vec4_t vec4(float x, float y, float z, float w) { return (vec4_t){ w, x, y, z }; } +static inline vec4_t vec4(float w, float x,float y,float z) { return (vec4_t){ w, x, y, z }; } static inline vec3i_t vec3i(int x, int y, int z) { return (vec3i_t){ x, y, z }; } static inline vec2i_t vec2i(int x, int y) { return (vec2i_t){ x, y }; } -static inline vec4i_t vec4i(int x, int y, int z, int w) { return (vec4i_t){ w, x, y, z }; } +static inline vec4i_t vec4i(int w, int x,int y,int z) { return (vec4i_t){ w, x, y, z }; } static inline vec3_t v3_add (vec3_t a, vec3_t b) { return (vec3_t){ a.x + b.x, a.y + b.y, a.z + b.z }; }