Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / ps_initial_pos.h
blob6c3c1ddcf18c886204344c05e50d087545a051a9
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
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/>.
17 #ifndef NL_PS_INITIAL_POS
18 #define NL_PS_INITIAL_POS
20 namespace NL3D
22 class CParticleSystem;
23 class CPSLocated;
24 class CPSLocatedBindable;
25 struct IPSMover;
29 /** this class helps to copy the position of initial instances in a particle
30 * system. This enable a system to run, and have its parameter modified.
31 * When the user press stop, he will find the system at t = 0, with the new parameters
33 class CPSInitialPos
35 public:
36 CPSInitialPos() : _PS(NULL) {}
37 // construct this by copying the datas of the system
38 void copySystemInitialPos(NL3D::CParticleSystem *ps);
39 /** reinitialize the system with its initial instances positions
40 * Works only once per copySystemInitialPos() call
41 */
42 void restoreSystem();
43 /// send back true when bbox display is enabled
44 bool isBBoxDisplayEnabled();
45 /// update data when a located in a particle system has been removed
46 void removeLocated(NL3D::CPSLocated *loc);
47 /// update data when a located bindable in a particle system has been removed
48 void removeLocatedBindable(NL3D::CPSLocatedBindable *lb);
49 // initial position and speed of a located instance in a particle system
50 struct CInitPSInstanceInfo
52 uint32 Index;
53 NL3D::CPSLocated *Loc;
54 NLMISC::CVector Speed;
55 NLMISC::CVector Pos;
57 // rotation and scale of an element
58 struct CRotScaleInfo
60 uint32 Index;
61 NL3D::CPSLocated *Loc;
62 NL3D::CPSLocatedBindable *LB;
63 NL3D::IPSMover *Psm;
64 NLMISC::CMatrix Rot;
65 NLMISC::CVector Scale;
67 NL3D::CParticleSystem *getPS() { return _PS; }
68 const NL3D::CParticleSystem *getPS() const { return _PS; }
69 bool isStateMemorized() const { return _PS != NULL; }
70 private:
71 typedef std::vector<CInitPSInstanceInfo> TInitInfoVect;
72 typedef std::vector<CRotScaleInfo> TRotScaleInfoVect;
73 typedef std::vector< std::pair<NL3D::CPSLocated *, uint32> > TInitialLocatedSizeVect;
74 TInitInfoVect _InitInfoVect;
75 TRotScaleInfoVect _RotScaleInfoVect;
76 // initial number of instances for each located
77 TInitialLocatedSizeVect _InitialSizeVect;
78 NL3D::CParticleSystem *_PS;
79 // reset all initial infos
80 void reset();
87 #endif