1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CL_FX_MANAGER_H
20 #define CL_FX_MANAGER_H
27 #include "nel/misc/types_nl.h"
29 #include "nel/3d/u_particle_system_instance.h"
40 class UParticleSystemInstance
;
43 // when a fx has a timeout, it is
44 const float FX_MANAGER_DEFAULT_TIMEOUT
= 12.f
;
47 * Class to manage FXs.
48 * \author Guillaume PUZIN
49 * \author Nevrax France
60 // create and managed an fx (e.g destroy its model when it is finished)
61 NL3D::UParticleSystemInstance
instantFX(const std::string
&fxName
, float timeOut
= FX_MANAGER_DEFAULT_TIMEOUT
);
62 // Add an fx that will be created some time later
63 void deferFX(const std::string
&fxName
, const NLMISC::CMatrix
&matrix
, float delayInSeconds
, float timeOut
= FX_MANAGER_DEFAULT_TIMEOUT
);
64 // add an externally created fx to be managed
65 void addFX(NL3D::UParticleSystemInstance fx
, float timeOut
= FX_MANAGER_DEFAULT_TIMEOUT
, bool testNoMoreParticles
= false);
66 void fx2remove(NL3D::UParticleSystemInstance fx
, float timeOut
= FX_MANAGER_DEFAULT_TIMEOUT
);
68 // instantly removes all fxs that need to
70 // get the number of fx that are currently to be removed
71 uint
getNumFXtoRemove() const { return _NumFXToRemove
; }
76 NL3D::UParticleSystemInstance Instance
;
78 bool TestNoMoreParticles
;
80 CFX2Remove(NL3D::UParticleSystemInstance instance
=NL3D::UParticleSystemInstance(), float timeOut
= 0.f
, bool testNoMoreParticles
= false)
84 TestNoMoreParticles
= testNoMoreParticles
;
87 // List of FXs to remove as soon as possible.
88 std::list
<CFX2Remove
> _FX2RemoveList
;
94 NLMISC::CMatrix Matrix
;
99 CHashMultiMap
<uint64
, CDeferredFX
> _DeferredFXByDate
;
107 extern CFXManager FXMngr
;
110 #endif // CL_FX_MANAGER_H
112 /* End of fx_manager.h */