Releases: recp/cglm
v0.9.4: critical bug fixes
🐞bug fixes
Non-Square matrices are fixed ( many thanks to @EasyIP2023 ). Also now SSE can work without SSE2 which may not available on 32bit devices e.g. i686. Some fast math issues also fixed. Func param name conflicts with a macro, again! Now fixed.
In this release lot of critic bugs are fixed. Feel free to report any bugs, we are here for them 🐛
🛠️ Bugfixes and Improvements:
- #402: Struct API glms_ray_at incorrect dir param ( thanks to @nitrix )
- dont use I macro defined in standard ( fixes #404, thanks @olifre for reporting it )
- #403: mat2x3: fix multiplication functions ( many thanks to @EasyIP2023 )
- #405: mat2x4: fix multiplication functions ( many thanks to @EasyIP2023 )
- #407: mat3x2: fix multiplication functions ( many thanks to @EasyIP2023 )
- #408: mat3x4: fix multiplication functions ( many thanks to @EasyIP2023 )
- #410: mat4x2: fix multiplication functions ( many thanks to @EasyIP2023 )
- #411: mat4x3: fix multiplication functions ( many thanks to @EasyIP2023 )
- docs: improve docs ( many thanks to @EasyIP2023 )
- #412: separate SSE and SSE2 ( thanks @aryalaadi for reporting this )
- make Fasth math work both on SSE and SSE2, make -0.0f run on SSE + fast math
- make some failing test pass when fast math is on
- tests: dont validate nan and inf on fast math
- docs: add note to enable config where may not work is some environments
- docs: alignment
- fix some doc typos & warnings
Known or Possible Issues for Next Versions:
❤️ Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.9.3: ray update and many improvements
🎓 ray, struct and ci
Now we have some missing functionalities:
📌 ray sphere intersection, reflect, refract, face forward
📌 additional CI via GitHub Actions ( many thanks to @waywardmonkeys )
📌 struct API for ivec2, ivec3, and ivec4 ( many thanks to @tarhses )
📌 struct API improvements ( many thanks to @duarm, @waywardmonkeys )
📌 add new functions for ivec2 and ivec3 ( many thanks to @vitassuper )
glm_ray_sphere(origin, dir, s, &t1, &t2)) -> bool
ray sphere intersectionglm_ray_at(orig, dir, t, &point)
point by parameterglm_vec3_faceforward(N, I, Nref, dest)
glm_vec[2|3|4]_reflect(I, N, &dest)
reflectglm_vec[2|3|4]_refract(I, N, eta, &dest)
refract
glm_ray_sphere()
:
- t1 > 0, t2 > 0: ray intersects the sphere at t1 and t2 both ahead of the origin
- t1 < 0, t2 > 0: ray starts inside the sphere, exits at t2
- t1 < 0, t2 < 0: no intersection ahead of the ray
- the caller can check if the intersection points (t1 and t2) fall within a specific range (for example, tmin < t1, t2 < tmax) to determine if the intersections are within a desired segment of the ray
and many others improvements and bug fixes, thanks to those who help to make the library more robust and better than before.
🛠️ Bugfixes and Improvements:
- #378: win32, simd: ensure we are on msvc when checking MSVC specific headers
- win32, tests: fix drand48() error on mingw
- #379: simd: min / max helpers
- docs: update read the docs package versions
- #381: add new functions for ivec2 and ivec3 ( dot, norm, norm2, div, divs, mod... ) ( thanks to @vitassuper )
- #383: implement struct API for ivec2, ivec3, and ivec4 ( thanks to @tarhses )
- #384: docs, fix typos ( thanks to @waywardmonkeys )
- #386: add additional CI via GitHub Actions ( thanks to @waywardmonkeys )
- #388: ci: Remove appveyor ( thanks to @waywardmonkeys )
- #387: suppress warnings ( thanks to @waywardmonkeys )
- #389: aabb2d: fix struct api ( thanks to @waywardmonkeys )
- #390: doc improvements ( thanks to @waywardmonkeys )
- #391: ci: Add ARM64 UWP for WindowsStore ( thanks to @waywardmonkeys )
- #392: aabb2d_zero, aabb2d_diagonal and aabb2d_size ( thanks to @duarm )
- #395: use NDEBUG to check DEBUG mode, update cmake to respect DEBUG
- suppress warnings: C4244: 'function': conversion from 'int' to 'float'
- test: fix ivec2 and ivec3 comparison and suppress warnings
- #398: allow passing const float* to make functions ( thanks to @waywardmonkeys )
- #397: clarify some rotation rules, update docs to explain rotate() a bit more
- #399: some missing ray functions (
glm_ray_sphere
,glm_ray_at
,glm_vec3_faceforward
,glm_vec[2|3|4]_reflect
,glm_vec[2|3|4]_refract
- normalize: norm == 0.0f to norm < FLT_EPSILON, improving handling of very small vectors to prevent instability and overflow
- build: add missing files
- fix some doc typos & warnings
Known or Possible Issues for Next Versions:
❤️ Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.9.2: aabb2d, euler and many improvements
🎓 aabb2d and euler to quat
Now we have some missing functionalities:
📌 aabb2d ( many thanks to @duarm )
📌 euler to quat functionality ( many thanks to @telephone001 )
📌 new subtraction family of vector functions ( many thanks to @BeeverFeever )
and many others improvements and bugfixes, thanks to @v1993, @myfreeer, @gottfriedleibniz and others to make the library more robust and better than before.
🛠️ Bugfixes and Improvements:
- #345: fix
glms_mat4_ins3()
( thanks to @telephone001 ) - #346: eqv, eq, fill for ivec2 and ivec3, new print functions for ivec2 and ivec4, documentation fixes ( thanks @duarm )
- #350: add
glm_vec2_center()
( thanks @duarm ) - #354: doc fixes ( thanks to @One234Fi )
- #356: fix simd check ( thanks @havrik)
- #357: use the appropriate version of
alignof
( thanks to @v1993 ) - #361: wasm: prefer pmin/pmax ( thanks to @myfreeer )
- #362: ci: initial support of meson and emscripten ( thanks to @myfreeer )
- #360: meson: don't build by default if used in a subproject ( thanks to @v1993 )
- #355: aabb2d ( thanks to @duarm )
- #367: fix struct clipspace headers ( thanks to @v1993 )
- #372: documentation fixes ( thanks to @EasyIP2023 )
- #364: new subtraction family of vector functions ( thanks to @BeeverFeever and @gottfriedleibniz )
- #373: ivec += and -= functions ( thanks to @BeeverFeever )
- #369, #377: euler to quat functions ( thanks to @telephone001 and @gottfriedleibniz )
- fix
glmm_fmsub()
on arm-neon ( thanks to @gottfriedleibniz ) - fix glm_ivec2|3_fill and glm_ivec2|3_eq params
- build: add missing files
- tests: fix comparing integers in tests
- fix some doc typos & warnings
- struct: fix glms_rotate_atm signature
- struct: add missing glms_project_z()
Known or Possible Issues for Next Versions:
❤️ Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.9.1: New Matrix Types and Many Improvements
🎓 New Matrix Types
📌 Now we have mat2x3, mat2x4, mat3x2, mat3x4, mat4x2 and mat4x3 types and its functions ( many thanks to @EasyIP2023 )
Each one has its own header e.g mat3x4.h, including one of them:
- cglm/cglm.h
- cglm/call.h
- cglm/struct.h
will include all matrix headers. Feel free to share any bugs found to fix them.
🛠️ Bugfixes and Improvements:
- #295: README: add build docs for WebAssembly ( thanks to @myfreeer )
- #303: io: fix test runner.c implicit declaration glm_arch_print ( thanks to @EasyIP2023 )
- #309: fix and improve CGLM_USE_ANONYMOUS_STRUCT definition with more robust compiler version check
- #311: suppress sign conversion warnings
- #313: ci: update mymindstorm/setup-emsdk to v12 ( thanks to @myfreeer )
- #317: Implement missing 3D Affine Transforms in the Struct API ( thanks to @FrostKiwi )
- #328: drop "-Werror" to allow skip warnings on production build
- #341: more robust __builtin_assume_aligned detection ( thanks to @Akaricchi )
- #299, #301, #302, #321, #325, #326, #324 and more: add new _make functions for vectors, quat and matrices ( thanks to @EasyIP2023 )
- fix struct api namespace definition in box header which cause build error ( thanks to @Nonesence999 and @gottfriedleibniz )
- reduce glms_mat[4|3|2]_make()'s dest parameter
- fix and improve printing arch name in tests
- make GLM_TESTS_NO_COLORFUL_OUTPUT work on non-test print colors too
- README: update meson option for running test ( thanks to @EasyIP2023 )
- Documentation, README and commens enhancements ( thanks to @EasyIP2023, @FrostKiwi )
Known or Possible Issues for Next Versions:
❤️ Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.9.0: WASM 128 SIMD + Struct Api Namespace Configuration + Bug Fixes
🚀 WASM 123 SIMD Support
Now we have WASM 128 SIMD support ( many thanks to @myfreeer ).
Compiling
Currently the tests can be cross-compiled to wasi using clang and wasi-sdk with cmake arguments below:
-DCMAKE_C_FLAGS="-msimd128"
-DCMAKE_TOOLCHAIN_FILE=/path/to/wasi-sdk-19.0/share/cmake/wasi-sdk.cmake
-DWASI_SDK_PREFIX=/path/to/wasi-sdk-19.0
-DCGLM_USE_TEST=ON
Where /path/to/wasi-sdk-19.0/
is the path to extracted wasi sdk.
🚀 Struct API Namespace Configuration
Now we can omit or change namespace of struct api which was ( and still as default ) glms_
. We can omit the namespace completely to use like mat4_mul(mat4_mul(m1, m2), m3)
... or option to use like mat4s_mul(mat4s_mul(m1, m2), m3)
...
This makes things more flexible & readable for struct api.
now we can omit glms_ like:
/* previous / default */
return glms_vec3_normalized(glms_vec3_cross(a, b));
/* this must be defined before cglm inc especially common.h */
#define CGLM_OMIT_NS_FROM_STRUCT_API /* or define at compiler settings */
/* new!! */
return vec3_normalized(vec3_cross(a, b));
/* if CGLM_STRUCT_API_NAME_SUFFIX is defined as `s` */
return vec3s_normalized(vec3s_cross(a, b));
new options:
CGLM_OMIT_NS_FROM_STRUCT_API
, omits CGLM_STRUCT_API_NS (glms_) namespace completely if there is sub namespace e.g mat4_, vec4_ ... DEFAULT is not definedCGLM_STRUCT_API_NS
: define name space for struct api, DEFAULT isglms
CGLM_STRUCT_API_NAME_SUFFIX
: define name suffix, DEFAULT is empty e.gdefining it as #define CGLM_STRUCT_API_NAME_SUFFIX s
will adds
suffix tomat4_mul -> mat4s_mul
🛠️ Bugfixes and Improvements:
- #279: Check for builtin before using it ( thanks to @NeRdTheNed )
- #280: fix building ARM NEON on windows & msvc ( thanks to @gottfriedleibniz )
- #286: Wasm simd128 support ( thanks to @myfreeer also @kzhsw, @gottfriedleibniz )
- #290: provide option to omit or configure struct api namespace
- #291: simd, sse: use 0x80000000 insteaf of -0.f to fix
/fp:fast
on msvc ( thanks to @gottfriedleibniz, @deadwanderer ) see #289 - #292: wasm: replace usage of -0.f to 0x80000000 ( thanks to @myfreeer )
- utility to print selected simd path
- fix building tests
- fix struct api calls
- update documentations ( thanks to @ransel117 @krishna2803 )
- and some improvements may not listed here
❤️ Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.8.9: build fixes and some improvements
Bugfixes and Improvements:
- #274: adding initialization macros for ivec types ( thanks to @duarm )
- #272: revert "fix: simplified pkgconfig generation" ( thanks to @Artturin, also @eli-schwartz, @jtojnar, @q234rty, @bobvanderlinden )
- #273: make implicit double promotion/casting explicit (fixes #228) ( thanks to @JulianSchoenbaechler )
- #276: prevent overriding CMAKE_BUILD_TYPE if it is subdirectory
- see previous releases for more
Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.8.8: abs for ivec & bug fixes and improvements
New features:
Bugfixes and Improvements:
- #266: fix assertion in test_clamp on x86 ( thanks to @bl4ckb0ne )
- #269: fix missing abs declaration on Emscripten ( thanks to @KivApple )
- #270: switch CMAKE_BINARY_DIR to CMAKE_CURRENT_BINARY_DIR for cmake.pc ( thanks to @michael-santiago-tfs @suicvne )
- see previous releases for more
Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.8.7: add missing struct affine functions and headers
- fix build: add missing struct affine functions and headers
- see previous release for more: https://github.com/recp/cglm/releases/tag/v0.8.6
Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.8.6: ivec Api and New Affine Transform and Project Functions
Now we have post transform functions which is similar to existing transform function but with different multiplication order.
New Features
- #260: new affine transform and project functions 🚀
- #251: add basic ivec functions ( thanks to @Chris-F5 )
new affine functions:
-
CGLM_INLINE void glm_spin(mat4 m, float angle, vec3 axis)
: rotates existing transform around itself by with axis. this helps to rotate object around itself without moving manually or providing a pivot forglm_rotate_at()
to rotate around itself
Current implementations apply transforms to vector first, but sometimes we may need to apply rotations as last transform, cglm introduces post-transform operations e.g. apply rotation/translate last instead of first to vector.
Post transform function have similar names with existing ones with ed
suffix:
-
CGLM_INLINE void glm_translated_to(mat4 m, vec3 v, mat4 dest)
-
CGLM_INLINE void glm_translated(mat4 m, vec3 v)
-
CGLM_INLINE void glm_translated_x(mat4 m, float to)
-
CGLM_INLINE void glm_translated_y(mat4 m, float to)
-
CGLM_INLINE void glm_translated_z(mat4 m, float to)
-
CGLM_INLINE void glm_rotated_x(mat4 m, float angle, mat4 dest)
-
CGLM_INLINE void glm_rotated_y(mat4 m, float angle, mat4 dest)
-
CGLM_INLINE void glm_rotated_z(mat4 m, float angle, mat4 dest)
-
CGLM_INLINE void glm_rotated(mat4 m, float angle, vec3 axis)
-
CGLM_INLINE void glm_rotated_at(mat4 m, vec3 pivot, float angle, vec3 axis)
-
CGLM_INLINE void glm_spinned(mat4 m, float angle, vec3 axis)
new project functions:
-
CGLM_INLINE float glm_project_z(vec3 pos, mat4 m)
- map object's z coordinate to window coordinates -
CGLM_INLINE float glm_project_z_no(vec3 pos, mat4 m)
-
CGLM_INLINE float glm_project_z_zo(vec3 pos, mat4 m)
new ivec functions ( thanks to @Chris-F5 ):
void glm_ivec2(int * __restrict v, ivec2 dest);
void glm_ivec2_copy(ivec2 a, ivec2 dest);
void glm_ivec2_zero(ivec2 v);
void glm_ivec2_one(ivec2 v);
void glm_ivec2_add(ivec2 a, ivec2 b, ivec2 dest);
void glm_ivec2_adds(ivec2 v, int s, ivec2 dest);
void glm_ivec2_sub(ivec2 a, ivec2 b, ivec2 dest);
void glm_ivec2_subs(ivec2 v, int s, ivec2 dest);
void glm_ivec2_mul(ivec2 a, ivec2 b, ivec2 dest);
void glm_ivec2_scale(ivec2 v, int s, ivec2 dest);
int glm_ivec2_distance2(ivec2 a, ivec2 b);
float glm_ivec2_distance(ivec2 a, ivec2 b);
void glm_ivec2_maxv(ivec2 a, ivec2 b, ivec2 dest);
void glm_ivec2_minv(ivec2 a, ivec2 b, ivec2 dest);
void glm_ivec2_clamp(ivec2 v, int minVal, int maxVal);
void glm_ivec3(ivec4 v4, ivec3 dest);
void glm_ivec3_copy(ivec3 a, ivec3 dest);
void glm_ivec3_zero(ivec3 v);
void glm_ivec3_one(ivec3 v);
void glm_ivec3_add(ivec3 a, ivec3 b, ivec3 dest);
void glm_ivec3_adds(ivec3 v, int s, ivec3 dest);
void glm_ivec3_sub(ivec3 a, ivec3 b, ivec3 dest);
void glm_ivec3_subs(ivec3 v, int s, ivec3 dest);
void glm_ivec3_mul(ivec3 a, ivec3 b, ivec3 dest);
void glm_ivec3_scale(ivec3 v, int s, ivec3 dest);
int glm_ivec3_distance2(ivec3 a, ivec3 b);
float glm_ivec3_distance(ivec3 a, ivec3 b);
void glm_ivec3_maxv(ivec3 a, ivec3 b, ivec3 dest);
void glm_ivec3_minv(ivec3 a, ivec3 b, ivec3 dest);
void glm_ivec3_clamp(ivec3 v, int minVal, int maxVal);
void glm_ivec4(ivec3 v3, int last, ivec4 dest);
void glm_ivec4_copy(ivec4 a, ivec4 dest);
void glm_ivec4_zero(ivec4 v);
void glm_ivec4_one(ivec4 v);
void glm_ivec4_add(ivec4 a, ivec4 b, ivec4 dest);
void glm_ivec4_adds(ivec4 v, int s, ivec4 dest);
void glm_ivec4_sub(ivec4 a, ivec4 b, ivec4 dest);
void glm_ivec4_subs(ivec4 v, int s, ivec4 dest);
void glm_ivec4_mul(ivec4 a, ivec4 b, ivec4 dest);
void glm_ivec4_scale(ivec4 v, int s, ivec4 dest);
int glm_ivec4_distance2(ivec4 a, ivec4 b);
float glm_ivec4_distance(ivec4 a, ivec4 b);
void glm_ivec4_maxv(ivec4 a, ivec4 b, ivec4 dest);
void glm_ivec4_minv(ivec4 a, ivec4 b, ivec4 dest);
void glm_ivec4_clamp(ivec4 v, int minVal, int maxVal);
Bugfixes and Improvements:
- #259: fix: simplified pkgconfig generation ( thanks to @bobvanderlinden )
- #257: added missing include in io.h which adds GLM_MAX macro ( thanks to @Rokannon )
- #256: fix typo in comment ( thanks to @ogtn )
- #254: update README to show that integer types are supported ( thanks to @Chris-F5 )
- #250: fix pkg-config generation when CMAKE_INSTALL_*DIR is absolute ( thanks to @alexshpilkin )
- #247: fix grammatical errors in docs index ( thanks to @Chris-F5 )
- some improvements including build files
Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:
https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp
v0.8.5: Bugfixes and Improvements
Bugfixes and Improvements:
- 82d1050: update GLM_FLT_EPSILON to use 1e-5 instead of 1e-
- 8e784e7: win: fix shared library name and destination ( thanks to @podsvirov )
- 9f5cc3a: implement a few complex routines ( thanks to @mxi )
- 2d5506d: set PACKAGE_VERSION so it gets substituted in cglm.pc.in by cmake ( thanks to @omar-polo )
- 68e3a07: header containing sse3 intrinsics is pmmintrin.h ( thanks to @madebr )
- 5cd1a4a: add missing ivec types
- 3a141b7: extend unions for struct api
- 2a4748d: fix glm_pickmatrix()'s param type
- 7d47b7f: fix a bug in glm_lookat_lh ( thanks to @Sand3r-)
- 7e211e1: fix bug in view_lh.h ( thanks to @Sand3r-)
- 851a58c: remove unused variable ( thanks to @geckor14)
- some improvements including build files
Sponsorship: Consider become a sponsor for cglm
Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help: