Skip to content
Snippets Groups Projects
Verified Commit 54896c41 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#35] Changed getter methods to be const

parent 24cf098b
No related branches found
No related tags found
1 merge request!26Resolve "Kamera - Erstellung und Handling"
Pipeline #25167 passed
......@@ -37,7 +37,7 @@ namespace vkcv {
void setPerspective(float fov, float ratio, float near, float far);
const glm::mat4 getView();
const glm::mat4 getView() const;
void getView(glm::vec3 &x, glm::vec3 &y, glm::vec3 &z, glm::vec3 &pos);
......@@ -45,27 +45,27 @@ namespace vkcv {
void lookAt(glm::vec3 position, glm::vec3 center, glm::vec3 up);
const glm::mat4& getProjection();
const glm::mat4& getProjection() const;
void setProjection(const glm::mat4 projection);
void getNearFar(float &near, float &far);
void getNearFar(float &near, float &far) const;
void setUp(const glm::vec3 &Up);
float getFov();
float getFov() const;
void setFov(float fov);
void updateRatio(float ratio);
float getRatio();
float getRatio() const;
void setNearFar(float near, float far);
glm::vec3 getFront();
glm::vec3 getFront() const;
glm::vec3 getPosition();
glm::vec3 getPosition() const;
void setPosition( glm::vec3 position );
......
......@@ -37,17 +37,17 @@ namespace vkcv {
pos = -mat_inv * pos;
}
void Camera::getNearFar( float &near, float &far) {
void Camera::getNearFar( float &near, float &far) const {
near = m_near;
far = m_far;
}
const glm::mat4 Camera::getView() {
const glm::mat4 Camera::getView() const {
return m_view;
}
const glm::mat4& Camera::getProjection() {
const glm::mat4& Camera::getProjection() const {
return m_projection;
}
......@@ -55,7 +55,7 @@ namespace vkcv {
m_projection = projection;
}
float Camera::getFov(){
float Camera::getFov() const {
return m_fov;
}
......@@ -69,7 +69,7 @@ namespace vkcv {
setPerspective( m_fov, m_ratio, m_near, m_far);
}
float Camera::getRatio(){
float Camera::getRatio() const {
return 0.0f;
}
......@@ -87,7 +87,7 @@ namespace vkcv {
m_projection = glm::perspective( m_fov, ratio, m_near, m_far);
}
glm::vec3 Camera::getFront(){
glm::vec3 Camera::getFront() const {
glm::vec3 direction;
direction.x = sin(glm::radians(m_yaw)) * cos(glm::radians(m_pitch));
direction.y = sin(glm::radians(m_pitch));
......@@ -95,7 +95,7 @@ namespace vkcv {
return glm::normalize(direction);
}
glm::vec3 Camera::getPosition(){
glm::vec3 Camera::getPosition() const {
return m_position;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment