Added ortho cam getters
This commit is contained in:
parent
94785e586c
commit
785de6f1f6
37
Camera.cpp
37
Camera.cpp
@ -156,18 +156,29 @@ OrthographicCamera::OrthographicCamera(
|
|||||||
_proj = glm::ortho(_leftPlane, _rightPlane, _bottomPlane, _topPlane, _nearPlane, _farPlane);
|
_proj = glm::ortho(_leftPlane, _rightPlane, _bottomPlane, _topPlane, _nearPlane, _farPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float OrthographicCamera::getLeftPlane() const { return _leftPlane; }
|
||||||
|
|
||||||
|
float OrthographicCamera::getRightPlane() const { return _rightPlane; }
|
||||||
|
|
||||||
|
float OrthographicCamera::getBottomPlane() const { return _bottomPlane; }
|
||||||
|
|
||||||
|
float OrthographicCamera::getTopPlane() const { return _topPlane; }
|
||||||
|
|
||||||
|
float OrthographicCamera::getNearPlane() const { return _nearPlane; }
|
||||||
|
|
||||||
|
float OrthographicCamera::getFarPlane() const { return _farPlane; }
|
||||||
|
|
||||||
// PerspectiveCamera class
|
// PerspectiveCamera class
|
||||||
/* PerspectiveCamera::PerspectiveCamera(
|
PerspectiveCamera::PerspectiveCamera(
|
||||||
const Vec3& pos,
|
const Vec3& pos=Vec3(1.0f, 0.0f, 0.0f),
|
||||||
const Vec3& tar,
|
const Vec3& tar=Vec3(0.0f, 0.0f, 0.0f),
|
||||||
const Vec3& up,
|
const Vec3& up =Vec3(0.0f, 1.0f, 0.0f),
|
||||||
float left,
|
float fov = 45.0f,
|
||||||
float right,
|
float aspectRatio = 1.0f,
|
||||||
float bottom,
|
float near = -1.0f,
|
||||||
float top,
|
float far = 1.0f
|
||||||
float near,
|
) : Camera(pos, tar, up), _fov(fov), _ratio(aspectRatio), _nearPlane(near), _farPlane(far) {
|
||||||
float far
|
_proj = glm::perspective(glm::radians(_fov), _ratio, _nearPlane, _farPlane);
|
||||||
) : Camera(pos, tar, up), _leftPlane(left), _rightPlane(right), _bottomPlane(bottom), _topPlane(top), _nearPlane(near), _farPlane(far) {
|
}
|
||||||
_proj = glm::ortho(_leftPlane, _rightPlane, _bottomPlane, _topPlane, _nearPlane, _farPlane);
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
@ -90,6 +90,20 @@ public:
|
|||||||
float far = 1.0f
|
float far = 1.0f
|
||||||
);
|
);
|
||||||
|
|
||||||
|
float getLeftPlane() const;
|
||||||
|
float getRightPlane() const;
|
||||||
|
float getBottomPlane() const;
|
||||||
|
float getTopPlane() const;
|
||||||
|
float getNearPlane() const;
|
||||||
|
float getFarPlane() const;
|
||||||
|
|
||||||
|
void setLeftPlane(float);
|
||||||
|
void setRightPlane(float);
|
||||||
|
void setBottomPlane(float);
|
||||||
|
void setTopPlane(float);
|
||||||
|
void setNearPlane(float);
|
||||||
|
void setFarPlane(float);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _leftPlane, _rightPlane, _topPlane, _bottomPlane, _nearPlane, _farPlane;
|
float _leftPlane, _rightPlane, _topPlane, _bottomPlane, _nearPlane, _farPlane;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user