Array API - Inline (Default)¶
This is the default API of cglm. All functions are forced to be inlined and struct api, call api uses this inline api to share implementation.
📌 Call api is also array api but it is not inlined. In the future there may be option to forward struct api to call api instead of inline api to reduce binary size if needed.
📌 USE this API docs for similar functions in struct and call api
📌 In struct api you can omit namespace e.g
glms_vec3_dot can be called as
vec3_dot in struct api, see struct-api to configure struct api for more details.
📌 In struct api functions can return struct/union
📌 In struct api you can access items like .x, .y, .z, .w, .r, .g, .b, .a, .m00, m01…
Some functions may exist twice, once for their namespace and once for global namespace to make easier to write very common functions
For instance, in general we use
glm_vec3_dot to get dot product
of two vec3. Now we can also do this with
same for _cross and so on…
The original function stays where it is, the function in global namespace
of same name is just an alias, so there is no call version of those functions.
e.g there is no func like
glmc_dot because glm_dot is just alias for
By including cglm/cglm.h header you will include all inline version of functions. Since functions in this header[s] are inline you don’t need to build or link cglm against your project.
But by including cglm/call.h header you will include all non-inline version of functions. You need to build cglm and link it. Follow the Build cglm documentation for this
- 3D Affine Transforms
- 3D Affine Transform Matrix (specialized functions)
- 2D Affine Transforms
- axis aligned bounding box (AABB)
- euler angles
- vec2 extra
- vec3 extra
- vec4 extra
- Project / UnProject
- utils / helpers
- io (input / output e.g. print)
- precompiled functions (call)