Reworked transformable

This commit is contained in:
Robert 2021-01-23 16:23:49 +01:00
parent 3e6884356f
commit a17c73d3c9
7 changed files with 177 additions and 68 deletions

View file

@ -13,6 +13,10 @@ namespace oglu
Camera::Camera() :
fov(45.0f), aspectRatio(0.0f), zNear(0.1f), zFar(100.0f), projection(new float[16]{ 0.0f })
{
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
aspectRatio = (float)viewport[2] / (float)viewport[3];
memcpy(
projection,
glm::value_ptr(glm::perspective(glm::radians(fov), aspectRatio, zNear, zFar)),