Commit Graph

1853 Commits

Author SHA1 Message Date
94xhn 1c260ceb7d box/aabb2d: fix wrong face selected below AABB min bound in sphere/circle test
glm_aabb_sphere() and glm_aabb2d_circle() pick which box face to
measure axis distance to via `!(a - 1)`, where
`a = (s[i] < box[0][i]) + (s[i] > box[1][i])` is 1 for either
out-of-range direction. `!(a - 1)` always resolves to index 1
(the max face) whenever a == 1, so when the query point is below
the box's min bound on an axis, distance is measured to the wrong
(max) face instead of the min face, inflating dmin and producing
false-negative intersection results.

The above-max direction happens to pick the correct face already,
which is why this went unnoticed since the index-selection logic
was introduced in #180 (fix for #179).

Fix: index directly with the "above max" boolean
(s[i] > box[1][i]) instead of the derived !(a - 1) expression --
it's 0 for below-min (selects box[0], correct) and 1 for
above-max (selects box[1], correct), and is already computed as
part of `a`/`b`/`c` so no extra branching is introduced. Same fix
applied to both the 3D (box.h) and 2D (aabb2d.h) variants since
they share the identical pattern.

Verified against a hand-written Ericson/Graphics-Gems reference
point-AABB distance test: 200k randomized box/sphere fuzz cases
show 3418/200000 false negatives before this fix and 0/200000
after, with no change to the already-correct above-max and
fully-enclosed cases.
2026-07-18 18:06:58 +08:00
Recep Aslantas 49e4284773 build: add missing files 2026-07-16 16:56:37 +03:00
Recep Aslantas 46f46e5dcb Merge pull request #492 from FunkyAss/fix/call_api_pulls_inline
Fix "Call API pulls inline API"
2026-05-31 21:43:15 +03:00
Davide Del Zompo a97af506ce address review comments
- use relative includes for cglm/call/ headers
 - explicitly include stdio in cglm/call/io.h
 - update call documentation
2026-04-18 10:11:03 +03:00
Davide Del Zompo 454f032310 call API: don't include inline functions in header 2026-03-22 11:24:45 +02:00
Davide Del Zompo f0f05dadc5 Move glm_euler_seq to types.h 2026-03-22 11:11:46 +02:00
Recep Aslantas 83d5b2c973 docs: add infinite perspective 2026-02-10 22:59:46 +03:00
Recep Aslantas 7e1bdd0676 Merge pull request #489 from Lephar/master
Implement infinite perspective projection matrix creation functions
2026-02-10 22:45:21 +03:00
Ali Emre Gülcü 0dc17e5d47 Implement default infinite perspective projection matrix creation functions 2026-02-10 16:35:50 +03:00
Ali Emre Gülcü d6c6b4c542 Implement infinite perspective projection matrix creation functions 2026-02-10 12:30:11 +03:00
Recep Aslantas 0356534c0c Merge pull request #488 from lesleyrs/wextra
fix -ffast-math with -Wextra warnings
2026-01-31 14:44:49 +03:00
lesleyrs 5ff0d80c85 fix -ffast-math with -Wextra warnings 2026-01-22 16:09:11 +01:00
Recep Aslantas 1952042f2c Merge pull request #487 from tayoky/master
add glm_vecx_swap functions
2025-11-19 23:44:21 +03:00
tayoky 3aad5823ca add glm_vecx_swap functions 2025-11-15 10:39:14 +01:00
Recep Aslantas da957fa421 Merge pull request #483 from Lephar/master
Add missing glmc_perspective_resize_**_**() call/clipspace functions
2025-11-08 17:41:00 +03:00
Ali Emre Gülcü 47e5d48749 Add missing glmc_perspective_resize_**_**() call/clipspace functions 2025-11-05 09:56:28 +03:00
Recep Aslantas a4602f2d5f Merge pull request #478 from fd00/fix-make
Fix `make` on `srcdir != builddir`
2025-06-18 17:44:56 +03:00
Daisuke Fujimura (fd0) 6af4e0d565 Fix make on srcdir != builddir 2025-06-18 20:55:40 +09:00
Recep Aslantas a311dbfe4c Merge pull request #476 from aganm/double-promotion
Fix double-promotion warnings in tests
2025-05-13 12:33:55 +03:00
Michael Aganier a761088e15 Fix double-promotion warnings in tests 2025-05-12 17:38:21 -04:00
Recep Aslantas a886d6e170 Merge pull request #471 from under-view/feature/mat3-tables
mat3: add tables to docs & fix comments
2025-04-24 16:07:51 +03:00
Recep Aslantas 1a8b105ce6 Merge pull request #472 from under-view/mat2-docs-cleanup
mat2: docs cleanup
2025-04-24 16:07:31 +03:00
Vincent Davis Jr ec5f8074c4 mat2: docs cleanup
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-17 18:08:50 -04:00
Vincent Davis Jr 6f5fde8b52 mat3: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-17 14:22:00 -04:00
Recep Aslantas 9da4e78c2e Merge pull request #469 from under-view/feature/mat2-tables
mat2: add tables to docs & fix comments
2025-04-11 17:14:17 +03:00
Vincent Davis Jr 27a3ddc928 gitignore: ignore vim swp files
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-11 00:13:55 -04:00
Vincent Davis Jr 5d530cd8e0 mat2: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-11 00:13:54 -04:00
Vincent Davis Jr dde053a295 mat2x3[docs]: fix glm_mat2x3_zero parameters
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-05 09:58:49 -04:00
Recep Aslantas 2128235d42 Merge pull request #467 from recp/textrans
build texture transform matrix helper
2025-04-05 13:52:15 +03:00
Recep Aslantas 9fb418bcac Update include/cglm/mat3.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-05 13:36:12 +03:00
Recep Aslantas 5fde20d65c build texture transform matrix helper 2025-04-05 13:32:47 +03:00
Recep Aslantas ebc65782f8 Merge pull request #466 from recp/integration_1 2025-04-05 06:32:01 +03:00
Recep Aslantas 1bd04c819b some apple simd framework integration helpers 2025-04-04 23:02:12 +03:00
Recep Aslantas 8560da0e70 define __cglm__ to publish cglm availability universally
in this way we wont need to check arbitrary header check e.g. cglm_common_h
2025-04-04 23:01:55 +03:00
Recep Aslantas ed7a658637 Merge pull request #465 from under-view/feature/mat4x3-tables
mat4x3: add tables to docs & fix comments
2025-04-04 22:57:01 +03:00
Recep Aslantas bcc475e2b7 Merge pull request #464 from under-view/feature/mat4x2-tables
mat4x2: add tables to docs & fix comments
2025-04-04 22:56:30 +03:00
Vincent Davis Jr bdca98ba48 mat4x2: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-04 13:29:10 -04:00
Vincent Davis Jr b33e29d50f mat4x3: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-04 13:22:27 -04:00
Vincent Davis Jr 4b3e9bb779 mat3x2: fix scale comment
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-04 11:04:44 -04:00
Recep Aslantas 214842db27 Merge pull request #462 from under-view/feature/mat3x4-tables
mat3x4: add tables to docs & fix comments
2025-04-03 21:42:27 +03:00
Recep Aslantas 60e4d6c188 Merge pull request #461 from under-view/feature/mat3x2-tables
mat3x2: add tables to docs & fix comments
2025-04-03 21:41:44 +03:00
Recep Aslantas 5063d4b2b0 Merge pull request #460 from under-view/feature/mat2x4-tables
mat2x4: add tables to docs & fix comments
2025-04-03 21:40:57 +03:00
Recep Aslantas a16bc2ae4a Merge pull request #459 from under-view/feature/mat2x3-tables
mat2x3: add tables to docs & fix comments
2025-04-03 21:38:32 +03:00
Vincent Davis Jr b694c97204 mat2x4: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-03 11:30:34 -04:00
Vincent Davis Jr 4791fe3f24 mat3x4: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-03 11:27:00 -04:00
Vincent Davis Jr b64067a94d mat3x2: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-03 01:22:55 -04:00
Vincent Davis Jr 43363e8c43 mat2x3: add tables to docs & fix comments
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2025-04-02 19:59:20 -04:00
Recep Aslantas f3094cdc65 add missing almm_*_set1() to arm and wasm 2025-03-19 23:28:58 +03:00
Recep Aslantas a7bd64952e Update .gitignore 2025-03-19 23:28:26 +03:00
Recep Aslantas 4141298161 Merge pull request #452 from RolandMarchand/add-tau-constants
Added Tau constant definitions to types.h
2025-03-19 17:27:45 +03:00