summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/core.c6
-rw-r--r--src/core/core.h1
-rw-r--r--src/maths/maths.c8
-rw-r--r--src/maths/maths.h8
4 files changed, 15 insertions, 8 deletions
diff --git a/src/core/core.c b/src/core/core.c
index fffb43d..b18b807 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -78,4 +78,8 @@ Core* get_global_core() { return &g_core; }
GLFWwindow* Core_GetGlfwWindowPtr(Core* core) { return g_core.window; }
-struct Renderer* Core_GetRenderer(Core* core) { return core->renderer; } \ No newline at end of file
+struct Renderer* Core_GetRenderer(Core* core) { return core->renderer; }
+
+Model* Model_Get(ModelHandle h) {
+ return Model_pool_get(&g_core.models, h);
+} \ No newline at end of file
diff --git a/src/core/core.h b/src/core/core.h
index 54e6ec3..86f5b01 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -10,6 +10,7 @@
TYPED_POOL(Model, Model)
#define MODEL_GET(h) (Model_pool_get(&g_core.models, h))
+Model* Model_Get(ModelHandle h);
typedef struct GLFWwindow GLFWwindow;
diff --git a/src/maths/maths.c b/src/maths/maths.c
index adeee3e..aedee76 100644
--- a/src/maths/maths.c
+++ b/src/maths/maths.c
@@ -24,4 +24,12 @@ c_static_inline Vec3 vec3_cross(Vec3 a, Vec3 b) {
Mat4 mat4_ident() {
return (Mat4){ .data = { 1.0, 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1.0 } };
+}
+
+Mat4 transform_to_mat(Transform *tf) {
+ Mat4 scale = mat4_scale(tf->scale);
+ Mat4 rotation = mat4_rotation(tf->rotation);
+ Mat4 translation = mat4_translation(tf->position);
+ return mat4_mult(translation, mat4_mult(rotation, scale));
+ // return mat4_mult(mat4_mult(scale, rotation), translation);
} \ No newline at end of file
diff --git a/src/maths/maths.h b/src/maths/maths.h
index 5055637..0b3760e 100644
--- a/src/maths/maths.h
+++ b/src/maths/maths.h
@@ -311,13 +311,7 @@ static Transform transform_create(Vec3 pos, Quat rot, f32 scale) {
return (Transform){ .position = pos, .rotation = rot, .scale = scale, .is_dirty = true };
}
-static Mat4 transform_to_mat(Transform *tf) {
- Mat4 scale = mat4_scale(tf->scale);
- Mat4 rotation = mat4_rotation(tf->rotation);
- Mat4 translation = mat4_translation(tf->position);
- return mat4_mult(translation, mat4_mult(rotation, scale));
- // return mat4_mult(mat4_mult(scale, rotation), translation);
-}
+ Mat4 transform_to_mat(Transform *tf);
// --- Sizing asserts