From 72b8d26fcfcee36ca67f963b9c6a4b616e2d5d4d Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Mon, 12 Aug 2024 00:15:33 +1000 Subject: scale is a vec3 now instead of float. --- src/maths/maths.h | 10 +++++----- src/maths/maths_types.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/maths') diff --git a/src/maths/maths.h b/src/maths/maths.h index 9e71f79..fc23517 100644 --- a/src/maths/maths.h +++ b/src/maths/maths.h @@ -147,11 +147,11 @@ static Mat4 mat4_translation(Vec3 position) { return out_matrix; } -static Mat4 mat4_scale(f32 scale) { +static Mat4 mat4_scale(Vec3 scale) { Mat4 out_matrix = mat4_ident(); - out_matrix.data[0] = scale; - out_matrix.data[5] = scale; - out_matrix.data[10] = scale; + out_matrix.data[0] = scale.x; + out_matrix.data[5] = scale.y; + out_matrix.data[10] = scale.z; return out_matrix; } @@ -307,7 +307,7 @@ static inline Mat4 mat4_look_at(Vec3 position, Vec3 target, Vec3 up) { .scale = 1.0, \ .is_dirty = false }) -static Transform transform_create(Vec3 pos, Quat rot, f32 scale) { +static Transform transform_create(Vec3 pos, Quat rot, Vec3 scale) { return (Transform){ .position = pos, .rotation = rot, .scale = scale, .is_dirty = true }; } diff --git a/src/maths/maths_types.h b/src/maths/maths_types.h index 2f84774..ef1fe4a 100644 --- a/src/maths/maths_types.h +++ b/src/maths/maths_types.h @@ -53,7 +53,7 @@ typedef Bbox_3D Aabb_3D; typedef struct Transform { Vec3 position; Quat rotation; - f32 scale; + Vec3 scale; bool is_dirty; } Transform; -- cgit v1.2.3-70-g09d2