-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Milestone
Description
Any nodes that have non-default camera are invisible during transition.
How to reproduce. Open HelloWorld project. Replace code inside HelloWorld::menuCloseCallback(Ref* pSender) with followed code:
auto screenSize = Director::getInstance()->getVisibleSize();
float zeye = Director::getInstance()->getZEye();
auto camera = Camera::createPerspective(60, (GLfloat)screenSize.width/screenSize.height, 10, zeye + screenSize.height / 2.0f);
// set parameters for camera
Vec3 eye(screenSize.width/2, screenSize.height/2.0f, zeye);
Vec3 center3D(screenSize.width/2, screenSize.height/2, 0.0f);
Vec3 up(0.0f, 1.0f, 0.0f);
//the calling order matters, we should first call setPosition3D, then call lookAt.
camera->setPosition3D(eye);
camera->lookAt(center3D, up);
camera->setCameraFlag(CameraFlag::USER2);
this->setCameraMask((unsigned short)CameraFlag::USER2, true);
this->addChild(camera); //add camera to the scene
Scene *scene = HelloWorld::createScene();
// run
Director::getInstance()->replaceScene(TransitionMoveInL::create(5.45f, scene));
Tap close button. Transition animation will start and current scene will immediately become invisible.
The same happens with the TransitionScene self when we add camera to it (If I want to make my own custom transition derived from TransitionScene).
Bug takes place because render() method of the scenes is not executed during transitions.
MuratAl
Metadata
Metadata
Assignees
Labels
No labels