24#define XCAL_CAMERA_TYPE(tp) \
26 ::xcal::camera::CameraType type_() const noexcept override { \
27 return ::xcal::camera::CameraType::tp; \
53 mutable bool_t view_or_projection_has_changed_{
65 void update_view_matrix()
const;
118 return background_color_;
128 template <
typename... Args>
129 requires(std::is_constructible_v<vec, Args...>)
131 position_ =
vec{
float_t(std::forward<Args>(args))...};
141 template <
typename... Args>
142 requires(std::is_constructible_v<vec, Args...>)
144 target_ =
vec{
float_t(std::forward<Args>(args))...};
154 template <
typename... Args>
155 requires(std::is_constructible_v<vec, Args...>)
157 up_ =
vec{
float_t(std::forward<Args>(args))...};
166 template <
typename... Args>
186 void projection_has_changed()
const;
217 bool_t view_should_update()
const;
223 bool_t should_update()
const;
237 return "Perspective";
const property::Vec< float_t, 3 > & target() const
获取相机目标点(只读)
const property::Vec< float_t, 3 > & up() const
获取相机上方向(只读)
virtual ~AbsCamera()=default
虚析构函数
const property::Vec< float_t, 3 > & position() const
获取相机位置(只读)
virtual bool_t projection_should_update() const =0
检查投影矩阵是否需要更新
AbsCamera * set_up(Args &&... args)
设置相机上方向
AbsCamera * set_target(Args &&... args)
设置相机目标点
AbsCamera * set_position(Args &&... args)
设置相机位置
AbsCamera * set_background_color(Args &&... args)
设置背景颜色
property::Vec< float_t, 3 > & position()
获取相机位置(可修改)
property::Color & background_color()
获取背景颜色(可修改)
property::Vec< float_t, 3 > & up()
获取相机上方向(可修改)
virtual const xcmath::mat< float_t, 4, 4 > & projection_matrix() const =0
获取投影矩阵
property::Vec< float_t, 3 > & target()
获取相机目标点(可修改)
const property::Color & background_color() const
获取背景颜色(只读)
static constexpr mat< _Tp, _rows, _cols > eye()
Create an identity matrix
XCAL_API const char * to_string(xcal::camera::CameraType type)