mirror of https://github.com/axmolengine/axmol.git
fix :camera-culling MoveTo
This commit is contained in:
parent
9665557e66
commit
7f18c9809c
|
@ -881,9 +881,11 @@ void CameraCullingDemo::update(float dt)
|
||||||
|
|
||||||
void CameraCullingDemo::reachEndCallBack()
|
void CameraCullingDemo::reachEndCallBack()
|
||||||
{
|
{
|
||||||
|
auto s = Director::getInstance()->getWinSize();
|
||||||
_cameraFirst->stopActionByTag(100);
|
_cameraFirst->stopActionByTag(100);
|
||||||
auto inverse = (MoveTo*)_moveAction->reverse();
|
auto inverse = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0));
|
||||||
inverse->retain();
|
inverse->retain();
|
||||||
|
|
||||||
_moveAction->release();
|
_moveAction->release();
|
||||||
_moveAction = inverse;
|
_moveAction = inverse;
|
||||||
auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f));
|
auto rot = RotateBy::create(1.f, Vec3(0.f, 180.f, 0.f));
|
||||||
|
@ -902,7 +904,7 @@ void CameraCullingDemo::switchViewCallback(Ref* sender)
|
||||||
_cameraFirst->setCameraFlag(CameraFlag::USER8);
|
_cameraFirst->setCameraFlag(CameraFlag::USER8);
|
||||||
_cameraFirst->setPosition3D(Vec3(-100,0,0));
|
_cameraFirst->setPosition3D(Vec3(-100,0,0));
|
||||||
_cameraFirst->lookAt(Vec3(1000,0,0));
|
_cameraFirst->lookAt(Vec3(1000,0,0));
|
||||||
_moveAction = MoveTo::create(4.f, Vec2(100, 0));
|
_moveAction = MoveTo::create(4.f, Vec2(-_cameraFirst->getPositionX(), 0));
|
||||||
_moveAction->retain();
|
_moveAction->retain();
|
||||||
auto seq = Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr);
|
auto seq = Sequence::create(_moveAction, CallFunc::create(CC_CALLBACK_0(CameraCullingDemo::reachEndCallBack, this)), nullptr);
|
||||||
seq->setTag(100);
|
seq->setTag(100);
|
||||||
|
|
Loading…
Reference in New Issue