kick
|
00001 // 00002 // Created by morten on 24/05/14. 00003 // 00004 00005 00006 #include "kick/scene/camera.h" 00007 #include "kick/scene/game_object.h" 00008 #include "glm/gtc/constants.hpp" 00009 00010 #pragma once 00011 00012 namespace kick { 00013 class CameraPerspective : public Camera { 00014 public: 00015 CameraPerspective(GameObject *gameObject); 00016 float near() const; 00017 void setNear(float near); 00018 float far() const; 00019 void setFar(float far); 00020 float fieldOfViewY() const; 00021 float fieldOfViewX() const; 00022 void setFieldOfViewY(float fieldOfViewY); 00023 void set(float near, float far, float fieldOfView); 00024 virtual void resetProjectionMatrix() override; 00025 private: 00026 void update(glm::ivec2 viewportDimension); 00027 float mNear = 0.1f; 00028 float mFar = 1000.0f; 00029 float mFieldOfViewY = glm::radians(60.0f); 00030 EventListener<glm::ivec2> viewportListener; 00031 }; 00032 } 00033