forked from lokesh-sharma/GameEngine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFreeLook.h
More file actions
33 lines (28 loc) · 905 Bytes
/
FreeLook.h
File metadata and controls
33 lines (28 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef FREELOOK_H
#define FREELOOK_H
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include<glm/detail/func_geometric.hpp>
#include"InputHandler.h"
#include"transform.h"
#include "GameComponent.h"
#include"camera.h"
#include<iostream>
class InputHandler;
class FreeLook : public Camera
{
public:
FreeLook(const glm::vec3& pos, float fov, float aspect, float zNear, float zFar);
void update();
glm::mat4 getMVP() const ;
glm::mat4 getModel() const { return getTransform()->GetModel()*m_transform.GetModel();}
virtual glm::quat getRot() const { return m_transform.GetRot()*getTransform()->GetRot() ;}
Transform* getLocalTransform() { return &m_transform ; }
glm::vec3 getPos() const;
void addToEngine(CoreEngine* core);
private:
glm::vec2 screenMiddle;
mutable Transform m_transform;
void move(const glm::vec3 direction , float distance);
};
#endif // FREELOOK_H