Commit Graph

28 Commits

Author SHA1 Message Date
Recep Aslantas
aad5223da0 change signature of refraction to let caller know if refraction occurs or not 2024-03-24 06:31:29 +03:00
Recep Aslantas
2b78f9ab47 refract 2024-03-22 00:18:55 +03:00
Recep Aslantas
8ea2fd1cd1 reflect missing stuff 2024-03-21 02:21:07 +03:00
Bruce Mitchener
182c28faf8 Allow passing const float* to make functions. 2024-03-18 19:49:50 +07:00
BeeverFeever
7696374f1e Vector subtraction functions
Add subtraction family of functions for vectors.
2023-12-04 21:32:19 +11:00
Vincent Davis Jr
5833d1bf44 vec4: add new function glm_vec4_make
Function takes in a float array. Array must be
at least of size 4 and converts it into
a 4D vector.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2023-07-02 13:54:10 -05:00
Recep Aslantas
dcf5b5c1c4 vec: fix min/max for compiled vec3 2019-09-24 17:01:56 +03:00
Luigi Castelli
27cc9c3351 vec: some useful functions (#103)
These functions are added:
- abs(): absolute value
- fract(): fractional part
- norm_one(): L1 norm
- norm_inf(): infinity norm
- hadd(): horizontal add
- hmax(): horizontal max
2019-09-01 00:30:15 +03:00
Luigi Castelli
144624962a added glm_vec_fill() (#100)
* alternative name for _broadcast(): _fill()
2019-08-26 09:19:26 +03:00
Luigi Castelli
4639f3184a glm_lerpc(), glm_step(), glm_smoothstep(), glm_smoothinterp() (#98)
* lerp, step, smoothstep

* glm_lerp() and friends are no longer clamped, use glm_lerpc() and friends
* mix() function as wrapper of lerp()
* no there are clamp and raw version of lerp functions
2019-08-25 22:17:36 +03:00
Luigi Castelli
43b36f1dc1 squared distance with SIMD support (#96)
squared distance for vec4
2019-08-23 10:32:54 +03:00
Recep Aslantas
bb8ff25752 Revert "mark readonly parameters as const" 2019-04-30 08:19:07 +03:00
Recep Aslantas
392565f920 mark readonly parameters as const (continue) 2019-04-28 21:48:19 +03:00
Recep Aslantas
59b9e54879 vec4: helper to fill vec4 as [S^3, S^2, S, 1] 2019-01-26 15:54:10 +03:00
Recep Aslantas
6d6954b208 vec: minnadd and maxadd helpers 2018-11-29 10:50:24 +03:00
Recep Aslantas
4e08b7e335 vec: rename parameter names 2018-11-29 09:55:27 +03:00
Recep Aslantas
aee381d869 vec: deprecate glm_vec_inv and glm_vec4_inv
* because in the current implementation, `glm_vec3_negate` does same thing. It is duplicate.
2018-11-29 09:23:14 +03:00
Recep Aslantas
b4bf8f3537 vec: rename glm_vec_ to glm_vec3_ (continue)
* add missing functions to vec4
* update docs
2018-11-29 09:07:48 +03:00
Recep Aslantas
1d527dc2f0 unalignned version for vec4_copy 2018-07-14 12:03:42 +03:00
Recep Aslantas
7f7007574b vec: implement muladd's scalar version 2018-04-13 22:30:44 +03:00
Recep Aslantas
c05f58a169 vec: add addadd, subadd and muladd helpers 2018-04-13 15:46:43 +03:00
Recep Aslantas
d841f8809d vec: add some new functions for vector
* _mul: multiply two vector (replacement for _mulv)
* _div: div two vector
* _divs: div vector with scalar
* adds: add scalar to each components of vec
* subs: sub scalar from each components of vec
2018-04-13 15:12:56 +03:00
Recep Aslantas
25fc3d0284 vec: add one and zero helpers for vectors 2018-04-13 11:57:14 +03:00
Recep Aslantas
de55850136 add call version of vector extensions 2018-04-11 12:31:29 +03:00
Recep Aslantas
48b7b30e42 add call version for clamp 2018-03-22 21:18:08 +03:00
Recep Aslantas
63eaee5049 vec: implement min and max 2017-12-17 16:55:04 +03:00
Recep Aslantas
9fe48b34a7 inverse (opposite) of vectors 2017-10-27 00:20:41 +03:00
Recep Aslantas
9d61668e04 re-organise files, remove cglm prefix from file to make them more clean 2017-07-11 18:05:10 +03:00