xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
xcal::camera::PerspectiveCamera类 参考

透视相机类 更多...

#include <perspectivecamera.hpp>

类 xcal::camera::PerspectiveCamera 继承关系图:
[图例]
xcal::camera::PerspectiveCamera 的协作图:
[图例]

Public 成员函数

 PerspectiveCamera (float fov, float aspect, float near, float far)
 构造函数
 
property::Scalarfov ()
 获取视野角度(可修改)
 
const property::Scalarfov () const
 获取视野角度(只读)
 
property::Scalaraspect ()
 获取宽高比(可修改)
 
const property::Scalaraspect () const
 获取宽高比(只读)
 
property::Scalarnear ()
 获取近裁剪平面距离(可修改)
 
const property::Scalarnear () const
 获取近裁剪平面距离(只读)
 
property::Scalarfar ()
 获取远裁剪平面距离(可修改)
 
const property::Scalarfar () const
 获取远裁剪平面距离(只读)
 
PerspectiveCameraset_fov (float fov)
 设置视野角度
 
PerspectiveCameraset_aspect (float aspect)
 设置宽高比
 
PerspectiveCameraset_near (float near)
 设置近裁剪平面距离
 
PerspectiveCameraset_far (float far)
 设置远裁剪平面距离
 
const xcmath::mat< float_t, 4, 4 > & projection_matrix () const override
 获取投影矩阵
 
bool_t projection_should_update () const override
 检查投影矩阵是否需要更新
 
- Public 成员函数 继承自 xcal::camera::AbsCamera
property::Vec< float_t, 3 > & position ()
 获取相机位置(可修改)
 
const property::Vec< float_t, 3 > & position () const
 获取相机位置(只读)
 
property::Vec< float_t, 3 > & target ()
 获取相机目标点(可修改)
 
const property::Vec< float_t, 3 > & target () const
 获取相机目标点(只读)
 
property::Vec< float_t, 3 > & up ()
 获取相机上方向(可修改)
 
const property::Vec< float_t, 3 > & up () const
 获取相机上方向(只读)
 
property::Colorbackground_color ()
 获取背景颜色(可修改)
 
const property::Colorbackground_color () const
 获取背景颜色(只读)
 
CameraType type () const
 
template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCameraset_position (Args &&... args)
 设置相机位置
 
template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCameraset_target (Args &&... args)
 设置相机目标点
 
template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCameraset_up (Args &&... args)
 设置相机上方向
 
template<typename... Args>
requires (std::is_constructible_v<property::Color::data_t, Args...>)
AbsCameraset_background_color (Args &&... args)
 设置背景颜色
 
const xcmath::mat< float_t, 4, 4 > & view_matrix () const
 获取视图矩阵
 
 AbsCamera ()
 默认构造函数
 
virtual ~AbsCamera ()=default
 虚析构函数
 
bool_t view_should_update () const
 检查视图矩阵是否需要更新
 
bool_t should_update () const
 检查相机矩阵是否需要更新
 
const xcmath::mat< float_t, 4, 4 > & pv_matrix () const
 获取投影视图矩阵(PV矩阵)
 

额外继承的成员函数

- Protected 成员函数 继承自 xcal::camera::AbsCamera
void projection_has_changed () const
 标记投影矩阵已改变
 

详细描述

透视相机类

实现透视投影相机功能,继承自抽象相机基类。 透视相机模拟人眼视角,近大远小效果。

在文件 perspectivecamera.hpp28 行定义.

构造及析构函数说明

◆ PerspectiveCamera()

xcal::camera::PerspectiveCamera::PerspectiveCamera ( float  fov,
float  aspect,
float  near,
float  far 
)
inline

构造函数

参数
fov视野角度(弧度)
aspect宽高比
near近裁剪平面距离
far远裁剪平面距离

在文件 perspectivecamera.hpp49 行定义.

成员函数说明

◆ aspect() [1/2]

property::Scalar & xcal::camera::PerspectiveCamera::aspect ( )
inline

获取宽高比(可修改)

返回
property::Scalar& 宽高比引用

在文件 perspectivecamera.hpp70 行定义.

◆ aspect() [2/2]

const property::Scalar & xcal::camera::PerspectiveCamera::aspect ( ) const
inline

获取宽高比(只读)

返回
const property::Scalar& 宽高比常量引用

在文件 perspectivecamera.hpp76 行定义.

◆ far() [1/2]

property::Scalar & xcal::camera::PerspectiveCamera::far ( )
inline

获取远裁剪平面距离(可修改)

返回
property::Scalar& 远裁剪平面距离引用

在文件 perspectivecamera.hpp94 行定义.

◆ far() [2/2]

const property::Scalar & xcal::camera::PerspectiveCamera::far ( ) const
inline

获取远裁剪平面距离(只读)

返回
const property::Scalar& 远裁剪平面距离常量引用

在文件 perspectivecamera.hpp100 行定义.

◆ fov() [1/2]

property::Scalar & xcal::camera::PerspectiveCamera::fov ( )
inline

获取视野角度(可修改)

返回
property::Scalar& 视野角度引用

在文件 perspectivecamera.hpp58 行定义.

◆ fov() [2/2]

const property::Scalar & xcal::camera::PerspectiveCamera::fov ( ) const
inline

获取视野角度(只读)

返回
const property::Scalar& 视野角度常量引用

在文件 perspectivecamera.hpp64 行定义.

◆ near() [1/2]

property::Scalar & xcal::camera::PerspectiveCamera::near ( )
inline

获取近裁剪平面距离(可修改)

返回
property::Scalar& 近裁剪平面距离引用

在文件 perspectivecamera.hpp82 行定义.

◆ near() [2/2]

const property::Scalar & xcal::camera::PerspectiveCamera::near ( ) const
inline

获取近裁剪平面距离(只读)

返回
const property::Scalar& 近裁剪平面距离常量引用

在文件 perspectivecamera.hpp88 行定义.

◆ projection_matrix()

const xcmath::mat< float_t, 4, 4 > & xcal::camera::PerspectiveCamera::projection_matrix ( ) const
overridevirtual

获取投影矩阵

返回
const xcmath::mat<float_t, 4, 4>& 投影矩阵常量引用
注解
重写基类纯虚函数

实现了 xcal::camera::AbsCamera.

在文件 perspectivecamera.cc34 行定义.

◆ projection_should_update()

xcal::bool_t xcal::camera::PerspectiveCamera::projection_should_update ( ) const
overridevirtual

检查投影矩阵是否需要更新

返回
bool_t true表示需要更新,false表示不需要
注解
重写基类纯虚函数

实现了 xcal::camera::AbsCamera.

在文件 perspectivecamera.cc29 行定义.

◆ set_aspect()

PerspectiveCamera * xcal::camera::PerspectiveCamera::set_aspect ( float  aspect)
inline

设置宽高比

参数
aspect宽高比
返回
PerspectiveCamera* this指针

在文件 perspectivecamera.hpp120 行定义.

被这些函数引用 xcal::render::opengl::OpenGLRender::framebuffer_size_callback().

◆ set_far()

PerspectiveCamera * xcal::camera::PerspectiveCamera::set_far ( float  far)
inline

设置远裁剪平面距离

参数
far远裁剪平面距离
返回
PerspectiveCamera* this指针

在文件 perspectivecamera.hpp144 行定义.

◆ set_fov()

PerspectiveCamera * xcal::camera::PerspectiveCamera::set_fov ( float  fov)
inline

设置视野角度

参数
fov视野角度(弧度)
返回
PerspectiveCamera* this指针

在文件 perspectivecamera.hpp108 行定义.

◆ set_near()

PerspectiveCamera * xcal::camera::PerspectiveCamera::set_near ( float  near)
inline

设置近裁剪平面距离

参数
near近裁剪平面距离
返回
PerspectiveCamera* this指针

在文件 perspectivecamera.hpp132 行定义.


该类的文档由以下文件生成: