|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CChannelMixer Class ReferenceA channel mixer.
More...
#include <channel_mixer.h>
Inheritance diagram for NL3D::CChannelMixer:
List of all members.
Public Types |
enum | { NumAnimationSlot = 8
} |
Public Methods |
| CChannelMixer () |
| Constructor. The default constructor resets the slots and the channels. More...
|
void | setAnimationSet (const CAnimationSet *animationSet) |
| Set the animation set used by this channel mixer. More...
|
const CAnimationSet * | getAnimationSet () const |
| Get the animation set used by this channel mixer. More...
|
void | eval (bool detail, uint64 evalDetailDate=0) |
| Launch evaluation of channels. More...
|
sint | addChannel (const std::string &channelName, IAnimatable *animatable, IAnimatedValue *value, ITrack *defaultValue, uint32 valueId, uint32 ownerValueId, bool detail) |
| Add a channel for a specific value of an IAnimatable object. More...
|
void | resetChannels () |
| Reset the channel list if the mixer. All channels are removed from the mixer. More...
|
void | enableChannel (uint channelId, bool enable) |
| disabling a channel means it is no more modified during animation. More...
|
bool | isChannelEnabled (uint channelId) const |
| see enableChannel(). More...
|
void | lodEnableChannel (uint channelId, bool enable) |
| Same as enableChannel but for Animation Lod system. More...
|
bool | isChannelLodEnabled (uint channelId) const |
| see enableChannel(). More...
|
void | setSlotAnimation (uint slot, uint animation) |
| Set slot animation. More...
|
const CAnimation * | getSlotAnimation (uint slot) const |
| Get the animation used by a given slot. More...
|
void | setSlotTime (uint slot, TAnimationTime time) |
| Set time of a slot. More...
|
void | setSlotWeight (uint slot, float weight) |
| Set slot weight. More...
|
void | emptySlot (uint slot) |
| Empty a slot. More...
|
void | resetSlots () |
| Reset the slot of the mixer. More...
|
void | applySkeletonWeight (uint slot, uint skeleton, bool invert=false) |
| Apply a skeleton template weight on a specific slot. More...
|
void | resetSkeletonWeight (uint slot) |
| Reset the skeleton weight for a specific slot. More...
|
void | resetEvalDetailDate () |
| reset to -1 the evalDetailDate. Hence next eval(true,..) will be forced to compute. More...
|
Private Methods |
void | cleanAll () |
| Clean the mixer. More...
|
void | dirtAll () |
| Dirt all slots. More...
|
void | refreshList () |
| Reshresh channel list. More...
|
void | refreshListToEval () |
| Reshresh animate list. More...
|
Private Attributes |
CSlot | _SlotArray [NumAnimationSlot] |
const CAnimationSet * | _AnimationSet |
std::map< uint, CChannel > | _Channels |
CChannel * | _FirstChannelGlobal |
CChannel * | _FirstChannelDetail |
sint64 | _LastEvalDetailDate |
bool | _Dirt |
bool | _ListToEvalDirt |
std::vector< CChannel * > | _GlobalListToEval |
std::vector< CChannel * > | _DetailListToEval |
Detailed Description
A channel mixer.
Animated value are registred in it. Each animated value create a channel in the mixer. Then, mixer animates all those channels with 1 to CChannelMixer::NumAnimationSlot animations.
Animation are referenced in an animation slot (CSlot).
Each slot have an IAnimation pointer, a weight for this animation between [0.f ~ 1.f] and a time for this animation.
Each CChannel have a weight on each animation slot between [0.f ~ 1.f].
Blending is normalized internaly so, weight sum have not to be == 1.f.
-
Author:
-
Cyril 'Hulud' Corvazier , Nevrax France
-
Date:
-
2001
Definition at line 64 of file channel_mixer.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
NL3D::CChannelMixer::CChannelMixer |
( |
|
) |
|
|
Member Function Documentation
|
Add a channel for a specific value of an IAnimatable object.
Warning: this method will assign the default value in the animated value. -
Parameters:
-
channelName |
is the name of the channel. |
animatable |
is a pointer on the IAnimatable object in which the value is stored. It will be kept by the CChannelMixer until it is removed from the channel. |
value |
is a pointer on the value the channel works with. It will be kept by the CChannelMixer until it is removed from the channel. |
defaultValue |
is a track used by default if a track is not presents in the animation for this channel. It will be kept by the CChannelMixer until it is removed from the channel. |
valueId |
is the value ID in the IAnimatable object. |
ownerId |
is the owner Bit of the animated vlaue, in the IAnimatable object. touched when the animatedvalue is touched. |
detail |
true if this channel must be evaluated in detail mode (see eval()). |
-
Returns:
-
-1 if the track was not found in the animationSet, else it return the channelId as if returned by CAnimationSet::getChannelIdByName(channelName).
|
void NL3D::CChannelMixer::applySkeletonWeight |
( |
uint |
slot, |
|
|
uint |
skeleton, |
|
|
bool |
invert = false |
|
) |
|
|
void NL3D::CChannelMixer::cleanAll |
( |
|
) |
[private] |
|
void NL3D::CChannelMixer::dirtAll |
( |
|
) |
[private] |
|
void NL3D::CChannelMixer::emptySlot |
( |
uint |
slot |
) |
|
|
void NL3D::CChannelMixer::enableChannel |
( |
uint |
channelId, |
|
|
bool |
enable |
|
) |
|
|
void NL3D::CChannelMixer::eval |
( |
bool |
detail, |
|
|
uint64 |
evalDetailDate = 0 |
|
) |
|
|
|
Launch evaluation of channels.
This is the main method. It evals animations selected in the slots for listed channels.
Only the channels that are animated by animations selected in the slots are evaluated. They are stored in a linked list managed by the channel array.
Others are initialized with the default channel value. -
Parameters:
-
detail |
true if eval the detail part of animation. (done after clipping). |
evalDetailDate |
chann mixer store the last date of anim detail evaluated. if same, do nothing, else if < or >, compute the anim. ingored if detail is false. |
Definition at line 81 of file channel_mixer.cpp.
References _DetailListToEval, _GlobalListToEval, _LastEvalDetailDate, _ListToEvalDirt, _SlotArray, NL3D::CChannelMixer::CSlot::_Weight, NLMISC::blend, cleanAll, nlassert, NumAnimationSlot, refreshList, refreshListToEval, and s. |
const CAnimationSet * NL3D::CChannelMixer::getAnimationSet |
( |
|
) |
const |
|
|
Get the animation set used by this channel mixer.
The pointer is hold by the channel mixer until it changes. Return NULL if no animationSet defined.
Definition at line 73 of file channel_mixer.cpp.
References _AnimationSet. |
const CAnimation * NL3D::CChannelMixer::getSlotAnimation |
( |
uint |
slot |
) |
const |
|
bool NL3D::CChannelMixer::isChannelEnabled |
( |
uint |
channelId |
) |
const |
|
bool NL3D::CChannelMixer::isChannelLodEnabled |
( |
uint |
channelId |
) |
const |
|
void NL3D::CChannelMixer::lodEnableChannel |
( |
uint |
channelId, |
|
|
bool |
enable |
|
) |
|
|
void NL3D::CChannelMixer::refreshList |
( |
|
) |
[private] |
|
void NL3D::CChannelMixer::refreshListToEval |
( |
|
) |
[private] |
|
void NL3D::CChannelMixer::resetChannels |
( |
|
) |
|
|
void NL3D::CChannelMixer::resetEvalDetailDate |
( |
|
) |
|
|
void NL3D::CChannelMixer::resetSkeletonWeight |
( |
uint |
slot |
) |
|
|
void NL3D::CChannelMixer::resetSlots |
( |
|
) |
|
|
|
Reset the slot of the mixer.
All slot will be empty.
Calling this method will dirt the mixer, ie, all the mixer's channels will be visited to check if they are used by the old animation. If they are, they will be linked in the internal CChannel list.
Definition at line 409 of file channel_mixer.cpp.
References emptySlot, NumAnimationSlot, and s. |
void NL3D::CChannelMixer::setAnimationSet |
( |
const CAnimationSet * |
animationSet |
) |
|
|
void NL3D::CChannelMixer::setSlotAnimation |
( |
uint |
slot, |
|
|
uint |
animation |
|
) |
|
|
|
Set slot animation.
You must set an animationSet in the channel mixer before calling this.
Calling this method will dirt the mixer, ie, all the mixer's channels will be visited to check if they are used by the new animation. If they are, they will be linked in the internal CChannel list. -
Parameters:
-
slot |
is the slot number to change the animation. Must be >= 0 and < NumAnimationSlot. |
animation |
is the new animation index in the animationSet use by this slot. |
-
See also:
-
CAnimationSet, CAnimation
Definition at line 352 of file channel_mixer.cpp.
References NL3D::CChannelMixer::CSlot::_Animation, _AnimationSet, _Dirt, NL3D::CChannelMixer::CSlot::_Dirt, _SlotArray, nlassert, and NumAnimationSlot. |
void NL3D::CChannelMixer::setSlotWeight |
( |
uint |
slot, |
|
|
float |
weight |
|
) |
[inline] |
|
|
Set slot weight.
This weight will be used to eval the animation set in this slot. Each slot can have different weight. Calling this method won't dirt the mixer.
By default the weight of the slot is 1.0f. -
Parameters:
-
slot |
is the slot number to change the weight. |
weight |
is the new weight to use in the slot. No range for this weight. If the weight == 0.f, the slot have no effect on the final mix. |
Definition at line 352 of file channel_mixer.h.
References _SlotArray, NL3D::CChannelMixer::CSlot::_Weight, nlassert, and NumAnimationSlot. |
Member Data Documentation
const CAnimationSet* NL3D::CChannelMixer::_AnimationSet [private]
|
|
std::map<uint, CChannel> NL3D::CChannelMixer::_Channels [private]
|
|
std::vector<CChannel*> NL3D::CChannelMixer::_DetailListToEval [private]
|
|
bool NL3D::CChannelMixer::_Dirt [private]
|
|
CChannel* NL3D::CChannelMixer::_FirstChannelDetail [private]
|
|
CChannel* NL3D::CChannelMixer::_FirstChannelGlobal [private]
|
|
std::vector<CChannel*> NL3D::CChannelMixer::_GlobalListToEval [private]
|
|
sint64 NL3D::CChannelMixer::_LastEvalDetailDate [private]
|
|
bool NL3D::CChannelMixer::_ListToEvalDirt [private]
|
|
CSlot NL3D::CChannelMixer::_SlotArray[NumAnimationSlot] [private]
|
|
|
Definition at line 422 of file channel_mixer.h.
Referenced by applySkeletonWeight, cleanAll, dirtAll, emptySlot, eval, getSlotAnimation, refreshList, resetSkeletonWeight, setSlotAnimation, setSlotTime, and setSlotWeight. |
The documentation for this class was generated from the following files:
|
|