Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::render3d::Camera3D Class Reference

Manages camera positioning, orbit rotations, panning, zooming, and view-projection matrices. More...

#include <Camera3D.hpp>

Collaboration diagram for correlation::render3d::Camera3D:

Public Member Functions

 Camera3D () noexcept
 Constructs camera with default orbital parameters.
void orbit (float delta_azimuth_deg, float delta_elevation_deg) noexcept
 Orbits the camera around the current target.
void setOrientation (float azimuth_deg, float elevation_deg) noexcept
 Sets camera orbit orientation directly in degrees.
void pan (float delta_x, float delta_y) noexcept
 Pans the camera target along the view-aligned screen plane.
void zoom (float factor) noexcept
 Zooms camera by adjusting orbital distance.
void fitToBox (const math::Vector3< float > &min_pt, const math::Vector3< float > &max_pt) noexcept
 Automatically frames the camera around a 3D bounding box.
void setViewport (float width, float height) noexcept
 Updates viewport aspect ratio.
void setFov (float fov_y_deg) noexcept
 Sets vertical field of view.
void setTarget (const math::Vector3< float > &target) noexcept
 Sets target look-at point.
void setDistance (float distance) noexcept
 Sets orbital camera distance directly (clamped to valid range).
void setClipPlanes (float z_near, float z_far) noexcept
 Sets near and far clipping planes.
math::Vector3< float > eyePosition () const noexcept
 Computes eye position in world space.
const math::Vector3< float > & target () const noexcept
float distance () const noexcept
float azimuth () const noexcept
float elevation () const noexcept
float fov () const noexcept
float aspectRatio () const noexcept
ProjectionMode projectionMode () const noexcept
bool isOrthographic () const noexcept
void setProjectionMode (ProjectionMode mode) noexcept
Matrix4< float > viewMatrix () const
 Generates current view matrix.
Matrix4< float > projectionMatrix () const
 Generates perspective projection matrix.
Matrix4< float > viewProjectionMatrix () const
 Generates combined view-projection matrix (P * V).

Private Attributes

math::Vector3< float > target_ {0.0F, 0.0F, 0.0F}
math::Vector3< float > world_up_ {0.0F, 1.0F, 0.0F}
float distance_ {20.0F}
float azimuth_deg_ {0.0F}
float elevation_deg_ {20.0F}
float fov_y_deg_ {45.0F}
float aspect_ratio_ {1.3333F}
float z_near_ {0.1F}
float z_far_ {2000.0F}
ProjectionMode projection_mode_ {ProjectionMode::Perspective}

Detailed Description

Manages camera positioning, orbit rotations, panning, zooming, and view-projection matrices.

Constructor & Destructor Documentation

◆ Camera3D()

correlation::render3d::Camera3D::Camera3D ( )
defaultnoexcept

Constructs camera with default orbital parameters.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ aspectRatio()

float correlation::render3d::Camera3D::aspectRatio ( ) const
inlinenodiscardnoexcept

◆ azimuth()

float correlation::render3d::Camera3D::azimuth ( ) const
inlinenodiscardnoexcept

◆ distance()

float correlation::render3d::Camera3D::distance ( ) const
inlinenodiscardnoexcept
Here is the caller graph for this function:

◆ elevation()

float correlation::render3d::Camera3D::elevation ( ) const
inlinenodiscardnoexcept

◆ eyePosition()

math::Vector3< float > correlation::render3d::Camera3D::eyePosition ( ) const
nodiscardnoexcept

Computes eye position in world space.

Returns
Eye coordinate.
Here is the caller graph for this function:

◆ fitToBox()

void correlation::render3d::Camera3D::fitToBox ( const math::Vector3< float > & min_pt,
const math::Vector3< float > & max_pt )
noexcept

Automatically frames the camera around a 3D bounding box.

Parameters
min_ptMinimum bounding box corner.
max_ptMaximum bounding box corner.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fov()

float correlation::render3d::Camera3D::fov ( ) const
inlinenodiscardnoexcept
Here is the caller graph for this function:

◆ isOrthographic()

bool correlation::render3d::Camera3D::isOrthographic ( ) const
inlinenodiscardnoexcept
Here is the caller graph for this function:

◆ orbit()

void correlation::render3d::Camera3D::orbit ( float delta_azimuth_deg,
float delta_elevation_deg )
noexcept

Orbits the camera around the current target.

Parameters
delta_azimuth_degHorizontal angle change in degrees.
delta_elevation_degVertical angle change in degrees.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pan()

void correlation::render3d::Camera3D::pan ( float delta_x,
float delta_y )
noexcept

Pans the camera target along the view-aligned screen plane.

Parameters
delta_xHorizontal translation delta.
delta_yVertical translation delta.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectionMatrix()

Matrix4< float > correlation::render3d::Camera3D::projectionMatrix ( ) const
nodiscard

Generates perspective projection matrix.

Returns
4x4 Projection matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectionMode()

ProjectionMode correlation::render3d::Camera3D::projectionMode ( ) const
inlinenodiscardnoexcept

◆ setClipPlanes()

void correlation::render3d::Camera3D::setClipPlanes ( float z_near,
float z_far )
noexcept

Sets near and far clipping planes.

Parameters
z_nearNear clip distance (> 0).
z_farFar clip distance (> z_near).
Here is the caller graph for this function:

◆ setDistance()

void correlation::render3d::Camera3D::setDistance ( float distance)
noexcept

Sets orbital camera distance directly (clamped to valid range).

Parameters
distanceOrbital distance from target in Angstroms.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFov()

void correlation::render3d::Camera3D::setFov ( float fov_y_deg)
noexcept

Sets vertical field of view.

Parameters
fov_y_degFOV in degrees.
Here is the caller graph for this function:

◆ setOrientation()

void correlation::render3d::Camera3D::setOrientation ( float azimuth_deg,
float elevation_deg )
noexcept

Sets camera orbit orientation directly in degrees.

Parameters
azimuth_degHorizontal azimuth angle in degrees.
elevation_degVertical elevation angle in degrees.
Here is the caller graph for this function:

◆ setProjectionMode()

void correlation::render3d::Camera3D::setProjectionMode ( ProjectionMode mode)
inlinenoexcept

◆ setTarget()

void correlation::render3d::Camera3D::setTarget ( const math::Vector3< float > & target)
noexcept

Sets target look-at point.

Parameters
targetWorld coordinates of the focus target.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setViewport()

void correlation::render3d::Camera3D::setViewport ( float width,
float height )
noexcept

Updates viewport aspect ratio.

Parameters
widthViewport pixel width.
heightViewport pixel height.
Here is the caller graph for this function:

◆ target()

const math::Vector3< float > & correlation::render3d::Camera3D::target ( ) const
inlinenodiscardnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ viewMatrix()

Matrix4< float > correlation::render3d::Camera3D::viewMatrix ( ) const
nodiscard

Generates current view matrix.

Returns
4x4 View matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ viewProjectionMatrix()

Matrix4< float > correlation::render3d::Camera3D::viewProjectionMatrix ( ) const
nodiscard

Generates combined view-projection matrix (P * V).

Returns
4x4 View-projection matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoom()

void correlation::render3d::Camera3D::zoom ( float factor)
noexcept

Zooms camera by adjusting orbital distance.

Parameters
factorZoom factor (positive zooms in, negative zooms out).
Here is the caller graph for this function:

Member Data Documentation

◆ aspect_ratio_

float correlation::render3d::Camera3D::aspect_ratio_ {1.3333F}
private

◆ azimuth_deg_

float correlation::render3d::Camera3D::azimuth_deg_ {0.0F}
private

◆ distance_

float correlation::render3d::Camera3D::distance_ {20.0F}
private

◆ elevation_deg_

float correlation::render3d::Camera3D::elevation_deg_ {20.0F}
private

◆ fov_y_deg_

float correlation::render3d::Camera3D::fov_y_deg_ {45.0F}
private

◆ projection_mode_

ProjectionMode correlation::render3d::Camera3D::projection_mode_ {ProjectionMode::Perspective}
private

◆ target_

math::Vector3<float> correlation::render3d::Camera3D::target_ {0.0F, 0.0F, 0.0F}
private

◆ world_up_

math::Vector3<float> correlation::render3d::Camera3D::world_up_ {0.0F, 1.0F, 0.0F}
private

◆ z_far_

float correlation::render3d::Camera3D::z_far_ {2000.0F}
private

◆ z_near_

float correlation::render3d::Camera3D::z_near_ {0.1F}
private

The documentation for this class was generated from the following files: