00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef NL_ANIMATION_PLAYLIST_H
00027 #define NL_ANIMATION_PLAYLIST_H
00028
00029 #include "nel/misc/types_nl.h"
00030 #include "3d/channel_mixer.h"
00031
00032
00033 namespace NL3D
00034 {
00035
00036
00043 class CAnimationPlaylist : public NLMISC::CRefCount
00044 {
00045 public:
00046 enum
00047 {
00048
00049 empty=0xffffffff
00050 };
00051
00053 enum TWrapMode
00054 {
00056 Clamp=0,
00057
00059 Repeat,
00060
00062 Disable,
00063
00064 WrapModeCount
00065 };
00066
00068 CAnimationPlaylist();
00069
00073 void emptyPlayList ();
00074
00081 void setAnimation (uint8 slot, uint animation);
00082
00089 uint getAnimation (uint8 slot) const;
00090
00098 void setSkeletonWeight (uint8 slot, uint skeletonId, bool inverted=false);
00099
00107 uint getSkeletonWeight (uint8 slot, bool &inverted) const;
00108
00116 void setTimeOrigin (uint8 slot, TGlobalAnimationTime timeOrigin);
00117
00125 TGlobalAnimationTime getTimeOrigin (uint8 slot) const;
00126
00134 void setSpeedFactor (uint8 slot, float speedFactor);
00135
00143 float getSpeedFactor (uint8 slot) const;
00144
00153 void setStartWeight (uint8 slot, float startWeight, TGlobalAnimationTime time);
00154
00163 float getStartWeight (uint8 slot, TGlobalAnimationTime& time) const;
00164
00173 void setEndWeight (uint8 slot, float endWeight, TGlobalAnimationTime time);
00174
00183 float getEndWeight (uint8 slot, TGlobalAnimationTime& time) const;
00184
00194 void setWeightSmoothness (uint8 slot, float smoothness);
00195
00205 float getWeightSmoothness (uint8 slot) const;
00206
00216 void setupMixer (CChannelMixer& mixer, TGlobalAnimationTime time) const;
00217
00228 static float getWeightValue (TGlobalAnimationTime startWeightTime, TGlobalAnimationTime endWeightTime, TGlobalAnimationTime time, float startWeight, float endWeight, float smoothness);
00229
00236 void setWrapMode (uint8 slot, TWrapMode wrapMode);
00237
00244 TWrapMode getWrapMode (uint8 slot) const;
00245
00254 TAnimationTime getLocalTime (uint8 slot, TGlobalAnimationTime globalTime, const CAnimationSet& animSet) const;
00255
00264 float getLocalWeight (uint8 slot, TGlobalAnimationTime globalTime) const;
00265
00269 void serial (NLMISC::IStream& f);
00270
00271 private:
00272
00273
00274 uint32 _Animations[CChannelMixer::NumAnimationSlot];
00275
00276
00277 uint32 _SkeletonWeight[CChannelMixer::NumAnimationSlot];
00278
00279
00280 bool _InvertWeight[CChannelMixer::NumAnimationSlot];
00281
00282
00283 TGlobalAnimationTime _TimeOrigin[CChannelMixer::NumAnimationSlot];
00284
00285
00286 float _SpeedFactor[CChannelMixer::NumAnimationSlot];
00287
00288
00289 float _StartWeight[CChannelMixer::NumAnimationSlot];
00290
00291
00292 TGlobalAnimationTime _StartWeightTime[CChannelMixer::NumAnimationSlot];
00293
00294
00295 float _EndWeight[CChannelMixer::NumAnimationSlot];
00296
00297
00298 TGlobalAnimationTime _EndWeightTime[CChannelMixer::NumAnimationSlot];
00299
00300
00301 float _Smoothness[CChannelMixer::NumAnimationSlot];
00302
00303
00304 TWrapMode _WrapMode[CChannelMixer::NumAnimationSlot];
00305 };
00306
00307
00308 }
00309
00310
00311 #endif // NL_ANIMATION_PLAYLIST_H
00312
00313