Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "Math/Vector.h"
- #include "Math/Matrix.h"
- #include "World/Transform.h"
- struct SimpleCamera
- {
- private:
- Transform m_Transform;
- float m_ZNear = 0.01f;
- float m_ZFar = 100;
- float m_Aspect = 0.0f;
- float m_FovY = 60.0f;
- float m_NearFrustrumHeight = 0.0f;
- float m_FarFrustrumHeight = 0.0f;
- float m_Yaw = 0;
- float m_Pitch = 0;
- bool m_ViewDirty = true;
- Matrix4 m_View = Matrix4::Identity();
- Matrix4 m_Proj = Matrix4::Identity();
- public:
- SimpleCamera();
- ~SimpleCamera();
- public:
- Vector3 GetPosition()const;
- void SetPosition(const Vector3& v);
- Vector3 GetRight()const;
- Vector3 GetUp()const;
- Vector3 GetForward()const;
- float GetNearZ()const;
- float GetFarZ()const;
- float GetAspect()const;
- float GetFovX()const;
- float GetFoxY()const;
- float GetNearWindowWidth()const;
- float GetNearWindowHeight()const;
- float GetFarWindowWidth()const;
- float GetFarWindowHeight()const;
- float GetFocalLength()const;
- // Pass FOV as degree.
- void SetFrustrum(float fovDeg, float aspect, float zNear, float zFar);
- // Pass FOV as degree.
- void SetFOV(float fovDeg);
- Matrix4 GetView()const;
- Matrix4 GetProj()const;
- Matrix4 GetViewProject()const;
- void Move(const Vector3& translate);
- void Rotation(const Vector3& euler);
- void Rotate(float yaw, float pitch);
- void LookAt(Vector3 target);
- void Update();
- void OnGui();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement