diff --git a/docs/source/call.rst b/docs/source/call.rst index 9b473fd..60e703c 100644 --- a/docs/source/call.rst +++ b/docs/source/call.rst @@ -15,5 +15,6 @@ It would be duplicate documentation also it would be hard to sync documentation between inline and call version for me. By including **clgm/cglm.h** you include all inline versions. To get precompiled -versions you need to include **cglm/call.h** header it also includes all -call versions plus *clgm/cglm.h* (inline versions) +versions you need to include **cglm/call.h** header. When using the +precompiled versions, explicitly including **cglm/cglm.h** is still necessary +for the inline versions to be included. diff --git a/include/cglm/call.h b/include/cglm/call.h index 165f502..9faa656 100644 --- a/include/cglm/call.h +++ b/include/cglm/call.h @@ -11,7 +11,6 @@ extern "C" { #endif -#include "cglm.h" #include "call/vec2.h" #include "call/vec3.h" #include "call/vec4.h" diff --git a/include/cglm/call/aabb2d.h b/include/cglm/call/aabb2d.h index e6f36a0..a1f4629 100644 --- a/include/cglm/call/aabb2d.h +++ b/include/cglm/call/aabb2d.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" /* DEPRECATED! use _diag */ #define glmc_aabb2d_size(aabb) glmc_aabb2d_diag(aabb) diff --git a/include/cglm/call/affine.h b/include/cglm/call/affine.h index 52b8501..cfd35c7 100644 --- a/include/cglm/call/affine.h +++ b/include/cglm/call/affine.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/affine2d.h b/include/cglm/call/affine2d.h index e1b9462..7ba9001 100644 --- a/include/cglm/call/affine2d.h +++ b/include/cglm/call/affine2d.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/bezier.h b/include/cglm/call/bezier.h index a6a0eb4..dd089f6 100644 --- a/include/cglm/call/bezier.h +++ b/include/cglm/call/bezier.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT float diff --git a/include/cglm/call/box.h b/include/cglm/call/box.h index 3617eed..249af21 100644 --- a/include/cglm/call/box.h +++ b/include/cglm/call/box.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/cam.h b/include/cglm/call/cam.h index ad5adcd..877b327 100644 --- a/include/cglm/call/cam.h +++ b/include/cglm/call/cam.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/ortho_lh_no.h b/include/cglm/call/clipspace/ortho_lh_no.h index 3e26fa9..f233279 100644 --- a/include/cglm/call/clipspace/ortho_lh_no.h +++ b/include/cglm/call/clipspace/ortho_lh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/ortho_lh_zo.h b/include/cglm/call/clipspace/ortho_lh_zo.h index dc4c610..86e6252 100644 --- a/include/cglm/call/clipspace/ortho_lh_zo.h +++ b/include/cglm/call/clipspace/ortho_lh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/ortho_rh_no.h b/include/cglm/call/clipspace/ortho_rh_no.h index dbba497..e0e9e45 100644 --- a/include/cglm/call/clipspace/ortho_rh_no.h +++ b/include/cglm/call/clipspace/ortho_rh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/ortho_rh_zo.h b/include/cglm/call/clipspace/ortho_rh_zo.h index e79ae83..4a4106e 100644 --- a/include/cglm/call/clipspace/ortho_rh_zo.h +++ b/include/cglm/call/clipspace/ortho_rh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/persp_lh_no.h b/include/cglm/call/clipspace/persp_lh_no.h index d1f7c56..928f1c9 100644 --- a/include/cglm/call/clipspace/persp_lh_no.h +++ b/include/cglm/call/clipspace/persp_lh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/persp_lh_zo.h b/include/cglm/call/clipspace/persp_lh_zo.h index 6cd20e2..eafa217 100644 --- a/include/cglm/call/clipspace/persp_lh_zo.h +++ b/include/cglm/call/clipspace/persp_lh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/persp_rh_no.h b/include/cglm/call/clipspace/persp_rh_no.h index 3532e50..a5e31e5 100644 --- a/include/cglm/call/clipspace/persp_rh_no.h +++ b/include/cglm/call/clipspace/persp_rh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/persp_rh_zo.h b/include/cglm/call/clipspace/persp_rh_zo.h index 9d50795..a25fa8b 100644 --- a/include/cglm/call/clipspace/persp_rh_zo.h +++ b/include/cglm/call/clipspace/persp_rh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/project_no.h b/include/cglm/call/clipspace/project_no.h index 3cba860..1842e1a 100644 --- a/include/cglm/call/clipspace/project_no.h +++ b/include/cglm/call/clipspace/project_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/project_zo.h b/include/cglm/call/clipspace/project_zo.h index d2a6c62..da71157 100644 --- a/include/cglm/call/clipspace/project_zo.h +++ b/include/cglm/call/clipspace/project_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/view_lh_no.h b/include/cglm/call/clipspace/view_lh_no.h index 3b58c84..c601e58 100644 --- a/include/cglm/call/clipspace/view_lh_no.h +++ b/include/cglm/call/clipspace/view_lh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/view_lh_zo.h b/include/cglm/call/clipspace/view_lh_zo.h index c877367..4de476a 100644 --- a/include/cglm/call/clipspace/view_lh_zo.h +++ b/include/cglm/call/clipspace/view_lh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/view_rh_no.h b/include/cglm/call/clipspace/view_rh_no.h index 6303dbf..01a52f0 100644 --- a/include/cglm/call/clipspace/view_rh_no.h +++ b/include/cglm/call/clipspace/view_rh_no.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/clipspace/view_rh_zo.h b/include/cglm/call/clipspace/view_rh_zo.h index 00b8707..c3b2fea 100644 --- a/include/cglm/call/clipspace/view_rh_zo.h +++ b/include/cglm/call/clipspace/view_rh_zo.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../../cglm.h" +#include "../../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/curve.h b/include/cglm/call/curve.h index 061fdb9..eb7d4c5 100644 --- a/include/cglm/call/curve.h +++ b/include/cglm/call/curve.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT float diff --git a/include/cglm/call/ease.h b/include/cglm/call/ease.h index 87e39ca..aba8371 100644 --- a/include/cglm/call/ease.h +++ b/include/cglm/call/ease.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT float diff --git a/include/cglm/call/euler.h b/include/cglm/call/euler.h index 182bcbb..6d2af37 100644 --- a/include/cglm/call/euler.h +++ b/include/cglm/call/euler.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/frustum.h b/include/cglm/call/frustum.h index 6b4facb..68cc77f 100644 --- a/include/cglm/call/frustum.h +++ b/include/cglm/call/frustum.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/io.h b/include/cglm/call/io.h index 19ea06f..0658aef 100644 --- a/include/cglm/call/io.h +++ b/include/cglm/call/io.h @@ -12,7 +12,8 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" +#include CGLM_EXPORT void diff --git a/include/cglm/call/ivec2.h b/include/cglm/call/ivec2.h index 82f70eb..03a8039 100644 --- a/include/cglm/call/ivec2.h +++ b/include/cglm/call/ivec2.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/ivec3.h b/include/cglm/call/ivec3.h index a6cec53..778093e 100644 --- a/include/cglm/call/ivec3.h +++ b/include/cglm/call/ivec3.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/ivec4.h b/include/cglm/call/ivec4.h index 0e6d721..3fb8575 100644 --- a/include/cglm/call/ivec4.h +++ b/include/cglm/call/ivec4.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat2.h b/include/cglm/call/mat2.h index c268938..5099558 100644 --- a/include/cglm/call/mat2.h +++ b/include/cglm/call/mat2.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat2x3.h b/include/cglm/call/mat2x3.h index 215d9a4..b2b3797 100644 --- a/include/cglm/call/mat2x3.h +++ b/include/cglm/call/mat2x3.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat2x4.h b/include/cglm/call/mat2x4.h index e2775a4..a3f3027 100644 --- a/include/cglm/call/mat2x4.h +++ b/include/cglm/call/mat2x4.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat3.h b/include/cglm/call/mat3.h index 47820f9..9bb36be 100644 --- a/include/cglm/call/mat3.h +++ b/include/cglm/call/mat3.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" /* DEPRECATED! use _copy, _ucopy versions */ #define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest) diff --git a/include/cglm/call/mat3x2.h b/include/cglm/call/mat3x2.h index 246a269..4cb847c 100644 --- a/include/cglm/call/mat3x2.h +++ b/include/cglm/call/mat3x2.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat3x4.h b/include/cglm/call/mat3x4.h index 5ead2f4..d320ad9 100644 --- a/include/cglm/call/mat3x4.h +++ b/include/cglm/call/mat3x4.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat4.h b/include/cglm/call/mat4.h index f8cd70a..5ba0495 100644 --- a/include/cglm/call/mat4.h +++ b/include/cglm/call/mat4.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" /* DEPRECATED! use _copy, _ucopy versions */ #define glmc_mat4_udup(mat, dest) glmc_mat4_ucopy(mat, dest) diff --git a/include/cglm/call/mat4x2.h b/include/cglm/call/mat4x2.h index 4711d2b..e109ce4 100644 --- a/include/cglm/call/mat4x2.h +++ b/include/cglm/call/mat4x2.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/mat4x3.h b/include/cglm/call/mat4x3.h index e06e102..eb0db40 100644 --- a/include/cglm/call/mat4x3.h +++ b/include/cglm/call/mat4x3.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/noise.h b/include/cglm/call/noise.h index 6020c89..be66ef7 100644 --- a/include/cglm/call/noise.h +++ b/include/cglm/call/noise.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT float diff --git a/include/cglm/call/plane.h b/include/cglm/call/plane.h index f991121..c2182f7 100644 --- a/include/cglm/call/plane.h +++ b/include/cglm/call/plane.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/project.h b/include/cglm/call/project.h index 8fa7172..d363b5d 100644 --- a/include/cglm/call/project.h +++ b/include/cglm/call/project.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/quat.h b/include/cglm/call/quat.h index 4244d36..3f3022b 100644 --- a/include/cglm/call/quat.h +++ b/include/cglm/call/quat.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/ray.h b/include/cglm/call/ray.h index e529fdf..2a66437 100644 --- a/include/cglm/call/ray.h +++ b/include/cglm/call/ray.h @@ -10,7 +10,8 @@ #ifdef __cplusplus extern "C" { #endif -#include "../cglm.h" + +#include "../common.h" CGLM_EXPORT bool diff --git a/include/cglm/call/sphere.h b/include/cglm/call/sphere.h index 9b96546..3de43ae 100644 --- a/include/cglm/call/sphere.h +++ b/include/cglm/call/sphere.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT float diff --git a/include/cglm/call/vec2.h b/include/cglm/call/vec2.h index 10f64cc..c0eee44 100644 --- a/include/cglm/call/vec2.h +++ b/include/cglm/call/vec2.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" CGLM_EXPORT void diff --git a/include/cglm/call/vec3.h b/include/cglm/call/vec3.h index df2cad2..47ee2a5 100644 --- a/include/cglm/call/vec3.h +++ b/include/cglm/call/vec3.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" /* DEPRECATED! use _copy, _ucopy versions */ #define glmc_vec_dup(v, dest) glmc_vec3_copy(v, dest) diff --git a/include/cglm/call/vec4.h b/include/cglm/call/vec4.h index dbbfc36..0dca9b0 100644 --- a/include/cglm/call/vec4.h +++ b/include/cglm/call/vec4.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include "../cglm.h" +#include "../common.h" /* DEPRECATED! use _copy, _ucopy versions */ #define glmc_vec4_dup3(v, dest) glmc_vec4_copy3(v, dest) 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.