mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
@@ -47,6 +47,21 @@ typedef union vec2s {
|
|||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float r;
|
||||||
|
float i;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float u;
|
||||||
|
float v;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float s;
|
||||||
|
float t;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
} vec2s;
|
} vec2s;
|
||||||
|
|
||||||
@@ -58,9 +73,40 @@ typedef union vec3s {
|
|||||||
float y;
|
float y;
|
||||||
float z;
|
float z;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float r;
|
||||||
|
float g;
|
||||||
|
float b;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
} vec3s;
|
} vec3s;
|
||||||
|
|
||||||
|
typedef union ivec2s {
|
||||||
|
ivec2 raw;
|
||||||
|
#if CGLM_USE_ANONYMOUS_STRUCT
|
||||||
|
struct {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int r;
|
||||||
|
int i;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int u;
|
||||||
|
int v;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int s;
|
||||||
|
int t;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
} ivec2s;
|
||||||
|
|
||||||
typedef union ivec3s {
|
typedef union ivec3s {
|
||||||
ivec3 raw;
|
ivec3 raw;
|
||||||
#if CGLM_USE_ANONYMOUS_STRUCT
|
#if CGLM_USE_ANONYMOUS_STRUCT
|
||||||
@@ -69,9 +115,34 @@ typedef union ivec3s {
|
|||||||
int y;
|
int y;
|
||||||
int z;
|
int z;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int r;
|
||||||
|
int g;
|
||||||
|
int b;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
} ivec3s;
|
} ivec3s;
|
||||||
|
|
||||||
|
typedef union ivec4s {
|
||||||
|
ivec4 raw;
|
||||||
|
#if CGLM_USE_ANONYMOUS_STRUCT
|
||||||
|
struct {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
int w;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int r;
|
||||||
|
int g;
|
||||||
|
int b;
|
||||||
|
int a;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
} ivec4s;
|
||||||
|
|
||||||
typedef union CGLM_ALIGN_IF(16) vec4s {
|
typedef union CGLM_ALIGN_IF(16) vec4s {
|
||||||
vec4 raw;
|
vec4 raw;
|
||||||
#if CGLM_USE_ANONYMOUS_STRUCT
|
#if CGLM_USE_ANONYMOUS_STRUCT
|
||||||
@@ -81,6 +152,13 @@ typedef union CGLM_ALIGN_IF(16) vec4s {
|
|||||||
float z;
|
float z;
|
||||||
float w;
|
float w;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float r;
|
||||||
|
float g;
|
||||||
|
float b;
|
||||||
|
float a;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
} vec4s;
|
} vec4s;
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,12 @@
|
|||||||
#define CGLM_CASTPTR_ASSUME_ALIGNED(expr, type) \
|
#define CGLM_CASTPTR_ASSUME_ALIGNED(expr, type) \
|
||||||
((type*)CGLM_ASSUME_ALIGNED((expr), __alignof__(type)))
|
((type*)CGLM_ASSUME_ALIGNED((expr), __alignof__(type)))
|
||||||
|
|
||||||
|
typedef int ivec2[2];
|
||||||
|
typedef int ivec3[3];
|
||||||
|
typedef int ivec4[4];
|
||||||
|
|
||||||
typedef float vec2[2];
|
typedef float vec2[2];
|
||||||
typedef float vec3[3];
|
typedef float vec3[3];
|
||||||
typedef int ivec3[3];
|
|
||||||
typedef CGLM_ALIGN_IF(16) float vec4[4];
|
typedef CGLM_ALIGN_IF(16) float vec4[4];
|
||||||
typedef vec4 versor; /* |x, y, z, w| -> w is the last */
|
typedef vec4 versor; /* |x, y, z, w| -> w is the last */
|
||||||
typedef vec3 mat3[3];
|
typedef vec3 mat3[3];
|
||||||
|
|||||||
Reference in New Issue
Block a user