Merge pull request #72 from enduro2d/hotfix/camera_view_fix

This commit is contained in:
Matvey Cherevko
2019-05-17 21:59:35 +07:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -410,7 +410,7 @@ namespace e2d
void node::update_world_matrix_() const noexcept {
world_matrix_ = parent_
? parent_->world_matrix() * local_matrix()
? local_matrix() * parent_->world_matrix()
: local_matrix();
}
}

View File

@@ -36,7 +36,14 @@ namespace e2d { namespace render_system_impl
: render_(render)
, batcher_(batcher)
{
const m4f& m_v = cam_n ? cam_n->world_matrix() : m4f::identity();
const m4f& cam_w = cam_n
? cam_n->world_matrix()
: m4f::identity();
const std::pair<m4f,bool> cam_w_inv = math::inversed(cam_w);
const m4f& m_v = cam_w_inv.second
? cam_w_inv.first
: m4f::identity();
const m4f& m_p = cam.projection();
batcher_.flush()