From 6ecb9a7b04d9c6629b9245cea2cccb4fe1f925af Mon Sep 17 00:00:00 2001 From: yangxiao Date: Mon, 10 Nov 2014 12:48:42 +0800 Subject: [PATCH] fix #9031 --- cocos/2d/CCScene.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index f2b0094bac..297ca6119d 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -129,6 +129,7 @@ void Scene::render(Renderer* renderer) { auto director = Director::getInstance(); Camera* defaultCamera = nullptr; + const auto& transform = getNodeToParentTransform(); for (const auto& camera : _cameras) { Camera::_visitingCamera = camera; @@ -142,7 +143,7 @@ void Scene::render(Renderer* renderer) director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix()); //visit the scene - visit(renderer, Mat4::IDENTITY, 0); + visit(renderer, transform, 0); renderer->render(); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); @@ -155,7 +156,7 @@ void Scene::render(Renderer* renderer) director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix()); //visit the scene - visit(renderer, Mat4::IDENTITY, 0); + visit(renderer, transform, 0); renderer->render(); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);