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

相机系统命名空间 更多...

#include <abs_camera.hpp>

类 xcal::camera::AbsCamera 继承关系图:
[图例]

Public 成员函数

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
 虚析构函数
 
virtual const xcmath::mat< float_t, 4, 4 > & projection_matrix () const =0
 获取投影矩阵
 
virtual bool_t projection_should_update () const =0
 检查投影矩阵是否需要更新
 
bool_t view_should_update () const
 检查视图矩阵是否需要更新
 
bool_t should_update () const
 检查相机矩阵是否需要更新
 
const xcmath::mat< float_t, 4, 4 > & pv_matrix () const
 获取投影视图矩阵(PV矩阵)
 

Protected 成员函数

void projection_has_changed () const
 标记投影矩阵已改变
 

详细描述

相机系统命名空间

包含相机相关的类和功能,提供视图和投影矩阵管理。

抽象相机基类

提供相机基础功能,包括视图矩阵、投影矩阵计算和缓存管理。 所有具体相机类(正交相机、透视相机)都应该继承自此类。

在文件 abs_camera.hpp42 行定义.

构造及析构函数说明

◆ AbsCamera()

xcal::camera::AbsCamera::AbsCamera ( )
inline

默认构造函数

在文件 abs_camera.hpp192 行定义.

◆ ~AbsCamera()

virtual xcal::camera::AbsCamera::~AbsCamera ( )
virtualdefault

虚析构函数

成员函数说明

◆ background_color() [1/2]

property::Color & xcal::camera::AbsCamera::background_color ( )
inline

获取背景颜色(可修改)

返回
property::Color& 背景颜色引用

在文件 abs_camera.hpp110 行定义.

◆ background_color() [2/2]

const property::Color & xcal::camera::AbsCamera::background_color ( ) const
inline

获取背景颜色(只读)

返回
const property::Color& 背景颜色常量引用

在文件 abs_camera.hpp117 行定义.

◆ position() [1/2]

property::Vec< float_t, 3 > & xcal::camera::AbsCamera::position ( )
inline

获取相机位置(可修改)

返回
property::Vec<float_t, 3>& 相机位置向量引用

在文件 abs_camera.hpp73 行定义.

◆ position() [2/2]

const property::Vec< float_t, 3 > & xcal::camera::AbsCamera::position ( ) const
inline

获取相机位置(只读)

返回
const property::Vec<float_t, 3>& 相机位置向量常量引用

在文件 abs_camera.hpp79 行定义.

◆ projection_has_changed()

void xcal::camera::AbsCamera::projection_has_changed ( ) const
protected

标记投影矩阵已改变

注解
子类在投影参数改变时应调用此方法

在文件 abs_camera.cc63 行定义.

◆ projection_matrix()

virtual const xcmath::mat< float_t, 4, 4 > & xcal::camera::AbsCamera::projection_matrix ( ) const
pure virtual

获取投影矩阵

返回
const xcmath::mat<float_t, 4, 4>& 投影矩阵常量引用
注解
纯虚函数,必须在子类中实现

xcal::camera::PerspectiveCamera 内被实现.

◆ projection_should_update()

virtual bool_t xcal::camera::AbsCamera::projection_should_update ( ) const
pure virtual

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

返回
bool_t true表示需要更新,false表示不需要
注解
纯虚函数,必须在子类中实现

xcal::camera::PerspectiveCamera 内被实现.

◆ pv_matrix()

const xcmath::mat< float_t, 4, 4 > & xcal::camera::AbsCamera::pv_matrix ( ) const

获取投影视图矩阵(PV矩阵)

返回
const xcmath::mat<float_t, 4, 4>& 投影视图矩阵常量引用

在文件 abs_camera.cc56 行定义.

◆ set_background_color()

template<typename... Args>
requires (std::is_constructible_v<property::Color::data_t, Args...>)
AbsCamera * xcal::camera::AbsCamera::set_background_color ( Args &&...  args)
inline

设置背景颜色

模板参数
Args参数类型
参数
args背景颜色参数
返回
AbsCamera* this指针,支持链式调用

在文件 abs_camera.hpp168 行定义.

被这些函数引用 main() , 以及 main().

◆ set_position()

template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCamera * xcal::camera::AbsCamera::set_position ( Args &&...  args)
inline

设置相机位置

模板参数
Args参数类型
参数
args位置坐标参数
返回
AbsCamera* this指针,支持链式调用

在文件 abs_camera.hpp130 行定义.

被这些函数引用 main() , 以及 main().

◆ set_target()

template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCamera * xcal::camera::AbsCamera::set_target ( Args &&...  args)
inline

设置相机目标点

模板参数
Args参数类型
参数
args目标点坐标参数
返回
AbsCamera* this指针,支持链式调用

在文件 abs_camera.hpp143 行定义.

被这些函数引用 main().

◆ set_up()

template<typename... Args>
requires (std::is_constructible_v<vec, Args...>)
AbsCamera * xcal::camera::AbsCamera::set_up ( Args &&...  args)
inline

设置相机上方向

模板参数
Args参数类型
参数
args上方向坐标参数
返回
AbsCamera* this指针,支持链式调用

在文件 abs_camera.hpp156 行定义.

◆ should_update()

xcal::bool_t xcal::camera::AbsCamera::should_update ( ) const

检查相机矩阵是否需要更新

返回
bool_t true表示需要更新,false表示不需要

在文件 abs_camera.cc44 行定义.

◆ target() [1/2]

property::Vec< float_t, 3 > & xcal::camera::AbsCamera::target ( )
inline

获取相机目标点(可修改)

返回
property::Vec<float_t, 3>& 相机目标点向量引用

在文件 abs_camera.hpp85 行定义.

◆ target() [2/2]

const property::Vec< float_t, 3 > & xcal::camera::AbsCamera::target ( ) const
inline

获取相机目标点(只读)

返回
const property::Vec<float_t, 3>& 相机目标点向量常量引用

在文件 abs_camera.hpp91 行定义.

◆ type()

CameraType xcal::camera::AbsCamera::type ( ) const
inline

在文件 abs_camera.hpp121 行定义.

◆ up() [1/2]

property::Vec< float_t, 3 > & xcal::camera::AbsCamera::up ( )
inline

获取相机上方向(可修改)

返回
property::Vec<float_t, 3>& 相机上方向向量引用

在文件 abs_camera.hpp97 行定义.

◆ up() [2/2]

const property::Vec< float_t, 3 > & xcal::camera::AbsCamera::up ( ) const
inline

获取相机上方向(只读)

返回
const property::Vec<float_t, 3>& 相机上方向向量常量引用

在文件 abs_camera.hpp103 行定义.

◆ view_matrix()

const xcmath::mat< float_t, 4, 4 > & xcal::camera::AbsCamera::view_matrix ( ) const

获取视图矩阵

返回
const xcmath::mat<float_t, 4, 4>& 视图矩阵常量引用

在文件 abs_camera.cc66 行定义.

◆ view_should_update()

xcal::bool_t xcal::camera::AbsCamera::view_should_update ( ) const

检查视图矩阵是否需要更新

返回
bool_t true表示需要更新,false表示不需要

在文件 abs_camera.cc41 行定义.


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