Vp::AbstractOrbitCamera
Abstract camera that turns around a point (pivot) at a certain distance (radius).
#include "Viewport/camera/AbstractOrbitCamera.h"
Inherits from Vp::AbstractCamera
Inherited by Vp::OrbitCamera, Vp::TrackballCamera
Public Functions
Name | |
---|---|
virtual void | centerOnBox(glm::vec3 boxMin, glm::vec3 boxMax, bool interpolate) override<br>Moves camera so that the specified axis aligned bounding box is visible. |
glm::vec3 | getPivot() const |
float | getRadius() const |
void | setPivot(const glm::vec3 & pivot) |
void | setRadius(float radius) |
Protected Attributes
Name | |
---|---|
glm::vec3 | m_pivot |
float | m_radius |
Additional inherited members
Public Types inherited from Vp::AbstractCamera
Name | |
---|---|
enum class | Viewpoint { LEFT, RIGHT, TOP, BOTTOM, FRONT, BACK} |
Public Functions inherited from Vp::AbstractCamera
Name | |
---|---|
virtual | ~AbstractCamera() =default |
virtual void | centerOnObjects(const std::vector< const GameObject * > objects)<br>Moves camera so that the specified objects are visible. |
virtual void | centerOnScene(const Scene & scene)<br>Moves camera so that all objects in the scene are visible. |
virtual void | centerOnSelection(const Scene & scene)<br>Moves camera so that all selected objects in the scene are visible. |
virtual glm::vec3 | getDirection() const |
virtual float | getFov() const |
virtual int | getHeight() const |
virtual glm::vec3 | getPosition() const |
virtual glm::mat4 | getProjection() const |
virtual glm::vec3 | getRight() const |
virtual glm::vec3 | getUp() const |
virtual glm::mat4 | getView() const |
virtual int | getWidth() const |
virtual float | getZFar() const |
virtual float | getZNear() const |
void | interpolate(glm::mat4 from, glm::mat4 to)<br>Begin interpolation from one view matrix to another, the interpolation will take m_interpolationPeriod seconds in realtime. |
bool | isInterpolating(float & progress) const<br>Checks whether interpolation between view matrices is currently happening. |
virtual void | processInput(double dt, glm::vec2 mousePos, glm::ivec2 windowSize) =0<br>Updates the internal camera state with user input. |
virtual void | setFov(float fov) |
virtual void | setZFar(float zFar) |
virtual void | setZNear(float zNear) |
virtual void | size(int width, int height)<br>Sets the camera resolution in pixels. |
virtual void | update() =0<br>Recalculates the view and projection matrices based on the internal camera state. |
virtual void | viewpoint(AbstractCamera::Viewpoint viewpoint)<br>Moves the camera to the specified viewpoint. |
Protected Functions inherited from Vp::AbstractCamera
Name | |
---|---|
std::vector< glm::vec3 > | createBoundingBoxWorldPoints(glm::vec3 boxMin, glm::vec3 boxMax, glm::mat4 modelMatrix) |
glm::mat4 | createProjectionMatrix(bool nonShrinking) const |
Protected Attributes inherited from Vp::AbstractCamera
Name | |
---|---|
glm::mat4 | interpolationFrom |
double | interpolationPeriod |
std::chrono::time_point< std::chrono::steady_clock, std::chrono::duration< double > > | interpolationStart |
glm::mat4 | interpolationTo |
glm::vec3 | m_direction |
float | m_fov <br>Vertical field of vision in degrees. |
int | m_height <br>Camera resolution height in pixels. |
glm::vec3 | m_position |
glm::mat4 | m_projection |
glm::vec3 | m_right |
glm::vec3 | m_up |
glm::mat4 | m_view |
int | m_width <br>Camera resolution width in pixels. |
float | m_zFar <br>Distance to the far clipping pane. |
float | m_zNear <br>Distance to the near clipping pane. |
Public Functions Documentation
function centerOnBox
cpp
virtual void centerOnBox(
glm::vec3 boxMin,
glm::vec3 boxMax,
bool interpolate
) override
virtual void centerOnBox(
glm::vec3 boxMin,
glm::vec3 boxMax,
bool interpolate
) override
Moves camera so that the specified axis aligned bounding box is visible.
Reimplements: Vp::AbstractCamera::centerOnBox
function getPivot
cpp
glm::vec3 getPivot() const
glm::vec3 getPivot() const
function getRadius
cpp
float getRadius() const
float getRadius() const
function setPivot
cpp
void setPivot(
const glm::vec3 & pivot
)
void setPivot(
const glm::vec3 & pivot
)
function setRadius
cpp
void setRadius(
float radius
)
void setRadius(
float radius
)
Protected Attributes Documentation
variable m_pivot
cpp
glm::vec3 m_pivot = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 m_pivot = glm::vec3(0.0f, 0.0f, 0.0f);
variable m_radius
cpp
float m_radius = 7.0f;
float m_radius = 7.0f;
Updated on 2024-11-06 at 20:16:53 +0000