aboutsummaryrefslogtreecommitdiff
path: root/src/vecmath.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-06-10 02:42:44 +0800
committerMistivia <i@mistivia.com>2025-06-10 02:42:44 +0800
commit07f3a1a5751e141c414d77e57c0e631feb441ef3 (patch)
tree9d15ef0ec323ce91972463fd7730f2543ca917a6 /src/vecmath.h
parentc65dc6eab16410deb741797918df58348d7a0d04 (diff)
restructure
Diffstat (limited to 'src/vecmath.h')
-rw-r--r--src/vecmath.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vecmath.h b/src/vecmath.h
new file mode 100644
index 0000000..3b6f5b6
--- /dev/null
+++ b/src/vecmath.h
@@ -0,0 +1,33 @@
+#ifndef VECMATH_H_
+#define VECMATH_H_
+
+#include <stdint.h>
+
+typedef struct {
+ int x;
+ int y;
+} Vec2i;
+
+typedef struct {
+ float x;
+ float y;
+ float z;
+} Vec3f;
+
+typedef struct {
+ float r;
+ float g;
+ float b;
+} Color;
+
+
+Vec3f vec3f_sub(Vec3f lhs, Vec3f rhs);
+Vec3f vec3f_add(Vec3f lhs, Vec3f rhs);
+float vec3f_dot(Vec3f lhs, Vec3f rhs);
+Vec3f vec3f_neg(Vec3f v);
+Vec3f vec3f_normalize(Vec3f vec);
+Vec3f vec3f_mul(float a, Vec3f v);
+void vec3f_show(const char *name, Vec3f v);
+Color icolor(int32_t rgb);
+
+#endif