From 399036dfc65c4e6c119b6ea50e1185d736c96ab0 Mon Sep 17 00:00:00 2001 From: Vanessa Karolek <vaka1997@uni-koblenz.de> Date: Tue, 1 Jun 2021 18:43:07 +0200 Subject: [PATCH] [#42][Doc] add documentation for CameraManager class --- .../include/vkcv/camera/CameraManager.hpp | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/modules/camera/include/vkcv/camera/CameraManager.hpp b/modules/camera/include/vkcv/camera/CameraManager.hpp index 5651ebd9..1ee3a31c 100644 --- a/modules/camera/include/vkcv/camera/CameraManager.hpp +++ b/modules/camera/include/vkcv/camera/CameraManager.hpp @@ -24,17 +24,64 @@ namespace vkcv{ double m_lastX ; double m_lastY ; + /** + * @brief Binds the camera object to the window event handles + */ void bindCamera(); + + /** + * @brief A callback function for key events. Currently, camera movement via W, A, S, D and window closure via Escape are supported + * @param[in] key The keyboard key + * @param[in] scancode The platform-specific scancode + * @param[in] action The key action + * @param[in] mods The modifier bits + */ void keyCallback(int key, int scancode, int action, int mods); + + /** + * @brief A callback function for mouse scrolling events. Currently, this leads to changes in the field of view of the camera object + * @param[in] offsetX The offset in horizontal direction + * @param[in] offsetY The offset in vertical direction + */ void scrollCallback( double offsetX, double offsetY); + + /** + * @brief A callback function for mouse movement events. Currently, this leads to panning the view of the camera, if @fn mouseButtonCallback(int button, int action, int mods) enabled panning. + * @param[in] offsetX The offset in horizontal direction + * @param[in] offsetY The offset in vertical direction + */ void mouseMoveCallback( double offsetX, double offsetY); + + /** + * @brief A callback function for mouse button events. Currently, the right mouse button enables panning the view of the camera as long as it is pressed. + * @param[in] button The mouse button + * @param[in] action The button action + * @param[in] mods The modifier bits + */ void mouseButtonCallback(int button, int action, int mods); public: + + /** + * @brief The constructor + * @param[in] window The window + * @param[in] width The width of the window + * @param[in] height The height of the window + * @param[in] up The up vector of the camera. Per default: @code{.cpp} up = glm::vec3(0.0f, -1.0f, 0.0f) @endcode + * @param[in] position The position of the camera. Per default: @code{.cpp} position = glm::vec3(0.0f,0.0f,0.0f) @endcode + */ CameraManager(Window &window, float width, float height, glm::vec3 up = glm::vec3(0.0f,-1.0f,0.0f), glm::vec3 position = glm::vec3(0.0f,0.0f,0.0f)); + /** + * @brief Gets the camera object + * @return The camera object + */ Camera& getCamera(); + /** + * @brief Gets the trackball camera object + * @return The trackball camera object + */ TrackballCamera& getTrackballCamera(); }; } -- GitLab