mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
normalize: norm == 0.0f to norm < FLT_EPSILON, improving handling of very small vectors to prevent instability and overflow
This commit is contained in:
@@ -37,6 +37,14 @@
|
||||
# define CGLM_INLINE static inline __attribute((always_inline))
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define CGLM_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
|
||||
# define CGLM_LIKELY(expr) __builtin_expect(!!(expr), 1)
|
||||
#else
|
||||
# define CGLM_UNLIKELY(expr) (expr)
|
||||
# define CGLM_LIKELY(expr) (expr)
|
||||
#endif
|
||||
|
||||
#define GLM_SHUFFLE4(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w))
|
||||
#define GLM_SHUFFLE3(z, y, x) (((z) << 4) | ((y) << 2) | (x))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user