# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CPlayListUser Class Reference

UPlayList implementation. More...

#include <play_list_user.h>

Inheritance diagram for NL3D::CPlayListUser:

NL3D::UPlayList List of all members.

Public Methods

 CPlayListUser (NLMISC::CSmartPtr< CAnimationSet > animationSet)
 Constructor. More...

void evalPlayList (double playTime)
 Tool function. setup the mixer, and eval global channels. More...

Animatable Link.
virtual void registerTransform (UTransform *object, const char *prefix)
 register an Animatable object (UTransform, UCamera, UInstance...) to the playlist. More...

virtual void resetAllChannels ()
 Reset all channels so that no more Animatable object (Transforms etc...) are linked to this PLayList. More...

Animation Setup.
virtual void emptyPlayList ()
 Empty the playlist. More...

virtual void setAnimation (uint8 slot, uint animation)
 Set the animation of a slot. More...

virtual uint getAnimation (uint8 slot) const
 Get the animation of a slot. More...

Animation Time Setup.
virtual void setTimeOrigin (uint8 slot, TGlobalAnimationTime timeOrigin)
 Set animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation. More...

virtual TGlobalAnimationTime getTimeOrigin (uint8 slot) const
 Get animation time origin, ie, the time in the playlist for which slot time is the startTime of the slot animation. More...

virtual void setSpeedFactor (uint8 slot, float speedFactor)
 Set animation speed factor. More...

virtual float getSpeedFactor (uint8 slot) const
 Get animation speed factor. More...

virtual void setWrapMode (uint8 slot, TWrapMode wrapMode)
 Set the wrap mode to use in the play list. More...

virtual TWrapMode getWrapMode (uint8 slot) const
 Get the wrap mode in use in the play list. More...

Animation Weight Setup.
virtual void setStartWeight (uint8 slot, float startWeight, TGlobalAnimationTime time)
 Set animation start weight. More...

virtual float getStartWeight (uint8 slot, TGlobalAnimationTime &time) const
 Get animation start weight. More...

virtual void setEndWeight (uint8 slot, float endWeight, TGlobalAnimationTime time)
 Set animation end weight. More...

virtual float getEndWeight (uint8 slot, TGlobalAnimationTime &time) const
 Get animation end weight. More...

virtual void setWeightSmoothness (uint8 slot, float smoothness)
 Set weight smoothness. More...

virtual float getWeightSmoothness (uint8 slot) const
 Get weight smoothness. More...

virtual void setWeight (uint8 slot, float weight)
 Setup a constant animation weight. More...

virtual TAnimationTime getLocalTime (uint8 slot, TGlobalAnimationTime globalTime, const UAnimationSet &animSet) const
 Convert a playlist global time in local time in a slot animation including wrap evaluation. More...

virtual float getLocalWeight (uint8 slot, TGlobalAnimationTime globalTime) const
 Compute weight of a slot at a given global playlist time. More...

Skeleton Weight Setup.
virtual void setSkeletonWeight (uint8 slot, uint skeletonId, bool inverted=false)
 Set the skeleton weight animation of a slot. More...

virtual uint getSkeletonWeight (uint8 slot, bool &inverted) const
 Get the skeleton weight of a slot. More...

Special channel operation.
virtual void enableChannel (uint channelId, bool enable)
 disabling a channel means it is no more modified during animation. More...

virtual bool isChannelEnabled (uint channelId) const
 see enableChannel(). More...


Private Attributes

CAnimationPlaylist _PlayList
CChannelMixer _ChannelMixer
NLMISC::CSmartPtr< CAnimationSet_AnimationSet

Friends

class CPlayListManagerUser

Detailed Description

UPlayList implementation.

Basicly, this is a playlist, plus a ChannelMixer.

Author:
Lionel Berenguier , Nevrax France
Date:
2001

Definition at line 50 of file play_list_user.h.


Constructor & Destructor Documentation

NL3D::CPlayListUser::CPlayListUser NLMISC::CSmartPtr< CAnimationSet   animationSet [inline]
 

Constructor.

Definition at line 64 of file play_list_user.h.

References _ChannelMixer, NL3D_MEM_PLAYLIST, and nlassert.


Member Function Documentation

void NL3D::CPlayListUser::emptyPlayList   [virtual]
 

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_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::enableChannel uint    channelId,
bool    enable
[virtual]
 

disabling a channel means it is no more modified during animation.

Default is enabled. NB: this channel must have been added (via registerTransform()....).

Parameters:
channelId  channelId get from UAnimationSet::getChannelIdByName().

Implements NL3D::UPlayList.

Definition at line 246 of file play_list_user.cpp.

References _ChannelMixer, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::evalPlayList double    playTime
 

Tool function. setup the mixer, and eval global channels.

Definition at line 264 of file play_list_user.cpp.

References _ChannelMixer, _PlayList, and NL3D_MEM_PLAYLIST.

uint NL3D::CPlayListUser::getAnimation uint8    slot const [virtual]
 

Get the animation of a slot.

Default value is empty.

Parameters:
slot  is the id of the slot to set.
Returns:
the animation number in use in this slot. Return UPlayList::empty if the slot is empty.

Implements NL3D::UPlayList.

Definition at line 110 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

float NL3D::CPlayListUser::getEndWeight uint8    slot,
TGlobalAnimationTime   time
const [virtual]
 

Get animation end weight.

Default value is 1.f.

Parameters:
slot  is the id to get the slot.
time  will get the playlist time for which the start weight is set. Default is 0.f.
Returns:
the end weight used in the slot.

Implements NL3D::UPlayList.

Definition at line 193 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

TAnimationTime NL3D::CPlayListUser::getLocalTime uint8    slot,
TGlobalAnimationTime    globalTime,
const UAnimationSet   animSet
const [virtual]
 

Convert a playlist global time in local time in a slot animation including wrap evaluation.

Parameters:
slot  is the slot in which the local time must be computed
time  is the global time of the playlist
Returns:
the local time in the slot. If no animation are set in the slot, globalTime is returned.

Implements NL3D::UPlayList.

Definition at line 46 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, nlassert, NL3D::TAnimationTime, and NL3D::TGlobalAnimationTime.

float NL3D::CPlayListUser::getLocalWeight uint8    slot,
TGlobalAnimationTime    globalTime
const [virtual]
 

Compute weight of a slot at a given global playlist time.

Parameters:
slot  is the slot in which the weight must be computed
time  is the global time of the playlist
Returns:
the weight of the slot for the given time.

Implements NL3D::UPlayList.

Definition at line 63 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

uint NL3D::CPlayListUser::getSkeletonWeight uint8    slot,
bool &    inverted
const [virtual]
 

Get the skeleton weight of a slot.

Default value is empty.

Parameters:
slot  is the id of the slot to set.
inverted  will receive the invert flag.
Returns:
the skeleton weight number in use in this slot. Return UPlayList::empty if the slot is empty.

Implements NL3D::UPlayList.

Definition at line 236 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

float NL3D::CPlayListUser::getSpeedFactor uint8    slot const [virtual]
 

Get animation speed factor.

Default value is 1.f.

Parameters:
slot  is the id to get the slot.
Returns:
the speed factor used in the slot.

Implements NL3D::UPlayList.

Definition at line 143 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

float NL3D::CPlayListUser::getStartWeight uint8    slot,
TGlobalAnimationTime   time
const [virtual]
 

Get animation start weight.

Default value is 1.f.

Parameters:
slot  is the id to get the slot.
time  will get the playlist time for which the start weight is set. Default is 0.f.
Returns:
the start weight used in the slot.

Implements NL3D::UPlayList.

Definition at line 177 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

TGlobalAnimationTime NL3D::CPlayListUser::getTimeOrigin uint8    slot const [virtual]
 

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.

Parameters:
slot  is the id to get the slot.
Returns:
time origin used in the slot.

Implements NL3D::UPlayList.

Definition at line 128 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D::TGlobalAnimationTime.

float NL3D::CPlayListUser::getWeightSmoothness uint8    slot const [virtual]
 

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.

Parameters:
slot  is the id of the slot to set.
Returns:
the smoothness value.

Implements NL3D::UPlayList.

Definition at line 209 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

UPlayList::TWrapMode NL3D::CPlayListUser::getWrapMode uint8    slot const [virtual]
 

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.

Returns:
the wrap mode in use.

Implements NL3D::UPlayList.

Definition at line 159 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

bool NL3D::CPlayListUser::isChannelEnabled uint    channelId const [virtual]
 

see enableChannel().

return false if channel do not exist... NB: this channel must have been added (via registerTransform()....).

Parameters:
channelId  channelId get from UAnimationSet::getChannelIdByName().

Implements NL3D::UPlayList.

Definition at line 254 of file play_list_user.cpp.

References _ChannelMixer, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::registerTransform UTransform   object,
const char *    prefix
[virtual]
 

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.

Parameters:
object  is the object which will be affected by this animation playlist.

Implements NL3D::UPlayList.

Definition at line 73 of file play_list_user.cpp.

References _ChannelMixer, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and nlassert.

void NL3D::CPlayListUser::resetAllChannels   [virtual]
 

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, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setAnimation uint8    slot,
uint    animation
[virtual]
 

Set the animation of a slot.

Default value is empty.

Parameters:
slot  is the id of the slot to set.
animation  is the animation number to use in this slot. To empty the slot, use UPlayList::empty.

Implements NL3D::UPlayList.

Definition at line 102 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setEndWeight uint8    slot,
float    endWeight,
TGlobalAnimationTime    time
[virtual]
 

Set animation end weight.

This is the weight for this animation use at the end of the animation slot. Default value is 1.f.

Parameters:
slot  is the id of the slot to set.
time  is the playlist time for which the start weight is set. Default is 1.f.
endWeight  is the factor to use in this slot.

Implements NL3D::UPlayList.

Definition at line 185 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

void NL3D::CPlayListUser::setSkeletonWeight uint8    slot,
uint    skeletonId,
bool    inverted = false
[virtual]
 

Set the skeleton weight animation of a slot.

Default value is empty.

Parameters:
slot  is the id of the slot to set.
skeletonId  is the skeleton weight number to use in this slot. To empty the slot, use UPlayList::empty.
inverted  is false if the weights must be used as they are, true if the weights to used are 1.f - weight.

Implements NL3D::UPlayList.

Definition at line 228 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setSpeedFactor uint8    slot,
float    speedFactor
[virtual]
 

Set animation speed factor.

Default value is 1.f.

Parameters:
slot  is the id of the slot to set.
speedFactor  is the factor to use in this slot. The animation will go speedFactor* faster.

Implements NL3D::UPlayList.

Definition at line 135 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setStartWeight uint8    slot,
float    startWeight,
TGlobalAnimationTime    time
[virtual]
 

Set animation start weight.

This is the weight for this animation use at the beginning of the animation slot. Default value is 1.f.

Parameters:
slot  is the id of the slot to set.
startWeight  is the factor to use in this slot.
time  is the playlist time for which the start weight is set. Default is 0.f.

Implements NL3D::UPlayList.

Definition at line 169 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

void NL3D::CPlayListUser::setTimeOrigin uint8    slot,
TGlobalAnimationTime    timeOrigin
[virtual]
 

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.

Parameters:
slot  is the id of the slot to set.
timeOrigin  time origin to use in the slot.

Implements NL3D::UPlayList.

Definition at line 120 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, NL3D_MEM_PLAYLIST, and NL3D::TGlobalAnimationTime.

void NL3D::CPlayListUser::setWeight uint8    slot,
float    weight
[virtual]
 

Setup a constant animation weight.

NB: this is equivalent as following code:

  • setStartWeight(slot, weight, 0);
  • setEndWeight(slot, weight, 0);
Parameters:
slot  is the id of the slot to set.
weight  is the factor to use in this slot.

Implements NL3D::UPlayList.

Definition at line 217 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setWeightSmoothness uint8    slot,
float    smoothness
[virtual]
 

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.

Parameters:
slot  is the id of the slot to set.
smoothness  is the smoothness value.

Implements NL3D::UPlayList.

Definition at line 201 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.

void NL3D::CPlayListUser::setWrapMode uint8    slot,
TWrapMode    wrapMode
[virtual]
 

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.

Parameters:
wrapMode  is the mode to use.

Implements NL3D::UPlayList.

Definition at line 151 of file play_list_user.cpp.

References _PlayList, NL3D_HAUTO_UI_PLAY_LIST, and NL3D_MEM_PLAYLIST.


Friends And Related Function Documentation

friend class CPlayListManagerUser [friend]
 

Definition at line 58 of file play_list_user.h.


Member Data Documentation

NLMISC::CSmartPtr<CAnimationSet> NL3D::CPlayListUser::_AnimationSet [private]
 

Definition at line 56 of file play_list_user.h.

CChannelMixer NL3D::CPlayListUser::_ChannelMixer [private]
 

Definition at line 54 of file play_list_user.h.

Referenced by CPlayListUser, enableChannel, evalPlayList, isChannelEnabled, registerTransform, and resetAllChannels.

CAnimationPlaylist NL3D::CPlayListUser::_PlayList [private]
 

Definition at line 53 of file play_list_user.h.

Referenced by emptyPlayList, evalPlayList, getAnimation, getEndWeight, getLocalTime, getLocalWeight, getSkeletonWeight, getSpeedFactor, getStartWeight, getTimeOrigin, getWeightSmoothness, getWrapMode, setAnimation, setEndWeight, setSkeletonWeight, setSpeedFactor, setStartWeight, setTimeOrigin, setWeight, setWeightSmoothness, and setWrapMode.


The documentation for this class was generated from the following files: