1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
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/>.
17 #ifndef NL_PS_INITIAL_POS
18 #define NL_PS_INITIAL_POS
22 class CParticleSystem
;
24 class CPSLocatedBindable
;
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
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
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
53 NL3D::CPSLocated
*Loc
;
54 NLMISC::CVector Speed
;
57 // rotation and scale of an element
61 NL3D::CPSLocated
*Loc
;
62 NL3D::CPSLocatedBindable
*LB
;
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
; }
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