cglm
cglm copied to clipboard
TODOs and Features Queue
General
- [ ] Unit tests (In Progress) [important]
- [x] ARM Neon Arch (In Progress)
- [ ] Unit tests for comparing cglm with glm results [important]
- [ ] Unaligned operations (e.g. glm_umat4_mul)
- [x] Extra documentation
- [ ] Performance tests
Quaternion
- [x] Matrix to Quaternion
- [ ] Euler to Quaternion
- [x] Rotate vector with quat (we already have
glm_vec_rotate(vec, angle, axis)) - [ ] Half precision float (16 bit) support
- [x] Unit tests
Precision
- [ ] Half precision float (16 bit)
- [ ] Double precision float (64 bit double)
Convenient Functions
There could be inline wrapper for some functions e.g. glm_vec_crossand glm_vec_dot like glm_cross and glm_dot. Original functions must stay where they are. This is not necessary but could help to write code fast and more readable .
One another things there could be convenient functions for operations like this ( it is just example ):
/* v = v1 * v2 + v3 * v4 + v5 * v6 */
vec3 sum;
vec3 tmp, tmp2;
glm_vec_mulv(v1, v2, sum);
glm_vec_mulv(v3, v4, tmp2);
glm_vec_add(tmp2, sum, sum);
glm_vec_mulv(v5, v6, tmp2);
glm_vec_add(tmp2, sum, sum);
/* ... */
It could be something like this:
/* v = v1 * v2 + v3 * v4 + v5 * v6 */
vec3 sum;
glm_vec_mulv(v1, v2, sum);
glm_vec_muladd(v3, v4, sum);
glm_vec_muladd(v5, v6, sum);
/* ... */
this is also not necessary, just my thoughts. In short I mean convenient functions for +=, *=, -=, /=
Also any feature request, feedback or contribution are welcome. We can use this issue collect feature requests and feedbacks
Rename glm_scale1 to glm_scale_uni
Find perpendicular vector util e.g. glm_vec_perpendicular or glm_vec_orthogonal or glm_vec_ortho, the last one seems cool!
I found a good, fast solution, only subtraction: https://www.quora.com/How-do-I-find-a-vector-perpendicular-to-another-vector/answer/Tom-Thompson-1?srid=uEqzq
We must add this to cglm. For rendering shadowmap this could be useful for selecting UP vector against light direction.
Proposals for double and half precision names
Types
Double: vec3d vec4d mat4d
Half: vec3h vec4h mat4h
Unaligned Types: Double: uvec4d umat4d Half: uvec4h umat4h
Proposals for double
glm_dbl_mat4_mulglm_dmat4_mulglm_mat4d_mulglm_mat4_mul_dblglm_mat4_muldglm_mat4_mul64glmd_mat4_mul<- looks good but there will be call verisonglmcd_mat4_mul
Proposals for half precision
glm_half_mat4_mulorglm_hlf_mat4_mulglm_hmat4_mulglm_mat4h_mulglm_mat4_mul_halforglm_mat4_mul_hlfglm_mat4_mulhglm_mat4_mul16glmh_mat4_mulorglm16_mat4_mul<- looks good
glm_lookatd or glm_dbl_lookat or glm_dlookat or glmd_lookat
glm_lookath or glm_hlf_lookat or glm_hlookat or glmh_lookat
We must select best name for future use, mat4 is used for example. Also there will be unaligned versions for vec4 and mat4 based functions including quaternions
We already use glmc_ for pre-compiled functions. We could continue use this style like glmd_ or glmh_ or glm64_ or glm16_ ...
Alternative name proposals are welcome!
TODOs for vector:
glm_vec_shuffle,glm_vec4_shuffle- SSE3, SSE4 support for
dot,crossproducts glm_vec_muladd,glm_vec4_muladdÂglm_vec_hadd,glm_vec4_hadd similar to SIMD hadd, hsub- reflect, refract, clamp, step, smoothstep, mix
vec_expvec_logvec_pow= exp(log(v) * p)
especially vec4 version could use SIMD instructions.
I want to add these functions because we could use glm_vec4_pow(srgb, 2.2f, linear) for sRGB to LINEAR or vise versa glm_vec4_pow(linear, 1.0f / 2.2f, srgb)
Let functions that don't modify their parameters take them as const paramerers