mirror of https://github.com/axmolengine/axmol.git
mix particle with sprite3D
This commit is contained in:
parent
5c460ebb2d
commit
a71aed6cc8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue