add angle funcs
This commit is contained in:
@@ -241,3 +241,11 @@ float *rgba2floats(float *r, struct rgba c)
|
|||||||
r[3] = (float)c.a / RGBA_MAX;
|
r[3] = (float)c.a / RGBA_MAX;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JSValue angle2js(JSContext *js, double angle) {
|
||||||
|
return number2js(js, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
double js2angle(JSContext *js, JSValue v) {
|
||||||
|
return js2number(js, v);
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ JSValue vec32js(JSContext *js, HMM_Vec3 v);
|
|||||||
JSValue vec42js(JSContext *js, HMM_Vec4 v);
|
JSValue vec42js(JSContext *js, HMM_Vec4 v);
|
||||||
JSValue quat2js(JSContext *js, HMM_Quat q);
|
JSValue quat2js(JSContext *js, HMM_Quat q);
|
||||||
JSValue color2js(JSContext *js, colorf c);
|
JSValue color2js(JSContext *js, colorf c);
|
||||||
JSValue number2js(JSContext *js, double d);
|
|
||||||
JSValue angle2js(JSContext *js, double a);
|
JSValue angle2js(JSContext *js, double a);
|
||||||
|
|
||||||
rect js2rect(JSContext *js, JSValue v);
|
rect js2rect(JSContext *js, JSValue v);
|
||||||
@@ -45,7 +44,6 @@ HMM_Vec3 js2vec3(JSContext *js, JSValue v);
|
|||||||
HMM_Vec4 js2vec4(JSContext *js, JSValue v);
|
HMM_Vec4 js2vec4(JSContext *js, JSValue v);
|
||||||
HMM_Quat js2quat(JSContext *js, JSValue v);
|
HMM_Quat js2quat(JSContext *js, JSValue v);
|
||||||
colorf js2color(JSContext *js, JSValue v);
|
colorf js2color(JSContext *js, JSValue v);
|
||||||
double js2number(JSContext *js, JSValue v);
|
|
||||||
double js2angle(JSContext *js, JSValue v);
|
double js2angle(JSContext *js, JSValue v);
|
||||||
|
|
||||||
#define RGBA_MAX 255
|
#define RGBA_MAX 255
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "stb_ds.h"
|
#include "stb_ds.h"
|
||||||
#include "qjs_actor.h"
|
#include "qjs_actor.h"
|
||||||
#include "wota.h"
|
#include "wota.h"
|
||||||
#include "qjs_wota.h"
|
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user