8 #include "cameracomponent.h"
11 #include <utility/dllexport.h>
15 class OrthoCameraComponentInstance;
16 class TransformComponentInstance;
17 class TransformComponent;
36 float mNearClippingPlane = 1.0f;
37 float mFarClippingPlane = 1000.0f;
38 float mLeftPlane = 0.0f;
39 float mRightPlane = 100.0f;
40 float mTopPlane = 100.0f;
41 float mBottomPlane = 0.0f;
50 inline float getWidth()
const {
return mRightPlane - mLeftPlane; }
58 inline float getHeight()
const {
return mTopPlane - mBottomPlane; }
65 float getRatio()
const {
return getHeight() / getWidth(); }
72 void adjust(
float ratio) { mTopPlane = ratio * getWidth() + mBottomPlane; }
115 virtual void setRenderTargetSize(
const glm::ivec2& size)
override;
123 virtual const glm::mat4& getProjectionMatrix()
const override;
128 virtual const glm::mat4 getViewMatrix()
const override;
157 void restoreClipRect();
162 virtual float getNearClippingPlane()
const override;
167 virtual float getFarClippingPlane()
const override;
176 virtual const glm::mat4& getRenderProjectionMatrix()
const override;
184 static glm::mat4 createRenderProjectionMatrix(
float left,
float right,
float bottom,
float top,
float zNear,
float zFar);
192 static glm::mat4 createRenderProjectionMatrix(
float left,
float right,
float bottom,
float top);
199 void setDirty() { mDirty =
true; }
204 void updateProjectionMatrices()
const;
207 mutable glm::mat4x4 mViewMatrix;
208 mutable glm::mat4x4 mProjectionMatrix;
209 mutable glm::mat4x4 mRenderProjectionMatrix;
210 mutable bool mDirty =
true;
211 OrthoCameraProperties mProperties;
212 TransformComponentInstance* mTransformComponent;