VkCV Framework
0.0.1
CV Vulkan framework
|
Used to move around a camera object in world space. More...
#include <PilotCameraController.hpp>
Public Member Functions | |
PilotCameraController () | |
The default constructor of the PilotCameraController. | |
~PilotCameraController ()=default | |
The destructor of the PilotCameraController (default behavior). | |
void | changeFov (double offset, Camera &camera) |
Changes the field of view of camera with an offset in degrees. More... | |
void | panView (double xOffset, double yOffset, Camera &camera) |
Pans the view of camera according to the pitch and yaw values and additional offsets xOffset and yOffset . More... | |
void | updateCamera (double deltaTime, Camera &camera) |
Updates camera in respect to deltaTime . More... | |
void | keyCallback (int key, int scancode, int action, int mods, Camera &camera) |
A callback function for key events. Currently, 3D camera movement via W, A, S, D, E, Q are supported. More... | |
void | scrollCallback (double offsetX, double offsetY, Camera &camera) |
A callback function for mouse scrolling events. Currently, this leads to changes in the field of view of camera . More... | |
void | mouseMoveCallback (double x, double y, Camera &camera) |
A callback function for mouse movement events. Currently, this leads to panning the view of the camera, if #mouseButtonCallback(int button, int action, int mods) enabled panning. More... | |
void | mouseButtonCallback (int button, int action, int mods, Camera &camera) |
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. More... | |
void | gamepadCallback (int gamepadIndex, Camera &camera, double frametime) |
A callback function for gamepad input events. More... | |
![]() | |
CameraController ()=default | |
The constructor of the CameraController (default behavior). | |
Used to move around a camera object in world space.
void vkcv::camera::PilotCameraController::changeFov | ( | double | offset, |
Camera & | camera | ||
) |
Changes the field of view of camera
with an offset
in degrees.
[in] | offset | The offset in degrees. |
[in] | camera | The camera object. |
References vkcv::camera::Camera::getFov(), and vkcv::camera::Camera::setFov().
Referenced by gamepadCallback(), and scrollCallback().
|
virtual |
A callback function for gamepad input events.
gamepadIndex | The gamepad index. |
camera | The camera object. |
frametime | The current frametime. |
Implements vkcv::camera::CameraController.
References changeFov(), and panView().
|
virtual |
A callback function for key events. Currently, 3D camera movement via W, A, S, D, E, Q are supported.
[in] | key | The keyboard key. |
[in] | scancode | The platform-specific scancode. |
[in] | action | The key action. |
[in] | mods | The modifier bits. |
[in] | camera | The camera object. |
Implements vkcv::camera::CameraController.
|
virtual |
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.
[in] | button | The mouse button |
[in] | action | The button action |
[in] | mods | The modifier bits |
[in] | camera | The camera object. |
Implements vkcv::camera::CameraController.
|
virtual |
A callback function for mouse movement events. Currently, this leads to panning the view of the camera, if #mouseButtonCallback(int button, int action, int mods) enabled panning.
[in] | x | The horizontal mouse position |
[in] | y | The vertical mouse position |
[in] | camera | The camera object. |
Implements vkcv::camera::CameraController.
References panView().
void vkcv::camera::PilotCameraController::panView | ( | double | xOffset, |
double | yOffset, | ||
Camera & | camera | ||
) |
Pans the view of camera
according to the pitch and yaw values and additional offsets xOffset
and yOffset
.
[in] | xOffset | The offset added to the yaw value. |
[in] | yOffset | The offset added to the pitch value. |
[in] | camera | The camera object. |
References vkcv::camera::Camera::getPitch(), vkcv::camera::Camera::getYaw(), vkcv::camera::Camera::setPitch(), and vkcv::camera::Camera::setYaw().
Referenced by gamepadCallback(), and mouseMoveCallback().
|
virtual |
A callback function for mouse scrolling events. Currently, this leads to changes in the field of view of camera
.
[in] | offsetX | The offset in horizontal direction. |
[in] | offsetY | The offset in vertical direction. |
[in] | camera | The camera object. |
Implements vkcv::camera::CameraController.
References changeFov().
|
virtual |
Updates camera
in respect to deltaTime
.
[in] | deltaTime | The time that has passed since last update. |
[in] | camera | The camera object. |
Implements vkcv::camera::CameraController.
References vkcv::camera::Camera::getFront(), vkcv::camera::Camera::getPosition(), vkcv::camera::Camera::getUp(), and vkcv::camera::Camera::lookAt().