add mapf and unmixf

main
Dominik Madarász 2024-08-16 09:04:01 +02:00
parent 48a6bd5911
commit 926a48bc50
7 changed files with 17 additions and 0 deletions

View File

@ -1,4 +1,7 @@
@echo off @echo off
call razzle amd64 call razzle amd64
if exist .env.bat (
call .env.bat
)
code . code .
exit exit

View File

@ -99,6 +99,8 @@ typedef float mat44[16];
float signf (float a) ; float signf (float a) ;
float clampf (float v,float a,float b); float clampf (float v,float a,float b);
float mixf (float a,float b,float t); float mixf (float a,float b,float t);
float unmixf (float a,float b,float t);
float mapf (float x,float a,float b,float c,float d);
float slerpf (float a,float b,float t); float slerpf (float a,float b,float t);
float fractf (float a); float fractf (float a);
vec2 ptr2 (const float *a ); vec2 ptr2 (const float *a );

View File

@ -14956,6 +14956,8 @@ API float pmodf (float a, float b);
API float signf (float a) ; API float signf (float a) ;
API float clampf (float v,float a,float b); API float clampf (float v,float a,float b);
API float mixf (float a,float b,float t); API float mixf (float a,float b,float t);
API float unmixf (float a,float b,float t);
API float mapf (float x,float a,float b,float c,float d);
API float slerpf (float a,float b,float t); API float slerpf (float a,float b,float t);
API float fractf (float a); API float fractf (float a);
@ -377005,6 +377007,8 @@ float pmodf (float a, float b) { return (a < 0.0f ? 1.0f : 0.0f) + (float)f
float signf (float a) { return (a < 0) ? -1.f : 1.f; } float signf (float a) { return (a < 0) ? -1.f : 1.f; }
float clampf(float v,float a,float b){return maxf(minf(b,v),a); } float clampf(float v,float a,float b){return maxf(minf(b,v),a); }
float mixf(float a,float b,float t) { return a*(1-t)+b*t; } float mixf(float a,float b,float t) { return a*(1-t)+b*t; }
float unmixf(float a,float b,float t) { return (t - a) / (b - a); }
float mapf(float x,float a,float b,float c,float d) { return (x - a) / (b - a) * (d - c) + c; }
float slerpf(float a,float b,float t) { float slerpf(float a,float b,float t) {
a = fmod(a, 360); if (a < 0) a += 360; a = fmod(a, 360); if (a < 0) a += 360;
b = fmod(b, 360); if (b < 0) b += 360; b = fmod(b, 360); if (b < 0) b += 360;

View File

@ -90,6 +90,8 @@ float pmodf (float a, float b) { return (a < 0.0f ? 1.0f : 0.0f) + (float)f
float signf (float a) { return (a < 0) ? -1.f : 1.f; } float signf (float a) { return (a < 0) ? -1.f : 1.f; }
float clampf(float v,float a,float b){return maxf(minf(b,v),a); } float clampf(float v,float a,float b){return maxf(minf(b,v),a); }
float mixf(float a,float b,float t) { return a*(1-t)+b*t; } float mixf(float a,float b,float t) { return a*(1-t)+b*t; }
float unmixf(float a,float b,float t) { return (t - a) / (b - a); }
float mapf(float x,float a,float b,float c,float d) { return (x - a) / (b - a) * (d - c) + c; }
float slerpf(float a,float b,float t) { float slerpf(float a,float b,float t) {
a = fmod(a, 360); if (a < 0) a += 360; a = fmod(a, 360); if (a < 0) a += 360;
b = fmod(b, 360); if (b < 0) b += 360; b = fmod(b, 360); if (b < 0) b += 360;

View File

@ -64,6 +64,8 @@ API float pmodf (float a, float b);
API float signf (float a) ; API float signf (float a) ;
API float clampf (float v,float a,float b); API float clampf (float v,float a,float b);
API float mixf (float a,float b,float t); API float mixf (float a,float b,float t);
API float unmixf (float a,float b,float t);
API float mapf (float x,float a,float b,float c,float d);
API float slerpf (float a,float b,float t); API float slerpf (float a,float b,float t);
API float fractf (float a); API float fractf (float a);

View File

@ -12188,6 +12188,8 @@ float pmodf (float a, float b) { return (a < 0.0f ? 1.0f : 0.0f) + (float)f
float signf (float a) { return (a < 0) ? -1.f : 1.f; } float signf (float a) { return (a < 0) ? -1.f : 1.f; }
float clampf(float v,float a,float b){return maxf(minf(b,v),a); } float clampf(float v,float a,float b){return maxf(minf(b,v),a); }
float mixf(float a,float b,float t) { return a*(1-t)+b*t; } float mixf(float a,float b,float t) { return a*(1-t)+b*t; }
float unmixf(float a,float b,float t) { return (t - a) / (b - a); }
float mapf(float x,float a,float b,float c,float d) { return (x - a) / (b - a) * (d - c) + c; }
float slerpf(float a,float b,float t) { float slerpf(float a,float b,float t) {
a = fmod(a, 360); if (a < 0) a += 360; a = fmod(a, 360); if (a < 0) a += 360;
b = fmod(b, 360); if (b < 0) b += 360; b = fmod(b, 360); if (b < 0) b += 360;

View File

@ -1023,6 +1023,8 @@ API float pmodf (float a, float b);
API float signf (float a) ; API float signf (float a) ;
API float clampf (float v,float a,float b); API float clampf (float v,float a,float b);
API float mixf (float a,float b,float t); API float mixf (float a,float b,float t);
API float unmixf (float a,float b,float t);
API float mapf (float x,float a,float b,float c,float d);
API float slerpf (float a,float b,float t); API float slerpf (float a,float b,float t);
API float fractf (float a); API float fractf (float a);