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_ANIMATION_FX_H
20 #define CL_ANIMATION_FX_H
22 #include "client_sheets/animation_fx_sheet.h"
23 #include "client_sheets/animation_fx_set_sheet.h"
32 class UParticleSystemInstance
;
40 /** Sheet of a fx that must be played with an animation.
41 * Such an fx has the following properties :
42 * - it can have a color
43 * - it can be sticked to a bone when used with a skeleton
44 * - it can follow a position spline for more sophisticated effects.
46 * \author Nicolas Vizerie
47 * \author Nevrax France
54 NL3D::UTrack
*PosTrack
; // Filled after init : additionnal pos track to animate the fx
55 const CAnimationFXSheet
*Sheet
;
60 CAnimationFX(const std::string
&psName
= "", const float *userParams
= NULL
);
62 void init(const CAnimationFXSheet
*sheet
, NL3D::UAnimationSet
*as
);
64 /** helper : create instance matching that sheet. NB : the instance is not sticked neither positionned.
65 * 4 user params may be supplied to replace the default ones
67 NL3D::UParticleSystemInstance
createMatchingInstance(const float *customUserParams
= NULL
) const;
70 // build track for that fx, using the given animation set
71 void buildTrack(NL3D::UAnimationSet
*as
);
75 /** A set of anim fx serialized from a .animation_fx_set sheet.
76 * Those fx are intended to be all instanciated at once, hence the small number of instances
81 enum { MaxNumFX
= CAnimationFXSetSheet::MaxNumFX
};
82 std::vector
<CAnimationFX
> FX
; // matching track for each fx
83 const CAnimationFXSetSheet
*Sheet
;
85 CAnimationFXSet() : Sheet(NULL
) {}
86 void init(const CAnimationFXSetSheet
*sheet
, NL3D::UAnimationSet
*as
);