# 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::CAnimationPlaylist Class Reference

This class. More...

#include <animation_playlist.h>

Inheritance diagram for NL3D::CAnimationPlaylist:

NLMISC::CRefCount List of all members.

Public Types

enum  { empty = 0xffffffff }
enum  TWrapMode { Clamp = 0, Repeat, Disable, WrapModeCount }
 Wrap mode for the play list. More...


Public Methods

 CAnimationPlaylist ()
 Constructor. More...

void emptyPlayList ()
 Empty the playlist. More...

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

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

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

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

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...

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...

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

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

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

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

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

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

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

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

void setupMixer (CChannelMixer &mixer, TGlobalAnimationTime time) const
 Setup a channel mixer. More...

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

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

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

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

void serial (NLMISC::IStream &f)
 Serial. More...


Static Public Methods

float getWeightValue (TGlobalAnimationTime startWeightTime, TGlobalAnimationTime endWeightTime, TGlobalAnimationTime time, float startWeight, float endWeight, float smoothness)
 Static interpolation method of blend value. More...


Private Attributes

uint32 _Animations [CChannelMixer::NumAnimationSlot]
uint32 _SkeletonWeight [CChannelMixer::NumAnimationSlot]
bool _InvertWeight [CChannelMixer::NumAnimationSlot]
TGlobalAnimationTime _TimeOrigin [CChannelMixer::NumAnimationSlot]
float _SpeedFactor [CChannelMixer::NumAnimationSlot]
float _StartWeight [CChannelMixer::NumAnimationSlot]
TGlobalAnimationTime _StartWeightTime [CChannelMixer::NumAnimationSlot]
float _EndWeight [CChannelMixer::NumAnimationSlot]
TGlobalAnimationTime _EndWeightTime [CChannelMixer::NumAnimationSlot]
float _Smoothness [CChannelMixer::NumAnimationSlot]
TWrapMode _WrapMode [CChannelMixer::NumAnimationSlot]

Detailed Description

This class.

Author:
Cyril 'Hulud' Corvazier , Nevrax France
Date:
2001

Definition at line 43 of file animation_playlist.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
empty 

Definition at line 46 of file animation_playlist.h.

enum NL3D::CAnimationPlaylist::TWrapMode
 

Wrap mode for the play list.

Enumeration values:
Clamp  Clamp the animation time. (default).
Repeat  Repeat the animation.
Disable  Disable the animation.
WrapModeCount 

Definition at line 53 of file animation_playlist.h.


Constructor & Destructor Documentation

NL3D::CAnimationPlaylist::CAnimationPlaylist  
 

Constructor.

Definition at line 40 of file animation_playlist.cpp.

References _WrapMode, Clamp, and emptyPlayList.


Member Function Documentation

void NL3D::CAnimationPlaylist::emptyPlayList  
 

Empty the playlist.

Each slot is set to its default value.

Definition at line 52 of file animation_playlist.cpp.

References _Animations, _EndWeight, _InvertWeight, _SkeletonWeight, _SpeedFactor, _StartWeight, _TimeOrigin, and empty.

Referenced by CAnimationPlaylist.

uint NL3D::CAnimationPlaylist::getAnimation uint8    slot const
 

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 CAnimationPlaylist::empty if the slot is empty.

Definition at line 76 of file animation_playlist.cpp.

References _Animations.

float NL3D::CAnimationPlaylist::getEndWeight uint8    slot,
TGlobalAnimationTime   time
const
 

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.

Definition at line 151 of file animation_playlist.cpp.

References _EndWeight, _EndWeightTime, and NL3D::TGlobalAnimationTime.

TAnimationTime NL3D::CAnimationPlaylist::getLocalTime uint8    slot,
TGlobalAnimationTime    globalTime,
const CAnimationSet   animSet
const
 

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.

Definition at line 313 of file animation_playlist.cpp.

References _Animations, _SpeedFactor, _TimeOrigin, _WrapMode, NLMISC::clamp, Clamp, Repeat, NL3D::TAnimationTime, and NL3D::TGlobalAnimationTime.

Referenced by setupMixer.

float NL3D::CAnimationPlaylist::getLocalWeight uint8    slot,
TGlobalAnimationTime    globalTime
const
 

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.

Definition at line 352 of file animation_playlist.cpp.

References _EndWeight, _EndWeightTime, _Smoothness, _StartWeight, _StartWeightTime, getWeightValue, and NL3D::TGlobalAnimationTime.

uint NL3D::CAnimationPlaylist::getSkeletonWeight uint8    slot,
bool &    inverted
const
 

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 CAnimationPlaylist::empty if the slot is empty.

Definition at line 91 of file animation_playlist.cpp.

References _InvertWeight, and _SkeletonWeight.

float NL3D::CAnimationPlaylist::getSpeedFactor uint8    slot const
 

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.

Definition at line 120 of file animation_playlist.cpp.

References _SpeedFactor.

float NL3D::CAnimationPlaylist::getStartWeight uint8    slot,
TGlobalAnimationTime   time
const
 

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.

Definition at line 135 of file animation_playlist.cpp.

References _StartWeight, _StartWeightTime, and NL3D::TGlobalAnimationTime.

TGlobalAnimationTime NL3D::CAnimationPlaylist::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.

Default value is 0.f.

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

Definition at line 106 of file animation_playlist.cpp.

References _TimeOrigin, and NL3D::TGlobalAnimationTime.

float NL3D::CAnimationPlaylist::getWeightSmoothness uint8    slot const
 

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.

Definition at line 166 of file animation_playlist.cpp.

References _Smoothness.

float NL3D::CAnimationPlaylist::getWeightValue TGlobalAnimationTime    startWeightTime,
TGlobalAnimationTime    endWeightTime,
TGlobalAnimationTime    time,
float    startWeight,
float    endWeight,
float    smoothness
[static]
 

Static interpolation method of blend value.

Parameters:
startBlendTime  is the time when the blend starts.
endBlendTime  is the time when the blend ends.
time  is the current time.
startBlend  is the blend value at start.
endBlend  is the blend value at end.
smoothness  is the smoothnes value. (Must be between 0 and 1)

Definition at line 243 of file animation_playlist.cpp.

References NL3D::TGlobalAnimationTime, and x.

Referenced by getLocalWeight, and setupMixer.

CAnimationPlaylist::TWrapMode NL3D::CAnimationPlaylist::getWrapMode uint8    slot const
 

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.

Definition at line 282 of file animation_playlist.cpp.

References _WrapMode.

void NL3D::CAnimationPlaylist::serial NLMISC::IStream   f
 

Serial.

Definition at line 289 of file animation_playlist.cpp.

References _Animations, _EndWeight, _EndWeightTime, _InvertWeight, _SkeletonWeight, _Smoothness, _SpeedFactor, _StartWeight, _StartWeightTime, _TimeOrigin, _WrapMode, NLMISC::IStream::serial, NLMISC::IStream::serialEnum, and NLMISC::IStream::serialVersion.

void NL3D::CAnimationPlaylist::setAnimation uint8    slot,
uint    animation
 

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 CAnimationPlaylist::empty.

Definition at line 69 of file animation_playlist.cpp.

References _Animations.

void NL3D::CAnimationPlaylist::setEndWeight uint8    slot,
float    endWeight,
TGlobalAnimationTime    time
 

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.

Definition at line 143 of file animation_playlist.cpp.

References _EndWeight, _EndWeightTime, and NL3D::TGlobalAnimationTime.

void NL3D::CAnimationPlaylist::setSkeletonWeight uint8    slot,
uint    skeletonId,
bool    inverted = false
 

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 CAnimationPlaylist::empty.
inverted  is false if the weights must be used as they are, true if the weights to used are 1.f - weight.

Definition at line 83 of file animation_playlist.cpp.

References _InvertWeight, and _SkeletonWeight.

void NL3D::CAnimationPlaylist::setSpeedFactor uint8    slot,
float    speedFactor
 

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.

Definition at line 113 of file animation_playlist.cpp.

References _SpeedFactor.

void NL3D::CAnimationPlaylist::setStartWeight uint8    slot,
float    startWeight,
TGlobalAnimationTime    time
 

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.

Definition at line 127 of file animation_playlist.cpp.

References _StartWeight, _StartWeightTime, and NL3D::TGlobalAnimationTime.

void NL3D::CAnimationPlaylist::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.

Default value is 0.f.

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

Definition at line 99 of file animation_playlist.cpp.

References _TimeOrigin, and NL3D::TGlobalAnimationTime.

void NL3D::CAnimationPlaylist::setupMixer CChannelMixer   mixer,
TGlobalAnimationTime    time
const
 

Setup a channel mixer.

For each slot, it sets : * the animation id used by the slot. * the animation time according with the begin time of each slot, the speed factor of each slot and the current time passed in parameter. * the skeleton weight id. * the weight interpolated with the start and end values. The weight value are clamped before and after the animation.

Definition at line 173 of file animation_playlist.cpp.

References _Animations, _EndWeight, _EndWeightTime, _InvertWeight, _SkeletonWeight, _Smoothness, _StartWeight, _StartWeightTime, _WrapMode, Disable, empty, getLocalTime, getWeightValue, s, NL3D::TAnimationTime, and NL3D::TGlobalAnimationTime.

void NL3D::CAnimationPlaylist::setWeightSmoothness uint8    slot,
float    smoothness
 

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.

Definition at line 159 of file animation_playlist.cpp.

References _Smoothness.

void NL3D::CAnimationPlaylist::setWrapMode uint8    slot,
TWrapMode    wrapMode
 

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.

Definition at line 275 of file animation_playlist.cpp.

References _WrapMode.


Member Data Documentation

uint32 NL3D::CAnimationPlaylist::_Animations[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 274 of file animation_playlist.h.

Referenced by emptyPlayList, getAnimation, getLocalTime, serial, setAnimation, and setupMixer.

float NL3D::CAnimationPlaylist::_EndWeight[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 295 of file animation_playlist.h.

Referenced by emptyPlayList, getEndWeight, getLocalWeight, serial, setEndWeight, and setupMixer.

TGlobalAnimationTime NL3D::CAnimationPlaylist::_EndWeightTime[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 298 of file animation_playlist.h.

Referenced by getEndWeight, getLocalWeight, serial, setEndWeight, and setupMixer.

bool NL3D::CAnimationPlaylist::_InvertWeight[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 280 of file animation_playlist.h.

Referenced by emptyPlayList, getSkeletonWeight, serial, setSkeletonWeight, and setupMixer.

uint32 NL3D::CAnimationPlaylist::_SkeletonWeight[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 277 of file animation_playlist.h.

Referenced by emptyPlayList, getSkeletonWeight, serial, setSkeletonWeight, and setupMixer.

float NL3D::CAnimationPlaylist::_Smoothness[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 301 of file animation_playlist.h.

Referenced by getLocalWeight, getWeightSmoothness, serial, setupMixer, and setWeightSmoothness.

float NL3D::CAnimationPlaylist::_SpeedFactor[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 286 of file animation_playlist.h.

Referenced by emptyPlayList, getLocalTime, getSpeedFactor, serial, and setSpeedFactor.

float NL3D::CAnimationPlaylist::_StartWeight[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 289 of file animation_playlist.h.

Referenced by emptyPlayList, getLocalWeight, getStartWeight, serial, setStartWeight, and setupMixer.

TGlobalAnimationTime NL3D::CAnimationPlaylist::_StartWeightTime[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 292 of file animation_playlist.h.

Referenced by getLocalWeight, getStartWeight, serial, setStartWeight, and setupMixer.

TGlobalAnimationTime NL3D::CAnimationPlaylist::_TimeOrigin[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 283 of file animation_playlist.h.

Referenced by emptyPlayList, getLocalTime, getTimeOrigin, serial, and setTimeOrigin.

TWrapMode NL3D::CAnimationPlaylist::_WrapMode[CChannelMixer::NumAnimationSlot] [private]
 

Definition at line 304 of file animation_playlist.h.

Referenced by CAnimationPlaylist, getLocalTime, getWrapMode, serial, setupMixer, and setWrapMode.


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