kick
|
00001 // 00002 // Created by morten on 24/05/14. 00003 // 00004 00005 #include "camera_orthographic.h" 00006 00007 #include "kick/scene/transform.h" 00008 #include "kick/core/debug.h" 00009 00010 using namespace glm; 00011 00012 namespace kick { 00013 CameraOrthographic::CameraOrthographic(GameObject *gameObject) 00014 : Camera(gameObject) 00015 { 00016 resetProjectionMatrix(); 00017 } 00018 00019 float CameraOrthographic::near() const { 00020 return mNear; 00021 } 00022 00023 void CameraOrthographic::setNear(float near) { 00024 CameraOrthographic::mNear = near; 00025 resetProjectionMatrix(); 00026 } 00027 00028 float CameraOrthographic::far() const { 00029 return mFar; 00030 } 00031 00032 void CameraOrthographic::setFar(float far) { 00033 CameraOrthographic::mFar = far; 00034 resetProjectionMatrix(); 00035 } 00036 00037 float CameraOrthographic::left() const { 00038 return mLeft; 00039 } 00040 00041 void CameraOrthographic::setLeft(float left) { 00042 CameraOrthographic::mLeft = left; 00043 resetProjectionMatrix(); 00044 } 00045 00046 float CameraOrthographic::right() const { 00047 return mRight; 00048 } 00049 00050 void CameraOrthographic::setRight(float right) { 00051 CameraOrthographic::mRight = right; 00052 resetProjectionMatrix(); 00053 } 00054 00055 float CameraOrthographic::bottom() const { 00056 return mBottom; 00057 } 00058 00059 void CameraOrthographic::setBottom(float bottom) { 00060 CameraOrthographic::mBottom = bottom; 00061 resetProjectionMatrix(); 00062 } 00063 00064 float CameraOrthographic::top() const { 00065 return mTop; 00066 } 00067 00068 void CameraOrthographic::setTop(float top) { 00069 CameraOrthographic::mTop = top; 00070 resetProjectionMatrix(); 00071 } 00072 00073 void CameraOrthographic::resetProjectionMatrix() { 00074 mProjectionMatrix = ortho( 00075 mLeft, mRight, 00076 mBottom, mTop, 00077 mNear, mFar); 00078 } 00079 00080 void CameraOrthographic::set(float near, float far, float left, float right, float bottom, float top) { 00081 this->mNear = near; 00082 this->mFar = far; 00083 this->mLeft = left; 00084 this->mRight = right; 00085 this->mBottom = bottom; 00086 this->mTop = top; 00087 resetProjectionMatrix(); 00088 } 00089 }