Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vector structs members aliases #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions mathc.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ struct vec2i {
mint_t x;
mint_t y;
};
struct {
mint_t s;
mint_t t;
};
struct {
mint_t start;
mint_t end;
};
mint_t v[VEC2_SIZE];
};
#else
Expand All @@ -179,6 +187,16 @@ struct vec3i {
mint_t y;
mint_t z;
};
struct {
mint_t r;
mint_t g;
mint_t b;
};
struct {
mint_t red;
mint_t green;
mint_t blue;
};
mint_t v[VEC3_SIZE];
};
#else
Expand All @@ -197,6 +215,30 @@ struct vec4i {
mint_t z;
mint_t w;
};
struct {
mint_t x_;
mint_t y_;
mint_t width;
mint_t height;
};
struct {
mint_t r;
mint_t g;
mint_t b;
mint_t a;
};
struct {
mint_t red;
mint_t green;
mint_t blue;
mint_t alpha;
};
struct {
mint_t vstart;
mint_t vcount;
mint_t istart;
mint_t icount;
};
mint_t v[VEC4_SIZE];
};
#else
Expand All @@ -216,6 +258,10 @@ struct vec2 {
mfloat_t x;
mfloat_t y;
};
struct {
mfloat_t s;
mfloat_t t;
};
mfloat_t v[VEC2_SIZE];
};
#else
Expand All @@ -232,6 +278,16 @@ struct vec3 {
mfloat_t y;
mfloat_t z;
};
struct {
mfloat_t r;
mfloat_t g;
mfloat_t b;
};
struct {
mfloat_t red;
mfloat_t green;
mfloat_t blue;
};
mfloat_t v[VEC3_SIZE];
};
#else
Expand All @@ -250,6 +306,24 @@ struct vec4 {
mfloat_t z;
mfloat_t w;
};
struct {
mfloat_t left;
mfloat_t top;
mfloat_t width;
mfloat_t height;
};
struct {
mfloat_t r;
mfloat_t g;
mfloat_t b;
mfloat_t a;
};
struct {
mfloat_t red;
mfloat_t green;
mfloat_t blue;
mfloat_t alpha;
};
mfloat_t v[VEC4_SIZE];
};
#else
Expand Down