improve sprite render speed; particle rendering

This commit is contained in:
2025-01-13 15:35:04 -06:00
parent 653748363f
commit dab13a1f54
8 changed files with 449 additions and 143 deletions

View File

@@ -9,13 +9,19 @@ typedef struct transform {
HMM_Vec3 scale;
HMM_Quat rotation;
HMM_Mat4 cache;
HMM_Mat3 cache3;
HMM_Mat3 gcache3;
HMM_Mat4 gcache;
int dirty;
struct transform *parent;
struct transform *children;
} transform;
transform *make_transform();
void transform_apply(transform *t);
void transform_free(JSRuntime *rt,transform *t);
void transform_apply(transform *t);
#define VEC2_FMT "[%g,%g]"
#define VEC2_MEMS(s) (s).x, (s).y
@@ -40,6 +46,9 @@ HMM_Vec3 mat3_t_dir(HMM_Mat4 m, HMM_Vec3 dir);
HMM_Mat4 transform2mat(transform *t);
HMM_Mat3 transform2mat3(transform *t);
HMM_Mat3 transform2mat3_global(transform *t);
transform mat2transform(HMM_Mat4 m);
HMM_Quat angle2rotation(float angle);