xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
singlemobjectwrapper.cc
浏览该文件的文档.
3
4#define ROLE SingleMObjectWrapperImpl
5#define LABEL SingleMObjectWrapperImpl
8
9// xcal::render::opengl::utils::SingleMObjectWrapperImpl::mat&
10// xcal::render::opengl::utils::SingleMObjectWrapperImpl::model_matrix() const {
11// if (model_matrix_should_update()) {
12// update_model_matrix();
13// // _D("Render SingleObject: "
14// // << this << " from " << xcal::to_string(mobject_->type()) << ":
15// "
16// // << mobject_ << " with update model: " << model_matrox_cache_);
17// }
18// return model_matrox_cache_;
19// }
20// bool xcal::render::opengl::utils::SingleMObjectWrapperImpl::
21// model_matrix_should_update() const {
22// return mobject_->pos().is_changed() || mobject_->rotation().is_changed()
23// ||
24// mobject_->scale_x().is_changed() ||
25// mobject_->scale_y().is_changed();
26// }
27// void xcal::render::opengl::utils::SingleMObjectWrapperImpl::
28// update_model_matrix() const {
29// model_matrox_cache_ = xcmath::translate(
30// xcmath::rotate(
31// xcmath::scale(xcmath::mat4<float_t>::eye(),
32// {mobject_->scale_x(), mobject_->scale_y(), 1.0f}),
33// mobject_->rotation().value(), {0.0f, 0.0f, 1.0f}),
34// {mobject_->pos().x(), mobject_->pos().y(), 0.0f});
35// mobject_->pos().reset_changed();
36// mobject_->rotation().reset_changed();
37// mobject_->scale_x().reset_changed();
38// mobject_->scale_y().reset_changed();
39// }