AnimTestbed/src/Camera.h

44 lines
724 B
C

//
// Created by martin on 19.10.21.
//
#ifndef RBDLSIM_RENDER_UTILS_H
#define RBDLSIM_RENDER_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
float mtxProj[16];
float mtxView[16];
float near;
float far;
float fov;
float heading;
float pitch;
float vel[3];
float pos[3];
float forward[3];
float right[3];
float up[3];
} Camera;
void Camera_Init(Camera* camera);
void Camera_CalcFromMatrix(Camera* camera, float* mtx);
void Camera_CalcToMatrix(Camera* camera, float* mtx);
void Camera_Update(
Camera* camera,
int width,
int height,
float dt,
float mouse_dx,
float mouse_dy,
float accel[3]);
#ifdef __cplusplus
}
#endif
#endif //RBDLSIM_RENDER_UTILS_H