2018-01-29 16:25:32 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2018-01-29 16:25:32 +08:00
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2010-08-23 16:38:10 +08:00
|
|
|
#ifndef _PARTICLE_TEST_H_
|
|
|
|
#define _PARTICLE_TEST_H_
|
2012-04-04 21:58:04 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-04 21:58:04 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(ParticleTests);
|
2012-04-04 21:58:04 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class ParticleDemo : public TestCase
|
2010-08-23 16:38:10 +08:00
|
|
|
{
|
2012-04-04 21:58:04 +08:00
|
|
|
protected:
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::ParticleSystemQuad* _emitter;
|
|
|
|
axis::Sprite* _background;
|
|
|
|
axis::LayerColor* _color;
|
2012-04-04 21:58:04 +08:00
|
|
|
|
|
|
|
public:
|
2015-06-23 11:00:23 +08:00
|
|
|
~ParticleDemo();
|
2012-04-04 21:58:04 +08:00
|
|
|
|
2021-12-28 16:06:23 +08:00
|
|
|
virtual void onEnter() override;
|
2010-08-23 16:38:10 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
void toggleCallback(axis::Ref* sender);
|
2013-07-26 06:53:24 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
|
|
|
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
|
|
|
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
2010-08-23 16:38:10 +08:00
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void update(float dt) override;
|
2012-04-19 14:35:52 +08:00
|
|
|
void setEmitterPosition();
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoFirework : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoFirework);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoFire : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoFire);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSun : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoSun);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoGalaxy : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoGalaxy);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoFlower : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoFlower);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoBigFlower : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoBigFlower);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoRotFlower : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoRotFlower);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoMeteor : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoMeteor);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSpiral : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoSpiral);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoExplosion : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoExplosion);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSmoke : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoSmoke);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSnow : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoSnow);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoRain : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoRain);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoModernArt : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoModernArt);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DemoRing : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(DemoRing);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ParallaxParticle : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParallaxParticle);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-23 16:38:10 +08:00
|
|
|
};
|
2010-08-26 09:55:54 +08:00
|
|
|
|
2022-06-16 04:04:08 +08:00
|
|
|
class DemoFixedFPS : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoFixedFPS);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoTimeScale: public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoTimeScale);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual void update(float dt) override;
|
|
|
|
|
|
|
|
float elapsedTime = 0.0F;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSpawnFadeIn : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoSpawnFadeIn);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoScaleFadeIn : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoScaleFadeIn);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSimulation : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoSimulation);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoSpawnRotation : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoSpawnRotation);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoHSV : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoHSV);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLifeAnimation : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLifeAnimation);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLifeAnimationAtlas : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLifeAnimationAtlas);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLifeAnimationReversed : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLifeAnimationReversed);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLoopAnimation : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLoopAnimation);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLoopAnimationReversed : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLoopAnimationReversed);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmitterAnimation : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmitterAnimation);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmitterAnimationDescriptor : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmitterAnimationDescriptor);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoLoopAnimationMultiDescriptor : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoLoopAnimationMultiDescriptor);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapePoint : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapePoint);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeRect : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeRect);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeRectTorus : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeRectTorus);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeCircle : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeCircle);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeCircleBiasEdge : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeCircleBiasEdge);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeCircleBiasCenter : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeCircleBiasCenter);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeTorus : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeTorus);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeTorusBiasEdge : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeTorusBiasEdge);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeTorusBiasInner : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeTorusBiasInner);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeCone : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeCone);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeConeTorus : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeConeTorus);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DemoEmissionShapeAlphaMask : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoEmissionShapeAlphaMask);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2012-04-04 21:58:04 +08:00
|
|
|
class DemoParticleFromFile : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2021-12-28 15:58:56 +08:00
|
|
|
static DemoParticleFromFile* create(std::string_view file)
|
2015-04-03 14:31:03 +08:00
|
|
|
{
|
2021-12-08 00:11:53 +08:00
|
|
|
auto ret = new DemoParticleFromFile;
|
|
|
|
if (ret->init())
|
2015-04-03 14:31:03 +08:00
|
|
|
{
|
|
|
|
ret->_title = file;
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
delete ret;
|
|
|
|
ret = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
2012-04-04 21:58:04 +08:00
|
|
|
}
|
2015-04-03 14:31:03 +08:00
|
|
|
|
|
|
|
std::string _title;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2021-12-28 16:06:23 +08:00
|
|
|
virtual std::string subtitle() const override { return _title; }
|
2010-08-26 09:55:54 +08:00
|
|
|
};
|
2010-09-25 11:54:33 +08:00
|
|
|
|
|
|
|
class RadiusMode1 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(RadiusMode1);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-09-25 11:54:33 +08:00
|
|
|
};
|
2012-04-04 21:58:04 +08:00
|
|
|
|
2010-09-25 11:54:33 +08:00
|
|
|
class RadiusMode2 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(RadiusMode2);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-28 23:02:22 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2010-09-25 11:54:33 +08:00
|
|
|
class Issue704 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(Issue704);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2010-09-25 11:54:33 +08:00
|
|
|
class Issue870 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(Issue870);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void updateQuads(float dt);
|
2010-09-25 11:54:33 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
int _index;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class Issue1201 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(Issue1201);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class ParticleBatchHybrid : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleBatchHybrid);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void switchRender(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
private:
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::Node* _parent1;
|
|
|
|
axis::Node* _parent2;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class ParticleBatchMultipleEmitters : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleBatchMultipleEmitters);
|
|
|
|
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class ParticleReorder : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleReorder);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderParticles(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
unsigned int _order;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class MultipleParticleSystems : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(MultipleParticleSystems);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void update(float dt) override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class MultipleParticleSystemsBatched : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(MultipleParticleSystemsBatched);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void update(float dt) override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class AddAndDeleteParticleSystems : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(AddAndDeleteParticleSystems);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void update(float dt) override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void removeSystem(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
private:
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::ParticleBatchNode* _batchNode;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
class ReorderParticleSystems : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ReorderParticleSystems);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSystem(float time);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void update(float dt) override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2012-03-22 18:29:07 +08:00
|
|
|
private:
|
2022-07-11 17:50:21 +08:00
|
|
|
axis::ParticleBatchNode* _batchNode;
|
2012-04-04 21:58:04 +08:00
|
|
|
};
|
|
|
|
|
2012-06-12 15:40:31 +08:00
|
|
|
class PremultipliedAlphaTest : public ParticleDemo
|
|
|
|
{
|
2014-06-04 10:39:18 +08:00
|
|
|
bool _hasEmitter;
|
2021-12-28 16:06:23 +08:00
|
|
|
|
2012-06-12 15:40:31 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(PremultipliedAlphaTest);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2017-03-23 09:30:42 +08:00
|
|
|
void readdParticle(float delta);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-12 15:40:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class PremultipliedAlphaTest2 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(PremultipliedAlphaTest2);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Issue3990 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(Issue3990);
|
2014-02-11 20:33:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-12 15:40:31 +08:00
|
|
|
};
|
|
|
|
|
2014-03-27 17:06:26 +08:00
|
|
|
class ParticleVisibleTest : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleVisibleTest);
|
2014-03-27 17:06:26 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
void callback(float delta);
|
|
|
|
};
|
|
|
|
|
2014-03-01 14:03:36 +08:00
|
|
|
class ParticleAutoBatching : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleAutoBatching);
|
2014-03-01 14:03:36 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2014-07-29 11:21:11 +08:00
|
|
|
class ParticleResetTotalParticles : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(ParticleResetTotalParticles);
|
2014-07-29 11:21:11 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2015-06-12 15:39:57 +08:00
|
|
|
class ParticleIssue12310 : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(ParticleIssue12310);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2016-06-15 18:31:10 +08:00
|
|
|
class DemoPause : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(DemoPause);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
void pauseEmitter(float time);
|
|
|
|
};
|
|
|
|
|
2017-01-12 11:48:30 +08:00
|
|
|
class ParticleSpriteFrame : public ParticleDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(ParticleSpriteFrame);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2012-04-04 21:58:04 +08:00
|
|
|
#endif
|