mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
improve shadow map stability
This commit is contained in:
parent
b272d86619
commit
ad0396b31e
7 changed files with 68 additions and 14 deletions
|
|
@ -28,6 +28,9 @@ void Camera::rotate(float x, float y, float z) {
|
|||
}
|
||||
|
||||
glm::mat4 Camera::getProjection() const {
|
||||
if (projset) {
|
||||
return projection;
|
||||
}
|
||||
if (perspective) {
|
||||
return glm::perspective(fov * zoom, ar, near, far);
|
||||
} else if (flipped) {
|
||||
|
|
@ -62,6 +65,11 @@ float Camera::getFov() const {
|
|||
return fov;
|
||||
}
|
||||
|
||||
void Camera::setProjection(const glm::mat4& matrix) {
|
||||
projection = matrix;
|
||||
projset = true;
|
||||
}
|
||||
|
||||
float Camera::getAspectRatio() const {
|
||||
return ar;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue