diff options
Diffstat (limited to 'engine/xe_camera.cpp')
-rw-r--r-- | engine/xe_camera.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/xe_camera.cpp b/engine/xe_camera.cpp index 2174a24..42b4def 100644 --- a/engine/xe_camera.cpp +++ b/engine/xe_camera.cpp @@ -5,7 +5,7 @@ namespace xe { -void XeCamera::setOrthographicProjection( +void Camera::setOrthographicProjection( float left, float right, float top, float bottom, float near, float far) { projectionMatrix = glm::mat4{1.0f}; projectionMatrix[0][0] = 2.f / (right - left); @@ -16,7 +16,7 @@ void XeCamera::setOrthographicProjection( projectionMatrix[3][2] = -near / (far - near); } -void XeCamera::setPerspectiveProjection(float fovy, float aspect, float near, float far) { +void Camera::setPerspectiveProjection(float fovy, float aspect, float near, float far) { assert(glm::abs(aspect - std::numeric_limits<float>::epsilon()) > 0.0f); const float tanHalfFovy = tan(fovy / 2.f); projectionMatrix = glm::mat4{0.0f}; @@ -27,7 +27,7 @@ void XeCamera::setPerspectiveProjection(float fovy, float aspect, float near, fl projectionMatrix[3][2] = -(far * near) / (far - near); } -void XeCamera::setViewDirection(glm::vec3 position, glm::vec3 direction, glm::vec3 up) { +void Camera::setViewDirection(glm::vec3 position, glm::vec3 direction, glm::vec3 up) { const glm::vec3 w{glm::normalize(direction)}; const glm::vec3 u{glm::normalize(glm::cross(w, up))}; const glm::vec3 v{glm::cross(w, u)}; @@ -47,11 +47,11 @@ void XeCamera::setViewDirection(glm::vec3 position, glm::vec3 direction, glm::ve viewMatrix[3][2] = -glm::dot(w, position); } -void XeCamera::setViewTarget(glm::vec3 position, glm::vec3 target, glm::vec3 up) { +void Camera::setViewTarget(glm::vec3 position, glm::vec3 target, glm::vec3 up) { setViewDirection(position, target - position, up); } -void XeCamera::setViewYXZ(glm::vec3 position, glm::vec3 rotation) { +void Camera::setViewYXZ(glm::vec3 position, glm::vec3 rotation) { const float c3 = glm::cos(rotation.z); const float s3 = glm::sin(rotation.z); const float c2 = glm::cos(rotation.x); |