Skip to content

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 voidcenterOnBox(glm::vec3 boxMin, glm::vec3 boxMax, bool interpolate) override<br>Moves camera so that the specified axis aligned bounding box is visible.
glm::vec3getPivot() const
floatgetRadius() const
voidsetPivot(const glm::vec3 & pivot)
voidsetRadius(float radius)

Protected Attributes

Name
glm::vec3m_pivot
floatm_radius

Additional inherited members

Public Types inherited from Vp::AbstractCamera

Name
enum classViewpoint { LEFT, RIGHT, TOP, BOTTOM, FRONT, BACK}

Public Functions inherited from Vp::AbstractCamera

Name
virtual~AbstractCamera() =default
virtual voidcenterOnObjects(const std::vector< const GameObject * > objects)<br>Moves camera so that the specified objects are visible.
virtual voidcenterOnScene(const Scene & scene)<br>Moves camera so that all objects in the scene are visible.
virtual voidcenterOnSelection(const Scene & scene)<br>Moves camera so that all selected objects in the scene are visible.
virtual glm::vec3getDirection() const
virtual floatgetFov() const
virtual intgetHeight() const
virtual glm::vec3getPosition() const
virtual glm::mat4getProjection() const
virtual glm::vec3getRight() const
virtual glm::vec3getUp() const
virtual glm::mat4getView() const
virtual intgetWidth() const
virtual floatgetZFar() const
virtual floatgetZNear() const
voidinterpolate(glm::mat4 from, glm::mat4 to)<br>Begin interpolation from one view matrix to another, the interpolation will take m_interpolationPeriod seconds in realtime.
boolisInterpolating(float & progress) const<br>Checks whether interpolation between view matrices is currently happening.
virtual voidprocessInput(double dt, glm::vec2 mousePos, glm::ivec2 windowSize) =0<br>Updates the internal camera state with user input.
virtual voidsetFov(float fov)
virtual voidsetZFar(float zFar)
virtual voidsetZNear(float zNear)
virtual voidsize(int width, int height)<br>Sets the camera resolution in pixels.
virtual voidupdate() =0<br>Recalculates the view and projection matrices based on the internal camera state.
virtual voidviewpoint(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::mat4createProjectionMatrix(bool nonShrinking) const

Protected Attributes inherited from Vp::AbstractCamera

Name
glm::mat4interpolationFrom
doubleinterpolationPeriod
std::chrono::time_point< std::chrono::steady_clock, std::chrono::duration< double > >interpolationStart
glm::mat4interpolationTo
glm::vec3m_direction
floatm_fov <br>Vertical field of vision in degrees.
intm_height <br>Camera resolution height in pixels.
glm::vec3m_position
glm::mat4m_projection
glm::vec3m_right
glm::vec3m_up
glm::mat4m_view
intm_width <br>Camera resolution width in pixels.
floatm_zFar <br>Distance to the far clipping pane.
floatm_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