📽 Highly Optimized 2D / 3D Graphics Math (glm) for C
MIT License
Bot releases are visible (Hide)
Published by recp over 4 years ago
Bugfixes and Improvements:
New Features:
While printing, mis-alignment of columns are fixed: larger numbers are printed via %g and others are printed via %f Column withs are calculated before print.
Now values are colorful ;)
New options with default values:
#define CGLM_PRINT_PRECISION 5
#define CGLM_PRINT_MAX_TO_SHORT 1e5
#define CGLM_PRINT_COLOR "\033[36m"
#define CGLM_PRINT_COLOR_RESET "\033[0m"
To make codes unbroken, cglm makes inline print functions to be empty-body (if DEBUG and CGLM_DEFINE_PRINTS are not defined):
CGLM_INLINE void glm_mat4_print(mat4 matrix, FILE *o) { }
compiler must eliminate this empty inline function calls. This also can be disabled by defining CGLM_NO_PRINTS_NOOP
macro. 🎉
Define CGLM_PRINT_PRECISION
to change print precision, default is increased to 5 from 4 ...
Published by recp over 4 years ago
Bugfixes and Improvements:
New Features:
ray-triangle intersection ( many thanks to @Uwila )
CMake build support ( many thanks to @FMMazur and @realaltffour )
Now we can build cglm with CMake and can integrate with other CMake projects.
CMake options:
option(CGLM_SHARED "Shared build" ON)
option(CGLM_STATIC "Static build" OFF)
option(CGLM_USE_C99 "" OFF) # C11
option(CGLM_USE_TEST "Enable Tests" OFF) # for make check - make test
there may be some bugs in CMake configurations, it will be improved by time.
feel free to suggest new features, improvements and fix things by creating issues or pull requests.
Published by recp over 4 years ago
Published by recp over 4 years ago
New Features:
Bugfixes and Improvements:
quat_for
and quat_forp
implementations; These are identical to QuaternionLook
/ LookRotation
in other frameworks/engines...Since vec2 and mat2 are new features, bugs may occurs. Any feedback or help would be appreciated.
Published by recp almost 5 years ago
Published by recp almost 5 years ago
New Features:
Bugfixes and Improvements:
Now cglm don't require external dependencies and it has very cool test suite 🎉
Published by recp about 5 years ago
New API: Structs ( thanks to @acoto87 ) (https://github.com/recp/cglm/pull/80)
cglm now supports structs. To use struct api, just include cglm/struct.h
header. You can also use struct api with array api. Struct api provides type-safety. Currently struct parameters are pass-by-value but in the future it may be pass-by-reference by using pointers (feedbacks are welcome by creating issues).
New Features and Improvements:
glm_quat_axis
axis parameter typeglm_quat_normalize_to
(#88) ( @yushli )New glmm (SIMD) functions: (thanks to @superbigio )
glmm_norm2(v)
squared l2 normglmm_vhmin(v)
horizontal minglmm_vhmax(v)
horizontal maxglmm_norm_one(v)
l1 normglmm_norm_inf(v)
infinity normPublished by recp over 5 years ago
Bug fixes and Improvements:
common.h
glm_vec4_distance
for armv7 and improve for SSE2 ( @haxpor )glm_quat_normalize_to
( @yushli )Published by recp over 5 years ago
Improvements:
glm__memcpy
, glm__memset
and glm__memzero
New Functions:
float glm_mat3_rmc(vec3 r, mat3 m, vec3 c)
multiplies row vector, matrix and column vector and returns scalar.glm_mat3_zero(mat3 mat)
, glm_mat4_zero(mat4 mat)
make given matrix zero.Published by recp over 5 years ago
New Options:
CGLM_SSE4_DOT
: Enable SSE4 dot productCGLM_SSE3_DOT
: Enable SSE3 dot productNew Functions:
glm_persp_move_far()
extend frustum's far distancevoid glm_vec4_cubic(float s, vec4 dest)
fills vec4 as [s^3, s^2, s, 1.0]float glm_mat4_rmc(vec4 r, mat4 m, vec4 c)
multiplies row vector, matrix and column vector and returns scalar. This is good helper to get SMC result easily for curves.float glm_smc(float s, mat4 m, vec4 c)
calculates SMC multiplication by using glm_mat4_rmc()
and glm_vec4_cubic()
float glm_bezier()
cubic bezier equationfloat glm_hermite()
cubic hermite equationfloat glm_decasteljau()
solve cubic bezier equation using decasteljauNew glmm (SIMD) functions:
glmm_vhadds(v)
horizontal add, returns registerglmm_hadd(v)
horizontal add, returns scalarglmm_vdots(a, b)
dot product, single lane contain dot product to convert result to scalarglmm_vdot(a, b)
dot product, all lanes contain dot product to use result with other vector operationsImprovements:
glmm_
functions are moved to platform specific headers.Published by recp almost 6 years ago
New Features or Improvements:
glm_vec3_crossn()
)Bugfixes:
Published by recp almost 6 years ago
New Features or Improvements:
Bugfixes:
DEPRECATED:
Published by recp almost 6 years ago
New Features or Improvements:
Bugfixes:
glm_mul_avx()
.Published by recp about 6 years ago
New Features or Improvements:
Bugfixes:
Published by recp over 6 years ago
New Features or Improvements:
Published by recp over 6 years ago
New Features or Improvements:
glm_scale_make
and glm_translate_make
Bug fixes:
API changes:
glm_mat4_mulv3
to apply translation tooPublished by recp over 6 years ago
Published by recp over 6 years ago
glm_rotate_at
: rotate around pointglm_rotate_atm
: make rotation around pointglm_quat_rotate_at
: rotate around point using quaternionglm_quat_rotate_atm
: make rotate around point using quaternionglm_mul_rot
: multiply matrix with rotation matrix