Skip to content

Commit

Permalink
fix: little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed May 31, 2016
1 parent a2eb811 commit 96200ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions cocos/2d/CCNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,9 +1792,6 @@ void Node::setAdditionalTransform(Mat4* additionalTransform)
}
else
{
// FIXME: Why "set" multiplies with the previous one.
// "set" should just replace the old one.
// in any case, we should add a new method called "concatAdditionalTransform"
_additionalTransform = *additionalTransform;
_useAdditionalTransform = true;
}
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/CCScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye
// then the "nodeToParent transform" will be lost.
// And it is important that the change is "permament", because the matrix might be used for calculate
// culling and other stuff.
camera->setAdditionalTransform(eyeTransform.getInversed());
if (eyeProjection)
camera->setAdditionalProjection(*eyeProjection * camera->getProjectionMatrix().getInversed());
else
camera->setAdditionalTransform(eyeTransform.getInversed());

director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
Expand Down

0 comments on commit 96200ee

Please sign in to comment.