diff options
Diffstat (limited to 'src/maths')
-rw-r--r-- | src/maths/maths.c | 2 | ||||
-rw-r--r-- | src/maths/maths.h | 8 | ||||
-rw-r--r-- | src/maths/primitives.c | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/maths/maths.c b/src/maths/maths.c index 1c5a91a..19052fe 100644 --- a/src/maths/maths.c +++ b/src/maths/maths.c @@ -26,7 +26,7 @@ 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 transform_to_mat(Transform* tf) { Mat4 scale = mat4_scale(tf->scale); Mat4 rotation = mat4_rotation(tf->rotation); Mat4 translation = mat4_translation(tf->position); diff --git a/src/maths/maths.h b/src/maths/maths.h index fc23517..e77b81a 100644 --- a/src/maths/maths.h +++ b/src/maths/maths.h @@ -178,9 +178,9 @@ static Mat4 mat4_rotation(Quat rotation) { static Mat4 mat4_mult(Mat4 lhs, Mat4 rhs) { Mat4 out_matrix = mat4_ident(); - const f32 *m1_ptr = lhs.data; - const f32 *m2_ptr = rhs.data; - f32 *dst_ptr = out_matrix.data; + const f32* m1_ptr = lhs.data; + const f32* m2_ptr = rhs.data; + f32* dst_ptr = out_matrix.data; for (i32 i = 0; i < 4; ++i) { for (i32 j = 0; j < 4; ++j) { @@ -311,7 +311,7 @@ static Transform transform_create(Vec3 pos, Quat rot, Vec3 scale) { return (Transform){ .position = pos, .rotation = rot, .scale = scale, .is_dirty = true }; } -Mat4 transform_to_mat(Transform *tf); +Mat4 transform_to_mat(Transform* tf); // --- Sizing asserts diff --git a/src/maths/primitives.c b/src/maths/primitives.c index 13fa81b..05c31ca 100644 --- a/src/maths/primitives.c +++ b/src/maths/primitives.c @@ -31,15 +31,15 @@ Geometry Geo_CreatePlane(f32x2 extents, u32 tiling_u, u32 tiling_v) { vert_pos[i].x *= extents.x; vert_pos[i].z *= extents.y; } - VERT_3D(vertices, vert_pos[0], VEC3_Y, vec2(0, 0)); // back left - VERT_3D(vertices, vert_pos[1], VEC3_Y, vec2(1 * tiling_u, 0 * tiling_v)); // back right - VERT_3D(vertices, vert_pos[2], VEC3_Y, vec2(0, 1 * tiling_v)); // front left - VERT_3D(vertices, vert_pos[3], VEC3_Y, vec2(1 * tiling_u, 1 * tiling_v)); // front right + VERT_3D(vertices, vert_pos[0], VEC3_Y, vec2(0, 0)); // back left + VERT_3D(vertices, vert_pos[1], VEC3_Y, vec2(1 * tiling_u, 0 * tiling_v)); // back right + VERT_3D(vertices, vert_pos[2], VEC3_Y, vec2(0, 1 * tiling_v)); // front left + VERT_3D(vertices, vert_pos[3], VEC3_Y, vec2(1 * tiling_u, 1 * tiling_v)); // front right // push_triangle(indices, 0, 1, 2); // push_triangle(indices, 2, 1, 3); push_triangle(indices, 2, 1, 0); - push_triangle(indices, 1,2,3); + push_triangle(indices, 1, 2, 3); for (int i = 0; i < 4; i++) { printf("Vertex %d: (%f, %f, %f)\n", i, vert_pos[i].x, vert_pos[i].y, vert_pos[i].z); |