Skip to content
Snippets Groups Projects
Commit cb9928ba authored by Vanessa Karolek's avatar Vanessa Karolek
Browse files

[#42][Doc] add documentation to TrackballCamera class, adjust documentation of Camera

parent 399036df
No related branches found
No related tags found
1 merge request!35Resolve "Kamera - Trackballkamera"
Pipeline #25355 passed
......@@ -74,11 +74,11 @@ namespace vkcv {
void getView(glm::vec3 &x, glm::vec3 &y, glm::vec3 &z, glm::vec3 &pos);
/**
* @brief Updates the view matrix of the camera with respect to @p deltatime
* @param deltatime The time past between frames
* @return
* @brief Updates the view matrix of the camera with respect to @p deltaTime
* @param deltaTime The time that has passed since last update
* @return The updated view matrix of the camera
*/
glm::mat4 updateView(double deltatime);
glm::mat4 updateView(double deltaTime);
/**
* @brief Sets the view matrix of the camera according to @p position, @p center and @p up
......@@ -127,7 +127,7 @@ namespace vkcv {
/**
* @brief Changes the field of view of the camera with an @p offset in degrees
* @param[in] offset in degrees
* @param[in] offset The offset in degrees
*/
void changeFov(double offset);
......
......@@ -12,28 +12,76 @@ namespace vkcv {
public:
/**
* @brief The default constructor of the trackball camera
*/
TrackballCamera();
/**
* @brief The destructor of the trackball camera (default behavior)
*/
~TrackballCamera();
/**
* @brief Gets the radius of the trackball camera that specifies the distance of the trackball camera to the center point
* @return The radius of the trackball camera
*/
float getRadius();
/**
* @brief Sets the current radius of the trackball camera to @p radius
* @param[in] radius The new radius of the trackball camera
*/
void setRadius(float radius);
glm::vec3 &getCenter();
/**
* @brief Gets the center point the trackball camera is looking at
* @return The center point of the trackball camera
*/
glm::vec3& getCenter();
/**
* @brief Sets the current center point of the trackball camera to @p center
* @param[in] center The new center point of the trackball camera
*/
void setCenter(const glm::vec3 &center);
/**
* @brief Sets the pitch value of the trackball camera to @p pitch
* @param[in] pitch The new pitch value of the trackball camera
*/
void setPitch(float pitch);
/**
* @brief Sets the yaw value of the trackball camera to @p yaw
* @param[in] yaw The new yaw value of the trackball camera
*/
void setYaw(float yaw);
void changeFov(double fov);
/**
* @brief Changes the field of view of the trackball camera with an @p offset in degrees
* @param[in] offset The offset in degrees
*/
void changeFov(double offset);
/**
* @brief Pans the view of the trackball camera according to the pitch and yaw values and additional offsets @p xOffset and @p yOffset (e.g. taken from mouse movement)
* @param[in] xOffset The offset added to the yaw value
* @param[in] yOffset The offset added to the pitch value
*/
void panView(double xOffset, double yOffset);
/**
* @brief Updates the view matrix of the trackball camera with respect to @p deltatime
* @param deltaTime The time that has passed since last update
* @return The updated view matrix of the trackball camera
*/
glm::mat4 updateView(double deltaTime);
/**
* @brief Updates the position of the trackball camera with respect to @p deltaTime
* @param[in] deltaTime The time that has passed since last update
*/
void updatePosition(double deltaTime);
};
......
......@@ -27,8 +27,8 @@ namespace vkcv {
m_view = glm::lookAt(position, center, up);
}
glm::mat4 Camera::updateView(double deltatime){
updatePosition(deltatime);
glm::mat4 Camera::updateView(double deltaTime){
updatePosition(deltaTime);
return m_view = glm::lookAt(m_position, m_position + getFront() , m_up);
}
......
......@@ -53,8 +53,8 @@ namespace vkcv {
m_yaw = yaw;
}
void TrackballCamera::changeFov(double fov) {
setRadius(m_radius - fov * m_scrollSensitivity);
void TrackballCamera::changeFov(double offset) {
setRadius(m_radius - offset * m_scrollSensitivity);
}
void TrackballCamera::panView(double xOffset, double yOffset) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment