diff --git a/include/cglm/euler.h b/include/cglm/euler.h index 8fae039..805fd7c 100644 --- a/include/cglm/euler.h +++ b/include/cglm/euler.h @@ -83,25 +83,6 @@ # include "clipspace/view_rh_no.h" #endif - -/*! - * if you have axis order like vec3 orderVec = [0, 1, 2] or [0, 2, 1]... - * vector then you can convert it to this enum by doing this: - * @code - * glm_euler_seq order; - * order = orderVec[0] | orderVec[1] << 2 | orderVec[2] << 4; - * @endcode - * you may need to explicit cast if required - */ -typedef enum glm_euler_seq { - GLM_EULER_XYZ = 0 << 0 | 1 << 2 | 2 << 4, - GLM_EULER_XZY = 0 << 0 | 2 << 2 | 1 << 4, - GLM_EULER_YZX = 1 << 0 | 2 << 2 | 0 << 4, - GLM_EULER_YXZ = 1 << 0 | 0 << 2 | 2 << 4, - GLM_EULER_ZXY = 2 << 0 | 0 << 2 | 1 << 4, - GLM_EULER_ZYX = 2 << 0 | 1 << 2 | 0 << 4 -} glm_euler_seq; - CGLM_INLINE glm_euler_seq glm_euler_order(int ord[3]) { diff --git a/include/cglm/types.h b/include/cglm/types.h index 7a482c0..9fa59d1 100644 --- a/include/cglm/types.h +++ b/include/cglm/types.h @@ -91,6 +91,25 @@ typedef CGLM_ALIGN_MAT vec4 mat4[4]; typedef vec2 mat4x2[4]; /* [col (4), row (2)] */ typedef vec3 mat4x3[4]; /* [col (4), row (3)] */ + +/*! + * if you have axis order like vec3 orderVec = [0, 1, 2] or [0, 2, 1]... + * vector then you can convert it to this enum by doing this: + * @code + * glm_euler_seq order; + * order = orderVec[0] | orderVec[1] << 2 | orderVec[2] << 4; + * @endcode + * you may need to explicit cast if required + */ +typedef enum glm_euler_seq { + GLM_EULER_XYZ = 0 << 0 | 1 << 2 | 2 << 4, + GLM_EULER_XZY = 0 << 0 | 2 << 2 | 1 << 4, + GLM_EULER_YZX = 1 << 0 | 2 << 2 | 0 << 4, + GLM_EULER_YXZ = 1 << 0 | 0 << 2 | 2 << 4, + GLM_EULER_ZXY = 2 << 0 | 0 << 2 | 1 << 4, + GLM_EULER_ZYX = 2 << 0 | 1 << 2 | 0 << 4 +} glm_euler_seq; + /* Important: cglm stores quaternion as [x, y, z, w] in memory since v0.4.0 it was [w, x, y, z] before v0.4.0 ( v0.3.5 and earlier ). w is real part.