From a71aed6cc8a8164a9ef21b43e5e25bf63c73d8e1 Mon Sep 17 00:00:00 2001 From: songchengjiang Date: Mon, 2 Mar 2015 13:51:43 +0800 Subject: [PATCH] mix particle with sprite3D --- .../Classes/Particle3DTest/Particle3DTest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index 9df2804dbc..669456daba 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -358,6 +358,21 @@ bool Particle3DLineStreakDemo::init() return false; + std::string c3bfileName = "Sprite3DTest/orc.c3b"; + auto sprite = Sprite3D::create(c3bfileName); + this->addChild(sprite); + //sprite->setPosition3D(Vec3(0, -20, -25)); + //sprite->setScale(5, 5); + sprite->setRotation3D(Vec3(0, 180, 0)); + sprite->setCameraMask((unsigned short)CameraFlag::USER1); + //sprite->setOpacity(100); + auto animation = Animation3D::create(c3bfileName); + if (animation) + { + auto animate = Animate3D::create(animation); + sprite->runAction(RepeatForever::create(animate)); + } + auto rootps = PUParticleSystem3D::create("lineStreak.pu", "pu_mediapack_01.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->setScale(5.0f); @@ -365,6 +380,7 @@ bool Particle3DLineStreakDemo::init() rootps->startParticleSystem(); this->addChild(rootps, 0, PARTICLE_SYSTEM_TAG); + //auto sprite = Sprite::create("pump_streak_04.png"); //sprite->setCameraMask((unsigned short)CameraFlag::USER1); //sprite->setScale(0.5f);