Skip to content

Releases: recp/cglm

v0.9.4: critical bug fixes

01 Apr 15:10
1796cc5
Compare
Choose a tag to compare

🐞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

26 Mar 14:18
Compare
Choose a tag to compare

🎓 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 intersection
  • glm_ray_at(orig, dir, t, &point) point by parameter
  • glm_vec3_faceforward(N, I, Nref, dest)
  • glm_vec[2|3|4]_reflect(I, N, &dest) reflect
  • glm_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

31 Dec 12:17
Compare
Choose a tag to compare

🎓 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:

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

10 Aug 06:13
cdd4d0e
Compare
Choose a tag to compare

🎓 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

01 May 22:01
Compare
Choose a tag to compare

🚀 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 defined
  • CGLM_STRUCT_API_NS: define name space for struct api, DEFAULT is glms
  • CGLM_STRUCT_API_NAME_SUFFIX: define name suffix, DEFAULT is empty e.g defining it as #define CGLM_STRUCT_API_NAME_SUFFIX s will add s suffix to mat4_mul -> mat4s_mul

🛠️ Bugfixes and Improvements:

❤️ 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

04 Feb 19:18
c51040c
Compare
Choose a tag to compare

Bugfixes and Improvements:

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

14 Dec 11:04
3894ea3
Compare
Choose a tag to compare

New features:

  • #265: new abs functions for vec2, ivec2, ivec3, ivec4 ( thanks to @duarm )

Bugfixes and Improvements:

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

26 Oct 20:20
Compare
Choose a tag to compare

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

23 Oct 17:35
Compare
Choose a tag to compare

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 for glm_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

20 Mar 19:15
7e5d1f4
Compare
Choose a tag to compare

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:

https://opencollective.com/cglm#backer