diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-05 12:48:05 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-05 12:48:05 +1000 |
commit | dfb6adbcbcc7d50b770b6d5ea82efdd8f8c32e25 (patch) | |
tree | a470b91a90716d7ea46fde53ed395449c24583a2 /archive/src/core/camera.h | |
parent | 54354e32c6498cc7f8839ab4deb1208d37216cc5 (diff) |
delete documentation workflow
Diffstat (limited to 'archive/src/core/camera.h')
-rw-r--r-- | archive/src/core/camera.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/archive/src/core/camera.h b/archive/src/core/camera.h new file mode 100644 index 0000000..4300f87 --- /dev/null +++ b/archive/src/core/camera.h @@ -0,0 +1,39 @@ +#pragma once + +#include "defines.h" +#include "maths_types.h" + +// TODO: swap to position + quaternion + +typedef struct Camera { + Vec3 position; + Vec3 front; + Vec3 up; + f32 fov; +} Camera; + +/** @brief create a camera */ +PUB Camera Camera_Create(Vec3 pos, Vec3 front, Vec3 up, f32 fov); + +/** + * @brief Get 3D camera transform matrix + * @param out_view optionally stores just the view matrix + * @param out_proj optionally stores just the projection matrix + * @returns the camera's view projection matrix pre-multiplied + */ +PUB Mat4 Camera_ViewProj(Camera* c, f32 lens_height, f32 lens_width, Mat4* out_view, + Mat4* out_proj); + +/** @brief Get 2D camera transform matrix */ +PUB Mat4 Camera_View2D(Camera* c); // TODO: 2D cameras + +struct Input_State; + +PUB void FlyCamera_Update(Camera* camera); + +// TODO: (HIGH) Basic reusable camera controls +/* +Right click + move = pan +Left click = orbit camera +WASD = forward/backward/left/right +*/ |