#include <play_list_user.h>
Inheritance diagram for NL3D::CPlayListUser:
Nevrax France
Definition at line 50 of file play_list_user.h.
Public Types | |
enum | { empty = 0xffffffff } |
enum | TWrapMode { Clamp = 0, Repeat, Disable, WrapModeCount } |
Wrap mode for the play list. More... | |
Public Member Functions | |
CPlayListUser (NLMISC::CSmartPtr< CAnimationSet > animationSet) | |
Constructor. | |
void | evalPlayList (double playTime) |
Tool function. setup the mixer, and eval global channels. | |
Animation Setup. | |
virtual void | emptyPlayList () |
virtual uint | getAnimation (uint8 slot) const |
virtual void | setAnimation (uint8 slot, uint animation) |
Special channel operation. | |
virtual void | enableChannel (uint channelId, bool enable) |
virtual bool | isChannelEnabled (uint channelId) const |
Animation Weight Setup. | |
virtual float | getEndWeight (uint8 slot, TGlobalAnimationTime &time) const |
virtual TAnimationTime | getLocalTime (uint8 slot, TGlobalAnimationTime globalTime, const UAnimationSet &animSet) const |
virtual float | getLocalWeight (uint8 slot, TGlobalAnimationTime globalTime) const |
virtual float | getStartWeight (uint8 slot, TGlobalAnimationTime &time) const |
virtual float | getWeightSmoothness (uint8 slot) const |
virtual void | setEndWeight (uint8 slot, float endWeight, TGlobalAnimationTime time) |
virtual void | setStartWeight (uint8 slot, float startWeight, TGlobalAnimationTime time) |
virtual void | setWeight (uint8 slot, float weight) |
virtual void | setWeightSmoothness (uint8 slot, float smoothness) |
Skeleton Weight Setup. | |
virtual uint | getSkeletonWeight (uint8 slot, bool &inverted) const |
virtual void | setSkeletonWeight (uint8 slot, uint skeletonId, bool inverted=false) |
Animation Time Setup. | |
virtual float | getSpeedFactor (uint8 slot) const |
virtual TGlobalAnimationTime | getTimeOrigin (uint8 slot) const |
virtual TWrapMode | getWrapMode (uint8 slot) const |
virtual void | setSpeedFactor (uint8 slot, float speedFactor) |
virtual void | setTimeOrigin (uint8 slot, TGlobalAnimationTime timeOrigin) |
virtual void | setWrapMode (uint8 slot, TWrapMode wrapMode) |
Animatable Link. | |
virtual void | registerTransform (UTransform *object, const char *prefix) |
virtual void | resetAllChannels () |
Private Attributes | |
NLMISC::CSmartPtr< CAnimationSet > | _AnimationSet |
CChannelMixer | _ChannelMixer |
CAnimationPlaylist | _PlayList |
Friends | |
class | CPlayListManagerUser |
|
Definition at line 63 of file u_play_list.h.
00064 { 00065 // 00066 empty=0xffffffff 00067 }; |
|
Wrap mode for the play list.
Definition at line 70 of file u_play_list.h.
00071 { 00073 Clamp=0, 00074 00076 Repeat, 00077 00079 Disable, 00080 00081 WrapModeCount 00082 }; |
|
Constructor.
Definition at line 64 of file play_list_user.h. References _ChannelMixer, NL3D_MEM_PLAYLIST, nlassert, NL3D::CChannelMixer::setAnimationSet(), and uint.
00065 { 00066 NL3D_MEM_PLAYLIST 00067 nlassert(animationSet!=NULL); 00068 _AnimationSet= animationSet; 00069 00070 _ChannelMixer.setAnimationSet(_AnimationSet); 00071 00072 nlassert((uint)UPlayList::empty == (uint)CAnimationPlaylist::empty); 00073 nlassert((uint)UPlayList::WrapModeCount == (uint)CAnimationPlaylist::WrapModeCount); 00074 } |
|
Empty the playlist. Each slot is set to its default value. Implements NL3D::UPlayList. Definition at line 94 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::emptyPlayList(), NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.
00095 { 00096 NL3D_MEM_PLAYLIST 00097 NL3D_HAUTO_UI_PLAY_LIST; 00098 00099 _PlayList.emptyPlayList (); 00100 } |
|
disabling a channel means it is no more modified during animation. Default is enabled. NB: this channel must have been added (via registerTransform()....).
Implements NL3D::UPlayList. Definition at line 246 of file play_list_user.cpp. References _ChannelMixer, NL3D::CChannelMixer::enableChannel(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and uint.
00247 { 00248 NL3D_MEM_PLAYLIST 00249 NL3D_HAUTO_UI_PLAY_LIST; 00250 00251 _ChannelMixer.enableChannel(channelId, enable); 00252 } |
|
Tool function. setup the mixer, and eval global channels.
Definition at line 264 of file play_list_user.cpp. References _ChannelMixer, _PlayList, NL3D::CChannelMixer::eval(), NL3D_MEM_PLAYLIST, and NL3D::CAnimationPlaylist::setupMixer(). Referenced by NL3D::CSkeletonUser::computeCurrentBBox().
00265 { 00266 NL3D_MEM_PLAYLIST 00267 _PlayList.setupMixer(_ChannelMixer, playTime); 00268 _ChannelMixer.eval(false); 00269 } |
|
Get the animation of a slot. Default value is empty.
Implements NL3D::UPlayList. Definition at line 110 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getAnimation(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, uint, and uint8.
00111 { 00112 NL3D_MEM_PLAYLIST 00113 NL3D_HAUTO_UI_PLAY_LIST; 00114 00115 return _PlayList.getAnimation (slot); 00116 } |
|
Get animation end weight. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 193 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getEndWeight(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::TGlobalAnimationTime, and uint8.
00194 { 00195 NL3D_MEM_PLAYLIST 00196 NL3D_HAUTO_UI_PLAY_LIST; 00197 00198 return _PlayList.getEndWeight (slot, time); 00199 } |
|
Convert a playlist global time in local time in a slot animation including wrap evaluation.
Implements NL3D::UPlayList. |
|
Compute weight of a slot at a given global playlist time
Implements NL3D::UPlayList. Definition at line 63 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getLocalWeight(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::TGlobalAnimationTime, and uint8.
00064 { 00065 NL3D_MEM_PLAYLIST 00066 NL3D_HAUTO_UI_PLAY_LIST; 00067 00068 return _PlayList.getLocalWeight (slot, globalTime); 00069 } |
|
Get the skeleton weight of a slot. Default value is empty.
Implements NL3D::UPlayList. Definition at line 236 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getSkeletonWeight(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, uint, and uint8.
00237 { 00238 NL3D_MEM_PLAYLIST 00239 NL3D_HAUTO_UI_PLAY_LIST; 00240 00241 return _PlayList.getSkeletonWeight (slot, inverted); 00242 } |
|
Get animation speed factor. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 143 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getSpeedFactor(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and uint8.
00144 { 00145 NL3D_MEM_PLAYLIST 00146 NL3D_HAUTO_UI_PLAY_LIST; 00147 00148 return _PlayList.getSpeedFactor (slot); 00149 } |
|
Get animation start weight. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 177 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getStartWeight(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::TGlobalAnimationTime, and uint8.
00178 { 00179 NL3D_MEM_PLAYLIST 00180 NL3D_HAUTO_UI_PLAY_LIST; 00181 00182 return _PlayList.getStartWeight(slot, time); 00183 } |
|
Get animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation. Default value is 0.f.
Implements NL3D::UPlayList. Definition at line 128 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getTimeOrigin(), NL3D_HAUTO_UI_PLAY_LIST, NL3D::TGlobalAnimationTime, and uint8.
00129 { 00130 NL3D_HAUTO_UI_PLAY_LIST; 00131 00132 return _PlayList.getTimeOrigin (slot); 00133 } |
|
Get weight smoothness. This is the smoothness of the weight interpolation. Must be between 0.f and 1.f. 0.f is a sharp interpolation (linear), 1.f is a smooth interpolation (quadratic). Default value is 0.f.
Implements NL3D::UPlayList. Definition at line 209 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getWeightSmoothness(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and uint8.
00210 { 00211 NL3D_MEM_PLAYLIST 00212 NL3D_HAUTO_UI_PLAY_LIST; 00213 00214 return _PlayList.getWeightSmoothness (slot); 00215 } |
|
Get the wrap mode in use in the play list. Wrap mode tells the play list how to use an animation when current time is not in the animation.
Implements NL3D::UPlayList. Definition at line 159 of file play_list_user.cpp. References _PlayList, NL3D::CAnimationPlaylist::getWrapMode(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, uint, and uint8.
00160 { 00161 NL3D_MEM_PLAYLIST 00162 NL3D_HAUTO_UI_PLAY_LIST; 00163 00164 return (UPlayList::TWrapMode)(uint)_PlayList.getWrapMode (slot); 00165 } |
|
see enableChannel(). return false if channel do not exist... NB: this channel must have been added (via registerTransform()....).
Implements NL3D::UPlayList. Definition at line 254 of file play_list_user.cpp. References _ChannelMixer, NL3D::CChannelMixer::isChannelEnabled(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and uint.
00255 { 00256 NL3D_MEM_PLAYLIST 00257 NL3D_HAUTO_UI_PLAY_LIST; 00258 00259 return _ChannelMixer.isChannelEnabled (channelId) ; 00260 } |
|
register an Animatable object (UTransform, UCamera, UInstance...) to the playlist. Before deleting this Animatable object, you SHOULD UPlayList::resetAllChannels() or delete the playlist from the playlistmanager.
Implements NL3D::UPlayList. Definition at line 73 of file play_list_user.cpp. References _ChannelMixer, NL3D::CTransformUser::getTransform(), NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, nlassert, and NL3D::CTransform::registerToChannelMixer().
00074 { 00075 NL3D_MEM_PLAYLIST 00076 NL3D_HAUTO_UI_PLAY_LIST; 00077 00078 CTransformUser *obj= dynamic_cast<CTransformUser*>(object); 00079 nlassert(obj); 00080 00081 // Register the transform to the channel mixer. 00082 obj->getTransform()->registerToChannelMixer(&_ChannelMixer, prefix); 00083 } |
|
Reset all channels so that no more Animatable object (Transforms etc...) are linked to this PLayList. Hence, the playlist has no effect on anything. Implements NL3D::UPlayList. Definition at line 84 of file play_list_user.cpp. References _ChannelMixer, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::CChannelMixer::resetChannels().
00085 { 00086 NL3D_MEM_PLAYLIST 00087 NL3D_HAUTO_UI_PLAY_LIST; 00088 00089 _ChannelMixer.resetChannels(); 00090 } |
|
Set the animation of a slot. Default value is empty.
Implements NL3D::UPlayList. Definition at line 102 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setAnimation(), uint, and uint8.
00103 { 00104 NL3D_MEM_PLAYLIST 00105 NL3D_HAUTO_UI_PLAY_LIST; 00106 00107 _PlayList.setAnimation (slot, animation); 00108 } |
|
Set animation end weight. This is the weight for this animation use at the end of the animation slot. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 185 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setEndWeight(), NL3D::TGlobalAnimationTime, and uint8.
00186 { 00187 NL3D_MEM_PLAYLIST 00188 NL3D_HAUTO_UI_PLAY_LIST; 00189 00190 _PlayList.setEndWeight (slot, endWeight, time); 00191 } |
|
Set the skeleton weight animation of a slot. Default value is empty.
Implements NL3D::UPlayList. Definition at line 228 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setSkeletonWeight(), uint, and uint8.
00229 { 00230 NL3D_MEM_PLAYLIST 00231 NL3D_HAUTO_UI_PLAY_LIST; 00232 00233 _PlayList.setSkeletonWeight (slot, skeletonId, inverted); 00234 } |
|
Set animation speed factor. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 135 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setSpeedFactor(), and uint8.
00136 { 00137 NL3D_MEM_PLAYLIST 00138 NL3D_HAUTO_UI_PLAY_LIST; 00139 00140 _PlayList.setSpeedFactor (slot, speedFactor); 00141 } |
|
Set animation start weight. This is the weight for this animation use at the beginning of the animation slot. Default value is 1.f.
Implements NL3D::UPlayList. Definition at line 169 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setStartWeight(), NL3D::TGlobalAnimationTime, and uint8.
00170 { 00171 NL3D_MEM_PLAYLIST 00172 NL3D_HAUTO_UI_PLAY_LIST; 00173 00174 _PlayList.setStartWeight (slot, startWeight, time); 00175 } |
|
Set animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation. Default value is 0.f.
Implements NL3D::UPlayList. Definition at line 120 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setTimeOrigin(), NL3D::TGlobalAnimationTime, and uint8.
00121 { 00122 NL3D_MEM_PLAYLIST 00123 NL3D_HAUTO_UI_PLAY_LIST; 00124 00125 _PlayList.setTimeOrigin (slot, timeOrigin); 00126 } |
|
Setup a constant animation weight. NB: this is equivalent as following code:
Implements NL3D::UPlayList. Definition at line 217 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setEndWeight(), NL3D::CAnimationPlaylist::setStartWeight(), and uint8.
00218 { 00219 NL3D_MEM_PLAYLIST 00220 NL3D_HAUTO_UI_PLAY_LIST; 00221 00222 _PlayList.setStartWeight (slot, weight, 0); 00223 _PlayList.setEndWeight (slot, weight, 0); 00224 } |
|
Set weight smoothness. This is the smoothness of the weight interpolation. Must be between 0.f and 1.f. 0.f is a sharp interpolation (linear), 1.f is a smooth interpolation (quadratic). Default value is 0.f.
Implements NL3D::UPlayList. Definition at line 201 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setWeightSmoothness(), and uint8.
00202 { 00203 NL3D_MEM_PLAYLIST 00204 NL3D_HAUTO_UI_PLAY_LIST; 00205 00206 _PlayList.setWeightSmoothness (slot, smoothness); 00207 } |
|
Set the wrap mode to use in the play list. Wrap mode tells the play list how to use an animation when current time is not in the animation.
Implements NL3D::UPlayList. Definition at line 151 of file play_list_user.cpp. References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, NL3D::CAnimationPlaylist::setWrapMode(), uint, and uint8.
00152 { 00153 NL3D_MEM_PLAYLIST 00154 NL3D_HAUTO_UI_PLAY_LIST; 00155 00156 _PlayList.setWrapMode (slot, (CAnimationPlaylist::TWrapMode)(uint)wrapMode); 00157 } |
|
Definition at line 58 of file play_list_user.h. |
|
Definition at line 56 of file play_list_user.h. |
|
Definition at line 54 of file play_list_user.h. Referenced by CPlayListUser(), NL3D::CPlayListManagerUser::createPlayList(), enableChannel(), evalPlayList(), isChannelEnabled(), registerTransform(), and resetAllChannels(). |
|