Update Camera API

This commit is contained in:
Linloir 2022-12-12 15:45:34 +08:00
parent 66997698c8
commit fc1eecde09
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
2 changed files with 17 additions and 4 deletions

View File

@ -1 +1,5 @@
#pragma once
#include <GLM/ext/matrix_transform.hpp>
#include "camera.h"

View File

@ -4,17 +4,26 @@
class Camera {
private:
// Camera state
glm::vec3 _position;
glm::vec3 _direction;
glm::vec3 _right;
glm::vec3 _front;
glm::vec3 _up;
float _zoom;
float _yawRad;
float _pitchRad;
float _rollRad;
float _zoom;
//private:
// // Camera settings
// float _moveStep;
// float _yawStep;
// float _pitchStep;
// float _rollStep;
private:
glm::vec3 frontVec();
// World settings
glm::vec3 _worldUp;
public:
Camera();
@ -23,7 +32,7 @@ public:
~Camera();
public:
glm::mat4 viewMatrix();
inline glm::mat4 viewMatrix();
public:
void move(glm::vec3 deltaVec);