Recep Aslantas
48839a38a1
fix refract
2024-07-15 12:41:23 +03:00
Recep Aslantas
4c872238d9
dont use I macro defined in standard
2024-03-31 04:22:42 +03:00
Recep Aslantas
1de373a9bd
normalize: norm == 0.0f to norm < FLT_EPSILON, improving handling of very small vectors to prevent instability and overflow
2024-03-25 02:22:46 +03:00
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
da57558078
docs for new ray functions
2024-03-22 22:30:22 +03:00
Recep Aslantas
6ad0aca7e0
fix refract
2024-03-22 21:59:10 +03:00
Recep Aslantas
3701305c9e
suppress warnings
2024-03-22 10:36:28 +03:00
Recep Aslantas
2b78f9ab47
refract
2024-03-22 00:18:55 +03:00
Recep Aslantas
41d1a8b9eb
faceforward
2024-03-21 02:21:28 +03:00
Recep Aslantas
8ea2fd1cd1
reflect missing stuff
2024-03-21 02:21:07 +03:00
Recep Aslantas
8c81443f24
reflect
2024-03-21 00:18:02 +03:00
Bruce Mitchener
182c28faf8
Allow passing const float* to make functions.
2024-03-18 19:49:50 +07:00
Bruce Mitchener
e4419c4f18
Fix typos.
2024-02-08 15:12:30 +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
aeeeac4c5a
vec3: add new function glm_vec3_make
...
Function takes in a float array. Array must be
at least of size 3 and converts it into
a 3D vector.
Signed-off-by: Vincent Davis Jr <vince@underview.tech >
2023-07-02 13:25:25 -05:00
Wladislav ヴラド Artsimovich
87ae96b847
Fix Singular / Plural in comments
2023-06-16 17:40:06 +09:00
Sundaram Ramaswamy
aa071b2a6b
Fix cross product when operand is also dest
2021-06-10 17:20:50 +05:30
Recep Aslantas
38c6188e12
Update vec3.h
2021-06-10 10:13:51 +03:00
Sundaram Ramaswamy
2e8162b133
Fix vec3_ortho
2021-06-09 23:18:32 +05:30
Recep Aslantas
349dc274f4
add forward vector as macro (vec3, RH)
...
* this will be used for where Vec3.Forward is needed
2020-02-20 15:19:20 +03:00
Recep Aslantas
7c10840a85
tests: add more tests for vec3
2019-09-23 22:39:53 +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
Recep Aslantas
03fda193a5
vec: update docs for norm
2019-08-30 14:47: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
1fdd459733
add tests for vector swizzling, rename vec to vec3
2019-06-06 13:12:17 +03:00
Recep Aslantas
f0be6eb448
Merge branch 'master' into swizzle
2019-06-06 12:58:55 +03:00
Recep Aslantas
bb8ff25752
Revert "mark readonly parameters as const"
2019-04-30 08:19:07 +03:00
Recep Aslantas
6ed275734b
mark readonly parameters as const
2019-04-28 12:15:43 +03:00
Recep Aslantas
6c0c5167b0
docs: fix some parameter docs
2019-03-31 18:53:31 +03:00
Recep Aslantas
2ef9c23a6c
vec: normalize cross product helper
2018-12-06 18:01:52 +03:00
Recep Aslantas
92605f845a
test: fix comparing two float values in tests
2018-12-05 16:34:22 +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
0b8c63a90e
vec: rename glm_vec_ namespace to glm_vec3_
2018-11-28 23:22:30 +03:00
Recep Aslantas
ef6134263e
vec: improve angle between two vector
...
* because `acosf()` may return NaN if cosine/dot is out of range
2018-11-28 14:48:12 +03:00
Recep Aslantas
9af61d2101
vec: use _negate instead of _flipsign and _inv
2018-11-28 10:50:21 +03:00
Recep Aslantas
463099350a
vec: use _negate instead of _flipsign and _inv
...
* negate is better and common name, flipsign is deprecated now.
2018-11-28 10:28:00 +03:00
Recep Aslantas
43c4d05d4a
new version for clamp: clamp to zero and one
2018-07-12 11:39:56 +03:00
Recep Aslantas
3dc9070909
squared distance for vec3
2018-05-30 23:35:59 +03:00
Recep Aslantas
7d783eeace
align local variables on stack
2018-05-23 23:04:06 +03:00
Recep Aslantas
826ddf0f5b
improve normalize vectors
2018-04-15 12:46:29 +03:00
Recep Aslantas
b09b5f260b
vec: fix rotate vector using mat4 and mat3 rotation matrices
2018-04-15 12:44:50 +03:00
Recep Aslantas
d6395d4fb8
vec: optimize rotate vector using matrix
...
* add mat3 version
2018-04-13 22:33:32 +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
af5a2627b4
fix scale_as for zero length vector
...
* return zero if vector length is zero
2018-04-13 11:57:34 +03:00