Merge branch '138-toggle-free-look-with-hotkey' into main/gingo-test
[ryzomcore.git] / ryzom / client / src / entity_fx.h
bloba14869b7b88d40275bf2e51ea15c3c02c29c0f84
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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_ENTITY_FX_H
20 #define CL_ENTITY_FX_H
22 #include <string>
23 #include <map>
25 #include "nel/misc/types_nl.h"
26 #include "nel/misc/vector.h"
27 #include "nel/misc/vectord.h"
28 #include "nel/3d/u_particle_system_instance.h"
30 /**
31 * CEntityFX class contained datas for instanciate an FX
32 * \author Alain Saffray
33 * \author Nevrax France
34 * \date 2001
36 class CEntityFx
38 public:
40 struct SStatusFx
42 uint32 AlwaysStarted : 1;
43 uint32 InfinityLoop : 1;
45 uint32 Started : 1;
47 SStatusFx( void )
49 AlwaysStarted = 0;
50 InfinityLoop = 0;
51 Started = 0;
55 /**
56 * Constructor
57 * \param FxName name of Fx, must be unique
58 * \param InstanceName name of instance (shape), used for instanciate FX
59 * \param Position initial position of Fx
60 * \param Rotation initial rotation matrix of Fx
62 CEntityFx( const std::string& FxName, const std::string& InstanceName, const NLMISC::CVector& Position, const NLMISC::CQuat& Rotation );
64 /**
65 * Destructor
67 ~CEntityFx();
69 /// Get Status of Fx
70 inline SStatusFx& getStatus( void ) { return _StatusFx; }
72 /// Set Status of Fx
73 inline void setStatus( const SStatusFx& Status ) { _StatusFx = Status; }
75 /// alwaysStarted return true if Fx must be always started or set it
76 inline bool alwaysStarted( void ) { return _StatusFx.AlwaysStarted; }
77 inline void alwaysStarted( bool b ) { _StatusFx.AlwaysStarted = b; }
79 /// infinityLoop return true if Fx is must be in InfinityLoop or set it
80 inline bool infinityLoop( void ) { return _StatusFx.InfinityLoop; }
81 inline void infinityLoop( bool b ) { _StatusFx.InfinityLoop = b; }
83 /// started return true if Fx is Started or set it
84 inline bool started( void ) { return _StatusFx.Started; }
85 inline void started( bool b ) { _StatusFx.Started = b; }
87 /// startFx
88 void startFx( void );
90 /// isTerminated return true if fx is finish
91 bool isTerminated( void );
93 /// deleteInstance
94 void deleteInstance( void);
96 private:
97 std::string _FxName;
98 std::string _InstanceName;
99 NLMISC::CVector _Position;
100 NLMISC::CQuat _Rotation;
101 SStatusFx _StatusFx;
103 NL3D::UParticleSystemInstance _FxInstance;
107 typedef std::map< std::string, CEntityFx *> TMapEntityFx;
108 extern TMapEntityFx EntityFx;
110 void newFx( const std::string& FxName, const std::string& InstanceName, const NLMISC::CVector& Position, const NLMISC::CQuat& Rotation );
111 void deleteFx( const std::string& FxName );
112 void startFx( const std::string& FxName );
113 void manageFxEntities( void );
115 #endif // CL_ENTITY_FX_H
117 /* End of entity_fx.h */