From 218de84cc56ddebf35acebde6f5aad85bd944aab Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 28 Feb 2015 11:31:15 +0800 Subject: [PATCH 1/6] remove expolosion particle --- .../Classes/Particle3DTest/Particle3DTest.cpp | 33 +- .../Classes/Particle3DTest/Particle3DTest.h | 13 - .../Particle3D/materials/pu_example.material | 20 + .../materials/pu_mediapack_01.material | 1302 ----------------- .../scripts/mp_explosion_04_blue.pu | 380 ----- .../src/Particle3DTest/Particle3DTest.lua | 50 +- tests/lua-tests/src/mainMenu.lua | 2 +- 7 files changed, 33 insertions(+), 1767 deletions(-) delete mode 100644 tests/cpp-tests/Resources/Particle3D/materials/pu_mediapack_01.material delete mode 100644 tests/cpp-tests/Resources/Particle3D/scripts/mp_explosion_04_blue.pu diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index 5d6eea22b8..b97680e0ee 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -47,7 +47,6 @@ static std::function createFunctions[] = CL(Particle3DUVAnimDemo), CL(Particle3DFirePlaceDemo), CL(Particle3DElectricBeamSystemDemo), - CL(Particle3DExplosionBlueDemo), }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -242,7 +241,7 @@ bool Particle3DBlackHoleDemo::init() if (!Particle3DTestDemo::init()) return false; - auto rootps = PUParticleSystem3D::create("blackHole.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("blackHole.pu", "pu_example.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->setPosition(-25.0f, 0.0f); auto moveby = MoveBy::create(2.0f, Vec2(50.0f, 0.0f)); @@ -269,7 +268,7 @@ bool Particle3DHypnoDemo::init() if (!Particle3DTestDemo::init()) return false; - auto rootps = PUParticleSystem3D::create("hypno.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("hypno.pu", "pu_example.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); // auto scale = ScaleBy::create(1.0f, 2.0f, 2.0f, 2.0f); // auto rotate = RotateBy::create(1.0f, Vec3(0.0, 100.0f, 0.0f)); @@ -292,7 +291,7 @@ bool Particle3DTimeShiftDemo::init() if (!Particle3DTestDemo::init()) return false; - auto rootps = PUParticleSystem3D::create("timeShift.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("timeShift.pu", "pu_example.material"); rootps->setScale(2.0f); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->startParticleSystem(); @@ -312,7 +311,7 @@ bool Particle3DUVAnimDemo::init() if (!Particle3DTestDemo::init()) return false; - auto rootps = PUParticleSystem3D::create("UVAnimation.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("UVAnimation.pu", "pu_example.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->startParticleSystem(); @@ -331,7 +330,7 @@ bool Particle3DFirePlaceDemo::init() if (!Particle3DTestDemo::init()) return false; - auto rootps = PUParticleSystem3D::create("mp_torch.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("mp_torch.pu", "pu_example.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->setScale(5.0f); rootps->startParticleSystem(); @@ -352,7 +351,7 @@ bool Particle3DLineStreakDemo::init() return false; - auto rootps = PUParticleSystem3D::create("lineStreak.pu", "pu_mediapack_01.material"); + auto rootps = PUParticleSystem3D::create("lineStreak.pu"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->setScale(5.0f); //rootps->runAction(RepeatForever::create(Sequence::create(rotate, nullptr))); @@ -385,23 +384,3 @@ bool Particle3DElectricBeamSystemDemo::init() return true; } - -std::string Particle3DExplosionBlueDemo::subtitle() const -{ - return "ExplosionBlue"; -} - -bool Particle3DExplosionBlueDemo::init() -{ - if (!Particle3DTestDemo::init()) - return false; - - - auto rootps = PUParticleSystem3D::create("mp_explosion_04_blue.pu"); - rootps->setCameraMask((unsigned short)CameraFlag::USER1); - rootps->setScale(0.25f); - rootps->startParticleSystem(); - this->addChild(rootps, 0, PARTICLE_SYSTEM_TAG); - - return true; -} diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h index 7561701f0c..565c1882b7 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.h @@ -162,19 +162,6 @@ public: virtual bool init() override; }; -class Particle3DExplosionBlueDemo : public Particle3DTestDemo -{ -public: - - CREATE_FUNC(Particle3DExplosionBlueDemo); - Particle3DExplosionBlueDemo(){}; - virtual ~Particle3DExplosionBlueDemo(){}; - - virtual std::string subtitle() const override; - - virtual bool init() override; -}; - class Particle3DTestScene : public TestScene { public: diff --git a/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material b/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material index 6ce8f95bbf..c4fa3f7595 100644 --- a/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material +++ b/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material @@ -539,3 +539,23 @@ material ParticleUniverse/Beam_2 } } } + +//----------------------------------------------------------------------------------------------------------------------- +material PUMediaPack/Pentagram_02 +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture pump_pentagram_02.png + tex_address_mode clamp + } + } + } +} diff --git a/tests/cpp-tests/Resources/Particle3D/materials/pu_mediapack_01.material b/tests/cpp-tests/Resources/Particle3D/materials/pu_mediapack_01.material deleted file mode 100644 index 2f718beb6e..0000000000 --- a/tests/cpp-tests/Resources/Particle3D/materials/pu_mediapack_01.material +++ /dev/null @@ -1,1302 +0,0 @@ -//----------------------------------------------------------------------------------------------------------------------- -// This script is part of the Particle Universe Media Pack product. -// -// Copyright (c) 2008 Henry van Merode -// -// Usage of this program is licensed under the terms of the Particle Universe Commercial License. -// You can find a copy of the Commercial License in the Particle Universe package. -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Bubble -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_bubble.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/BlurredBubble -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_bubble_blurred.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Streak_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_streak_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Streak_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - texture_unit - { - texture pump_streak_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Streak_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_streak_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Streak_04 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_streak_04.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_04 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_04.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_05 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_05.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Flare_06 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flare_06.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Watch -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture pump_watch.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Hourglass -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture pump_hourglass.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Leave -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_leave.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Smoke_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_smoke_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Smoke_11 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_smoke_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Dirt_11 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_dirt_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Dirt_12 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_dirt_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Lightning_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_lightning_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Lightning_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_lightning_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Lightning_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_lightning_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Lightning_04 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_lightning_04.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Spark_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_spark_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Star_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_star_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Star_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_star_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Star_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_star_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Star_04 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_star_04.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Star_05 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_star_05.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Genesis_11 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_genesis_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Genesis_12 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_genesis_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material ParticleUniverse/Swirl_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_swirl_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material ParticleUniverse/Swirl_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_swirl_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material ParticleUniverse/Swirl_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_swirl_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Ring_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_ring_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Ring_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_ring_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Ring_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_ring_03.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Ring_14 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_ring_04.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------- -material PUMediaPack/Ring_05 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_ring_05.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Metal_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_metal_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Metal_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_metal_02.png - tex_address_mode clamp - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Fire_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flame_01.png - tex_address_mode clamp - } - } - } -} - -//--------------------------------------------------------------------- -material PUMediaPack/Fire_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flame_02.png - tex_address_mode clamp - } - } - } -} - -//--------------------------------------------------------------------- -material PUMediaPack/Fire_03 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flame_03.png - tex_address_mode clamp - } - } - } -} - -//--------------------------------------------------------------------- -material PUMediaPack/Fire_04 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_flame_04.png - tex_address_mode clamp - } - } - } -} - -//--------------------------------------------------------------------- -material PUMediaPack/AtlasSmoke -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_atlas_smoke.png - tex_address_mode clamp - } - } - } -} - -//--------------------------------------------------------------------- -material PUMediaPack/Snow_01 -{ - technique - { - pass - { - lighting off - scene_blend alpha_blend - depth_write off - - texture_unit - { - texture pump_snow_01.png - tex_address_mode clamp - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/BBal -{ - technique - { - pass - { - lighting off - depth_write off - - texture_unit - { - texture pu_bbal.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/BioHazzard -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_biohazzard.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/CelticKnot -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_celticknot.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Pentagram_01 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_pentagram_01.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -material PUMediaPack/Pentagram_02 -{ - technique - { - pass - { - lighting off - scene_blend add - depth_write off - - texture_unit - { - texture pump_pentagram_02.png - tex_address_mode clamp - } - } - } -} - -//----------------------------------------------------------------------------------------------------------------------- -// This script is part of the Particle Universe Media Pack 1 product. -// -// Copyright (c) 2010 Henry van Merode -// -// Usage of this program is licensed under the terms of the Particle Universe Commercial License Media Pack 1. -// You can find a copy of the Commercial License in the Media Pack 1 package. -//----------------------------------------------------------------------------------------------------------------------- - -material mp_explosion_smoke_01 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_smoke_01.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_smoke_01_add -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - texture_unit - { - texture mp_explosion_smoke_01_add.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_flare_01 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_flare_01.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_flare_02 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_flare_02.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_dirt -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_dirt.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_flame_01 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_flame_01.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_flame_02 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_flame_02.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_smoke_02 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_smoke_02.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_smoke_03 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_smoke_03.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_debris -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_debris.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_debris_large -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_debris_large_4x4.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_04 -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - texture_unit - { - texture mp_explosion_04.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_trail -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend add - - texture_unit - { - texture mp_explosion_trail_01.dds - } - } - } -} -//----------------------------------------------------------------------------------------------------------------------- -material mp_explosion_water -{ - technique - { - pass - { - lighting off - depth_write off - scene_blend alpha_blend - - texture_unit - { - texture mp_explosion_water.dds - } - } - } -} - diff --git a/tests/cpp-tests/Resources/Particle3D/scripts/mp_explosion_04_blue.pu b/tests/cpp-tests/Resources/Particle3D/scripts/mp_explosion_04_blue.pu deleted file mode 100644 index c079bf9fa6..0000000000 --- a/tests/cpp-tests/Resources/Particle3D/scripts/mp_explosion_04_blue.pu +++ /dev/null @@ -1,380 +0,0 @@ -//----------------------------------------------------------------------------------------------------------------------- -// This script is part of the Particle Universe Media Pack 1 product. -// -// Copyright (c) 2010 Henry van Merode -// -// Usage of this program is licensed under the terms of the Particle Universe Commercial License Media Pack 1. -// You can find a copy of the Commercial License in the Media Pack 1 package. -//----------------------------------------------------------------------------------------------------------------------- -system Explosion/mp_explosion_04_blue - { - technique - { - visual_particle_quota 12 - material mp_explosion_04 - renderer Billboard - { - texture_coords_rows 2 - texture_coords_columns 2 - billboard_rotation_type vertex - } - emitter Point - { - emission_rate 100 - angle 360 - time_to_live dyn_random - { - min 0.4 - max 1.2 - } - velocity dyn_random - { - min 100 - max 500 - } - duration 0.1 - all_particle_dimensions dyn_random - { - min 1 - max 50 - } - colour 0.670588 0.8 0.996078 1 - } - affector ScaleVelocity - { - velocity_scale dyn_curved_linear - { - control_point 0 -1500 - control_point 1 -200 - } - } - affector Scale - { - xyz_scale 500 - } - affector Colour - { - time_colour 0 0 0.333333 0.701961 1 - time_colour 1 0 0 0 1 - } - affector TextureRotator - { - rotation dyn_random - { - min -3 - max 3 - } - rotation_speed 0 - } - observer OnTime - { - observe_until_event true - handler DoStopSystem - { - } - since_start_system true - on_time greater_than 2 - } - observer OnEmission - { - handler DoPlacementParticle - { - force_emitter BlackSmokeEmitter - inherit_direction true - inherit_time_to_live true - inherit_width true - inherit_height true - inherit_depth true - } - } - } - technique - { - visual_particle_quota 12 - material mp_explosion_smoke_01 - renderer Billboard - { - billboard_rotation_type vertex - } - emitter Point BlackSmokeEmitter - { - emission_rate 100 - angle 360 - time_to_live dyn_random - { - min 0.8 - max 1.2 - } - velocity dyn_random - { - min 100 - max 500 - } - duration 0.1 - all_particle_dimensions dyn_random - { - min 1 - max 50 - } - colour 0 0 0 1 - } - affector ScaleVelocity - { - velocity_scale dyn_curved_linear - { - control_point 0 -1500 - control_point 1 -200 - } - } - affector Scale - { - xyz_scale 400 - } - affector Colour - { - time_colour 0 0.294118 0.294118 0.294118 0 - time_colour 0.5 0.172549 0.172549 0.172549 0.3 - time_colour 0.6 0.137255 0.137255 0.137255 0.5 - time_colour 1 0 0 0 0 - } - affector TextureRotator - { - rotation dyn_random - { - min -3 - max 3 - } - rotation_speed 0 - } - } - technique - { - visual_particle_quota 50 - material mp_explosion_04 - renderer Billboard - { - texture_coords_rows 2 - texture_coords_columns 2 - billboard_type oriented_self - billboard_origin bottom_center - billboard_rotation_type vertex - } - emitter Point - { - emission_rate 1000 - angle 360 - time_to_live dyn_random - { - min 0.2 - max 0.4 - } - velocity dyn_random - { - min 200 - max 300 - } - duration 0.2 - particle_width dyn_random - { - min 10 - max 30 - } - particle_height dyn_random - { - min 1 - max 10 - } - texture_coords 2 - colour 0.670588 0.815686 0.996078 1 - } - affector Scale - { - y_scale dyn_random - { - min 100 - max 300 - } - } - affector Colour - { - time_colour 0 0 0.384314 0.807843 1 - time_colour 0.6 1 1 1 1 - time_colour 1 0 0 0 1 - } - } - technique - { - visual_particle_quota 50 - material mp_explosion_04 - renderer Billboard - { - texture_coords_rows 2 - texture_coords_columns 2 - billboard_type oriented_self - billboard_origin bottom_center - billboard_rotation_type vertex - } - emitter Point - { - emission_rate 1000 - angle 360 - time_to_live dyn_random - { - min 0.2 - max 0.4 - } - velocity dyn_random - { - min 100 - max 200 - } - duration 0.2 - particle_width dyn_random - { - min 10 - max 30 - } - particle_height dyn_random - { - min 1 - max 10 - } - texture_coords 3 - colour 0.984314 0.992157 0.67451 1 - } - affector Scale - { - x_scale dyn_random - { - min 60 - max 90 - } - y_scale dyn_random - { - min 200 - max 300 - } - } - affector Colour - { - time_colour 0 0 0.396078 0.835294 1 - time_colour 0.2 1 1 1 1 - time_colour 1 0 0 0 1 - colour_operation multiply - } - } - technique - { - visual_particle_quota 12 - material mp_explosion_04 - renderer Billboard - { - texture_coords_rows 2 - texture_coords_columns 2 - billboard_type oriented_self - billboard_rotation_type vertex - } - emitter Box - { - emission_rate 30 - angle 360 - time_to_live dyn_random - { - min 0.3 - max 0.5 - } - velocity dyn_random - { - min 5 - max 10 - } - duration 0.15 - all_particle_dimensions dyn_random - { - min 1 - max 50 - } - texture_coords 1 - colour 0.984314 0.992157 0.67451 1 - box_width 20 - box_height 20 - box_depth 20 - } - affector Scale - { - xyz_scale dyn_random - { - min 700 - max 1000 - } - } - affector Colour - { - time_colour 0 1 1 1 1 - time_colour 1 0 0 0 1 - } - affector TextureRotator - { - rotation dyn_random - { - min -3 - max 3 - } - rotation_speed 0 - } - } - technique - { - visual_particle_quota 20 - material mp_explosion_debris - renderer Billboard - { - billboard_type oriented_self - billboard_rotation_type vertex - } - emitter Point - { - emission_rate 200 - angle 360 - time_to_live dyn_random - { - min 0.5 - max 1 - } - velocity dyn_random - { - min 200 - max 350 - } - duration 0.1 - colour 0 0 0 1 - } - affector ScaleVelocity - { - velocity_scale dyn_curved_linear - { - control_point 0 -1500 - control_point 0.2 -200 - } - } - affector Scale - { - xyz_scale 300 - } - affector Colour - { - time_colour 0 0.65098 0.815686 1 1 - time_colour 0.5 0.0901961 0.52549 1 1 - time_colour 1 0 0 0 1 - } - affector TextureRotator - { - rotation dyn_random - { - min -3 - max 3 - } - rotation_speed 0 - } - } - } diff --git a/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua b/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua index bcff7db00d..ce537e5328 100644 --- a/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua +++ b/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua @@ -143,7 +143,7 @@ function Particle3DBlackHoleDemo:subtitle() end function Particle3DBlackHoleDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("blackHole.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("blackHole.pu", "pu_example.material") rootps:setCameraMask(cc.CameraFlag.USER1) rootps:setPosition(-25.0, 0.0) local moveby = cc.MoveBy:create(2.0, cc.p(50.0, 0.0)) @@ -182,7 +182,7 @@ function Particle3DHypnoDemo:subtitle() end function Particle3DHypnoDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("hypno.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("hypno.pu", "pu_example.material") rootps:setCameraMask(cc.CameraFlag.USER1) rootps:startParticleSystem() self:addChild(rootps, 0, PARTICLE_SYSTEM_TAG) @@ -258,7 +258,7 @@ function Particle3DTimeShiftDemo:subtitle() end function Particle3DTimeShiftDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("timeShift.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("timeShift.pu", "pu_example.material") rootps:setScale(2.0) rootps:setCameraMask(cc.CameraFlag.USER1) rootps:startParticleSystem() @@ -295,7 +295,7 @@ function Particle3DUVAnimDemo:subtitle() end function Particle3DUVAnimDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("UVAnimation.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("UVAnimation.pu", "pu_example.material") rootps:setCameraMask(cc.CameraFlag.USER1) rootps:startParticleSystem() self:addChild(rootps, 0, PARTICLE_SYSTEM_TAG) @@ -330,7 +330,7 @@ function Particle3DFirePlaceDemo:subtitle() end function Particle3DFirePlaceDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("mp_torch.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("mp_torch.pu", "pu_example.material") rootps:setCameraMask(cc.CameraFlag.USER1) rootps:setScale(5.0) rootps:startParticleSystem() @@ -376,43 +376,6 @@ function Particle3DElectricBeamSystemDemo:onExit() self:unscheduleUpdate() end - --- Particle3DExplosionBlueDemo -local Particle3DExplosionBlueDemo = class("Particle3DExplosionBlueDemo", function () - local layer = cc.Layer:create() - Helper.initWithLayer(layer) - return layer -end) - -function Particle3DExplosionBlueDemo:ctor() - -- body - self:init() -end - -function Particle3DExplosionBlueDemo:init() - baseInit(self) -end - -function Particle3DExplosionBlueDemo:title() - return "Particle3D Test" -end - -function Particle3DExplosionBlueDemo:subtitle() - return "ExplosionBlue" -end - -function Particle3DExplosionBlueDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("mp_explosion_04_blue.pu") - rootps:setCameraMask(cc.CameraFlag.USER1) - rootps:setScale(0.25) - rootps:startParticleSystem() - self:addChild(rootps, 0, PARTICLE_SYSTEM_TAG) -end - -function Particle3DExplosionBlueDemo:onExit() - self:unscheduleUpdate() -end - function Particle3DTest() local scene = cc.Scene:create() @@ -425,8 +388,7 @@ function Particle3DTest() Particle3DTimeShiftDemo.create, Particle3DUVAnimDemo.create, Particle3DFirePlaceDemo.create, - Particle3DElectricBeamSystemDemo.create, - Particle3DExplosionBlueDemo.create, + Particle3DElectricBeamSystemDemo.create } scene:addChild(Particle3DLineStreakDemo.create()) diff --git a/tests/lua-tests/src/mainMenu.lua b/tests/lua-tests/src/mainMenu.lua index 2803651b26..b5cdf161f8 100644 --- a/tests/lua-tests/src/mainMenu.lua +++ b/tests/lua-tests/src/mainMenu.lua @@ -113,7 +113,7 @@ local _allTests = { { isSupported = true, name = "OpenGLTest" , create_func= OpenGLTestMain }, { isSupported = true, name = "ParallaxTest" , create_func = ParallaxTestMain }, { isSupported = true, name = "ParticleTest" , create_func = ParticleTest }, - { isSupported = true, name = "Particle3DTest" , create_func = Particle3DTest }, + { isSupported = true, name = "Particle3D (PU)" , create_func = Particle3DTest }, { isSupported = true, name = "PerformanceTest" , create_func= PerformanceTestMain }, { isSupported = true, name = "PhysicsTest" , create_func = PhysicsTest }, { isSupported = true, name = "RenderTextureTest" , create_func = RenderTextureTestMain }, From d5bde9e5360dc2c0e6ea92744e15fe866807e8a5 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 28 Feb 2015 12:57:15 +0800 Subject: [PATCH 2/6] add missing material --- .../Particle3D/materials/pu_example.material | 100 ++++++++++++++++++ .../src/Particle3DTest/Particle3DTest.lua | 2 +- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material b/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material index c4fa3f7595..e7d3422e82 100644 --- a/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material +++ b/tests/cpp-tests/Resources/Particle3D/materials/pu_example.material @@ -559,3 +559,103 @@ material PUMediaPack/Pentagram_02 } } } + +//----------------------------------------------------------------------------------------------------------------------- +material PUMediaPack/Flare_04 +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture pump_flare_04.png + tex_address_mode clamp + } + } + } +} + +//----------------------------------------------------------------------------------------------------------------------- +material PUMediaPack/Streak_03 +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture pump_streak_03.png + tex_address_mode clamp + } + } + } +} + +//----------------------------------------------------------------------------------------- +material ParticleUniverse/Swirl_02 +{ + technique + { + pass + { + lighting off + scene_blend add + depth_write off + + texture_unit + { + texture pump_swirl_02.png + tex_address_mode clamp + } + } + } +} + +//----------------------------------------------------------------------------------------------------------------------- +material PUMediaPack/Watch +{ + technique + { + pass + { + lighting off + depth_write off + scene_blend add + + texture_unit + { + texture pump_watch.png + tex_address_mode clamp + } + } + } +} + +//----------------------------------------------------------------------------------------------------------------------- +material PUMediaPack/Hourglass +{ + technique + { + pass + { + lighting off + depth_write off + scene_blend add + + texture_unit + { + texture pump_hourglass.png + tex_address_mode clamp + } + } + } +} diff --git a/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua b/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua index ce537e5328..27090915c5 100644 --- a/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua +++ b/tests/lua-tests/src/Particle3DTest/Particle3DTest.lua @@ -106,7 +106,7 @@ function Particle3DLineStreakDemo:subtitle() end function Particle3DLineStreakDemo:onEnter() - local rootps = cc.PUParticleSystem3D:create("lineStreak.pu", "pu_mediapack_01.material") + local rootps = cc.PUParticleSystem3D:create("lineStreak.pu", "pu_example.material") rootps:setCameraMask(cc.CameraFlag.USER1) rootps:setScale(5.0) rootps:startParticleSystem() From 924a3cdff04ba4d0486c4e389dcd76efdc3b2a81 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 28 Feb 2015 14:26:33 +0800 Subject: [PATCH 3/6] create particle with pu and material --- tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp index b97680e0ee..e463b5fc29 100644 --- a/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp +++ b/tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp @@ -351,7 +351,7 @@ bool Particle3DLineStreakDemo::init() return false; - auto rootps = PUParticleSystem3D::create("lineStreak.pu"); + auto rootps = PUParticleSystem3D::create("lineStreak.pu", "pu_example.material"); rootps->setCameraMask((unsigned short)CameraFlag::USER1); rootps->setScale(5.0f); //rootps->runAction(RepeatForever::create(Sequence::create(rotate, nullptr))); From 56f3f34ee3d732ae61ee880110ffcc61adcb7c4a Mon Sep 17 00:00:00 2001 From: yangxiao Date: Sat, 28 Feb 2015 17:40:25 +0800 Subject: [PATCH 4/6] add Animate3D::setTransitionTime --- cocos/3d/CCAnimate3D.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index fc0df412cc..ba231a3ad7 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -89,9 +89,12 @@ public: void setOriginInterval(float interval); float getOriginInterval() const {return _originInterval; } - /** animate transition time */ + /** get animate transition time between 3d animations */ static float getTransitionTime() { return _transTime; } + /** set animate transition time between 3d animations */ + static void setTransitionTime(float transTime) { if (transTime > 0.f) _transTime = transTime; } + /**get & set play reverse, these are deprecated, use set negative speed instead*/ CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; } CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; } From 874f7c7f994a6794b3e9a6827932d0d725c02cb4 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 3 Mar 2015 10:42:47 +0800 Subject: [PATCH 5/6] fix transparent render bug --- cocos/3d/CCSprite3D.cpp | 12 ++++-------- cocos/renderer/CCMeshCommand.cpp | 2 ++ cocos/renderer/CCRenderCommand.cpp | 4 +++- .../ParticleRenders/CCPUParticle3DRender.cpp | 5 +++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index b387796338..7000acb58c 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -723,15 +723,11 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) GLuint textureID = mesh->getTexture() ? mesh->getTexture()->getName() : 0; #endif - float globalZ = _globalZOrder; bool isTransparent = (mesh->_isTransparent || color.a < 1.f); - if (isTransparent && Camera::getVisitingCamera()) - { - // use the view matrix for Applying to recalculating transparent mesh's Z-Order - const auto& viewMat = Camera::getVisitingCamera()->getViewMatrix(); - //fetch the Z from the result matrix - globalZ = -(viewMat.m[2] * transform.m[12] + viewMat.m[6] * transform.m[13] + viewMat.m[10] * transform.m[14] + viewMat.m[14]); - } + float globalZ = isTransparent ? 0 : _globalZOrder; + if (isTransparent) + flags |= Node::FLAGS_RENDER_AS_3D; + meshCommand.init(globalZ, textureID, programstate, _blend, mesh->getVertexBuffer(), mesh->getIndexBuffer(), mesh->getPrimitiveType(), mesh->getIndexFormat(), mesh->getIndexCount(), transform, flags); meshCommand.setLightMask(_lightMask); diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index 8fd3c00d4a..cb357611b7 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -111,6 +111,8 @@ void MeshCommand::init(float globalZOrder, { CCASSERT(glProgramState, "GLProgramState cannot be nill"); + RenderCommand::init(globalZOrder, mv, flags); + _globalOrder = globalZOrder; _textureID = textureID; _blendType = blendType; diff --git a/cocos/renderer/CCRenderCommand.cpp b/cocos/renderer/CCRenderCommand.cpp index a0affae504..6d4910c7bb 100644 --- a/cocos/renderer/CCRenderCommand.cpp +++ b/cocos/renderer/CCRenderCommand.cpp @@ -48,7 +48,9 @@ void RenderCommand::init(float globalZOrder, const cocos2d::Mat4 &transform, uin _globalOrder = globalZOrder; if (flags & Node::FLAGS_RENDER_AS_3D) { - _depth = Camera::getVisitingCamera()->getDepthInView(transform); + if (Camera::getVisitingCamera()) + _depth = Camera::getVisitingCamera()->getDepthInView(transform); + set3D(true); } else diff --git a/extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.cpp b/extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.cpp index e6e7107bc6..6b42498e2d 100644 --- a/extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.cpp +++ b/extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.cpp @@ -216,8 +216,9 @@ void PUParticle3DQuadRender::render(Renderer* renderer, const Mat4 &transform, P _indexBuffer->updateIndices(&_indexData[0], index/* * sizeof(unsigned short)*/, 0); GLuint texId = (_texture ? _texture->getName() : 0); - float depthZ = -(viewMat.m[2] * transform.m[12] + viewMat.m[6] * transform.m[13] + viewMat.m[10] * transform.m[14] + viewMat.m[14]); - _meshCommand->init(depthZ, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, 0); +// float depthZ = -(viewMat.m[2] * transform.m[12] + viewMat.m[6] * transform.m[13] + viewMat.m[10] * transform.m[14] + viewMat.m[14]); + _meshCommand->init(0, texId, _glProgramState, particleSystem->getBlendFunc(), _vertexBuffer->getVBO(), _indexBuffer->getVBO(), GL_TRIANGLES, GL_UNSIGNED_SHORT, index, transform, Node::FLAGS_RENDER_AS_3D); + _meshCommand->setTransparent(true); renderer->addCommand(_meshCommand); } From 38636dc8b7cde90c43244a7e1f92e351d22b92ee Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 3 Mar 2015 11:04:34 +0800 Subject: [PATCH 6/6] allow transition time to 0 --- cocos/3d/CCAnimate3D.cpp | 31 ++++++++++++++++++++----------- cocos/3d/CCAnimate3D.h | 2 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cocos/3d/CCAnimate3D.cpp b/cocos/3d/CCAnimate3D.cpp index 7e8a302154..799f024f66 100644 --- a/cocos/3d/CCAnimate3D.cpp +++ b/cocos/3d/CCAnimate3D.cpp @@ -131,17 +131,26 @@ void Animate3D::startWithTarget(Node *target) auto action = (*runningAction).second; if (action != this) { - s_fadeOutAnimates[sprite] = action; - action->_state = Animate3D::Animate3DState::FadeOut; - action->_accTransTime = 0.0f; - action->_weight = 1.0f; - action->_lastTime = 0.f; - - s_fadeInAnimates[sprite] = this; - _accTransTime = 0.0f; - _state = Animate3D::Animate3DState::FadeIn; - _weight = 0.f; - _lastTime = 0.f; + if (_transTime < 0.001f) + { + s_runningAnimates[sprite] = this; + _state = Animate3D::Animate3DState::Running; + _weight = 1.0f; + } + else + { + s_fadeOutAnimates[sprite] = action; + action->_state = Animate3D::Animate3DState::FadeOut; + action->_accTransTime = 0.0f; + action->_weight = 1.0f; + action->_lastTime = 0.f; + + s_fadeInAnimates[sprite] = this; + _accTransTime = 0.0f; + _state = Animate3D::Animate3DState::FadeIn; + _weight = 0.f; + _lastTime = 0.f; + } } } else diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index ba231a3ad7..128248cd3d 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -93,7 +93,7 @@ public: static float getTransitionTime() { return _transTime; } /** set animate transition time between 3d animations */ - static void setTransitionTime(float transTime) { if (transTime > 0.f) _transTime = transTime; } + static void setTransitionTime(float transTime) { if (transTime >= 0.f) _transTime = transTime; } /**get & set play reverse, these are deprecated, use set negative speed instead*/ CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; }