diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-31 00:48:11 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-31 00:48:11 +1100 |
commit | c4bf1916fe219324e14384fc938e767daeab26c9 (patch) | |
tree | 84b33ea8feff5792f77a8e832b66c2a23f1104b5 /examples/input/ex_input.c | |
parent | b638fd776253fa0cb841175e3e134df4587101b6 (diff) |
working on cube (hardcoded)
Diffstat (limited to 'examples/input/ex_input.c')
-rw-r--r-- | examples/input/ex_input.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/input/ex_input.c b/examples/input/ex_input.c index 0e72c16..f102fad 100644 --- a/examples/input/ex_input.c +++ b/examples/input/ex_input.c @@ -6,8 +6,10 @@ #include "keys.h" #include "maths.h" #include "maths_types.h" +#include "primitives.h" #include "render.h" #include "render_backend.h" +#include "render_types.h" typedef struct game_state { camera camera; @@ -21,12 +23,15 @@ void update_camera_rotation(input_state* input, game_state* game, camera* cam); int main() { core* core = core_bringup(); + vec3 cam_pos = vec3_create(-15, 20.0, 13); game_state game = { - .camera = camera_create(vec3_create(0, 0, 30), vec3_create(0, 0, -1), VEC3_Y, deg_to_rad(45.0)), + .camera = camera_create(cam_pos, vec3_negate(cam_pos), VEC3_Y, deg_to_rad(45.0)), .camera_euler = vec3_create(90, 0, 0), .first_mouse_update = true, }; + // model_handle cube_handle = prim_cube_new(core); + printf("Starting look direction: "); print_vec3(game.camera.front); @@ -53,12 +58,13 @@ int main() { translation = vec3_mult(lateral, camera_speed); } game.camera.position = vec3_add(game.camera.position, translation); - update_camera_rotation(&core->input, &game, &game.camera); + // update_camera_rotation(&core->input, &game, &game.camera); // UNUSED: threadpool_process_results(&core->threadpool, 1); render_frame_begin(&core->renderer); + // model cube = core->models->data[cube_handle.raw]; mat4 model = mat4_translation(VEC3_ZERO); gfx_backend_draw_frame(&core->renderer, &game.camera, model); |