Merge pull request #9077 from super626/fixscene

fix Scene::setScale does not work #9031
This commit is contained in:
minggo 2014-11-13 18:59:49 +08:00
commit 156be2e633
1 changed files with 3 additions and 2 deletions

View File

@ -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);