camera.h 599 B

1234567891011121314151617
  1. #pragma once
  2. #include "atto/math.h"
  3. struct Camera {
  4. struct AMat4f projection;
  5. struct AMat4f view_projection;
  6. struct AMat3f axes, orientation;
  7. struct AVec3f pos, dir, up;
  8. float z_near, z_far;
  9. };
  10. void cameraRecompute(struct Camera *cam);
  11. void cameraProjection(struct Camera *cam, float znear, float zfar, float horizfov, float aspect);
  12. void cameraLookAt(struct Camera *cam, struct AVec3f pos, struct AVec3f at, struct AVec3f up);
  13. void cameraMove(struct Camera *cam, struct AVec3f v);
  14. void cameraRotateYaw(struct Camera *cam, float yaw);
  15. void cameraRotatePitch(struct Camera *cam, float pitch);