NL3D::CAnimatedMorph Class Reference

#include <animated_morph.h>

Inheritance diagram for NL3D::CAnimatedMorph:

NL3D::IAnimatable

Detailed Description

An animated morph (blend shape)
Author:
Matthieu Besson

Nevrax France

Date:
2001

Definition at line 71 of file animated_morph.h.

Herited from IAnimatable

enum  TAnimValues { OwnerBit = IAnimatable::AnimValueLast, FactorValue, AnimValueLast }
 Added values. More...

virtual ITrackgetDefaultTrack (uint valueId)
 From IAnimatable.

virtual IAnimatedValuegetValue (uint valueId)
 From IAnimatable.

virtual const char * getValueName (uint valueId) const
 From IAnimatable.

virtual void registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix)
 From IAnimatable.


Public Types


Public Member Functions

float getFactor () const
const std::string & getName () const
void setFactor (float rFactor)
ctor / setup.
 CAnimatedMorph (CMorphBase *mb)

Protected Member Functions

sint addValue (CChannelMixer *chanMixer, uint valueId, uint ownerValueId, const std::string &prefix, bool detail)
void clearFlag (uint valueId)
 This method clear a bit in the bitset.

void setFlag (uint valueId)
 This method set a bit in the bitset.


Private Attributes

CTrackDefaultFloat _DefaultFactor
CAnimatedValueFloat _Factor
CMorphBase_MorphBase


Member Enumeration Documentation

enum NL3D::CAnimatedMorph::TAnimValues
 

Added values.

Enumeration values:
OwnerBit 
FactorValue 
AnimValueLast 

Reimplemented from NL3D::IAnimatable.

Definition at line 86 of file animated_morph.h.

00087         {
00088                 OwnerBit= IAnimatable::AnimValueLast,
00089                 FactorValue, 
00090                 AnimValueLast
00091         };


Constructor & Destructor Documentation

NL3D::CAnimatedMorph::CAnimatedMorph CMorphBase mb  ) 
 

Constructor.

Definition at line 59 of file animated_morph.cpp.

References _MorphBase, and NL3D::CAnimatedValueBlendable< float >::affect().

00060 {
00061         // IAnimatable.
00062         IAnimatable::resize (AnimValueLast);
00063 
00064         _MorphBase = mb;
00065         
00066         _Factor.affect (mb->DefaultFactor.getValue());
00067 }


Member Function Documentation

sint NL3D::IAnimatable::addValue CChannelMixer chanMixer,
uint  valueId,
uint  ownerValueId,
const std::string &  prefix,
bool  detail
[protected, inherited]
 

This is a tool function which add a given value to a channel.

Returns:
-1 if the track was not found in the animationSet, else it return the channelId as if returned by CAnimationSet::getChannelIdByName(channelName).

Definition at line 37 of file animatable.cpp.

References NL3D::CChannelMixer::addChannel(), NL3D::IAnimatable::getDefaultTrack(), NL3D::IAnimatable::getValue(), NL3D::IAnimatable::getValueName(), nlassert, sint, and uint.

Referenced by NL3D::CTransform::registerToChannelMixer(), NL3D::CParticleSystemModel::registerToChannelMixer(), NL3D::CCamera::registerToChannelMixer(), NL3D::CBone::registerToChannelMixer(), registerToChannelMixer(), NL3D::CAnimatedMaterial::registerToChannelMixer(), and NL3D::CAnimatedLightmap::registerToChannelMixer().

00038 {
00039         nlassert(chanMixer);
00040         return chanMixer->addChannel(prefix+getValueName(valueId), this, getValue(valueId), getDefaultTrack(valueId), valueId, ownerValueId, detail);
00041 }

void NL3D::IAnimatable::clearFlag uint  valueId  )  [inline, protected, inherited]
 

This method clear a bit in the bitset.

Definition at line 233 of file animatable.h.

References NL3D::IAnimatable::_BitSet, and uint.

Referenced by NL3D::ITransformable::clearTransformFlags(), NL3D::CParticleSystemModel::doAnimate(), and NL3D::CAnimatedMaterial::update().

00234         {
00235                 _BitSet&= ~(1<<valueId);
00236         }

ITrack * NL3D::CAnimatedMorph::getDefaultTrack uint  valueId  )  [virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Definition at line 90 of file animated_morph.cpp.

References uint.

00091 {
00092         //nlassert(_morphBase);
00093 
00094         switch(valueId)
00095         {
00096                 case FactorValue: return &_DefaultFactor;
00097         };
00098 
00099         return NULL;
00100 }

float NL3D::CAnimatedMorph::getFactor  )  const [inline]
 

Definition at line 107 of file animated_morph.h.

References NL3D::CAnimatedValueBlendable< float >::Value.

00107 { return _Factor.Value; }

const std::string& NL3D::CAnimatedMorph::getName  )  const [inline]
 

Definition at line 110 of file animated_morph.h.

References _MorphBase, and NL3D::CMorphBase::Name.

00110 { return _MorphBase->Name; }

IAnimatedValue * NL3D::CAnimatedMorph::getValue uint  valueId  )  [virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Definition at line 70 of file animated_morph.cpp.

References uint.

00071 {
00072         switch(valueId)
00073         {
00074                 case FactorValue: return &_Factor;
00075         };
00076 
00077         return NULL;
00078 }

const char * NL3D::CAnimatedMorph::getValueName uint  valueId  )  const [virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Definition at line 80 of file animated_morph.cpp.

References uint.

00081 {
00082         switch(valueId)
00083         {
00084                 case FactorValue: return "MorphFactor";
00085         };
00086 
00087         return "";
00088 }

uint32 NL3D::IAnimatable::isTouched uint  valueId  )  const [inline, inherited]
 

Return non 0 int if the value as been touched else 0.

Parameters:
valueId is the animated value ID in the object we want to test the touch flag. or it may be an OwnerBit.

Definition at line 184 of file animatable.h.

References NL3D::IAnimatable::_BitSet, uint, and uint32.

Referenced by NL3D::CParticleSystemModel::doAnimate(), NL3D::ITransformable::needCompute(), NL3D::IAnimatable::propagateTouch(), and NL3D::CAnimatedMaterial::update().

00185         {
00186                 return _BitSet&(1<<valueId);
00187         }

void NL3D::CAnimatedMorph::registerToChannelMixer CChannelMixer chanMixer,
const std::string &  prefix
[virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Definition at line 102 of file animated_morph.cpp.

References NL3D::IAnimatable::addValue().

00103 {
00104         // For CAnimatedMorph, channels are detailled (morph evaluated after clip)!
00105         addValue(chanMixer, FactorValue, OwnerBit, prefix, true);
00106 
00107 }

void NL3D::IAnimatable::resize uint  count  )  [inline, inherited]
 

Change value count, bit are set to 0

Parameters:
count is the new value count.

Definition at line 195 of file animatable.h.

References count, nlassert, and uint.

00196         {
00197                 // with the "uint32 _BitSet" implementation, juste check the size is correct
00198                 nlassert(count<=32);
00199         }

void NL3D::CAnimatedMorph::setFactor float  rFactor  )  [inline]
 

Definition at line 108 of file animated_morph.h.

References NL3D::CAnimatedValueBlendable< float >::Value.

00108 { _Factor.Value = rFactor; }

void NL3D::IAnimatable::setFather IAnimatable father,
uint  fatherOwnerBit
[inline, inherited]
 

Say which (if any) IAnimatable owns this one. This is important for Touch propagation. By this system, Fathers and ancestors know if they must check their sons (isTouched() return true).

Parameters:
father the father we must inform of our update.
fatherOwnerBit What bit of father we must set when we are updated

Definition at line 153 of file animatable.h.

References NL3D::IAnimatable::_Father, NL3D::IAnimatable::_FatherOwnerBit, NL3D::IAnimatable::propagateTouch(), and uint.

Referenced by NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CSegRemanence::setAnimatedMaterial().

00154         {
00155                 _Father= father; _FatherOwnerBit= fatherOwnerBit;
00156 
00157                 // propagate the touch to the fathers.
00158                 propagateTouch();
00159         }

void NL3D::IAnimatable::setFlag uint  valueId  )  [inline, protected, inherited]
 

This method set a bit in the bitset.

Definition at line 239 of file animatable.h.

References NL3D::IAnimatable::_BitSet, and uint.

Referenced by NL3D::IAnimatable::propagateTouch(), and NL3D::IAnimatable::touch().

00240         {
00241                 _BitSet|= (1<<valueId);
00242         }

void NL3D::IAnimatable::touch uint  valueId,
uint  ownerValueId
[inline, inherited]
 

Touch a value because it has been modified.

Parameters:
valueId is the animated value ID in the object we want to touch.
ownerValueId is the bit of the IAnimatable part which owns this animated value.

Definition at line 168 of file animatable.h.

References NL3D::IAnimatable::propagateTouch(), NL3D::IAnimatable::setFlag(), and uint.

Referenced by NL3D::CChannelMixer::eval(), NL3D::CChannelMixer::evalSingleChannel(), NL3D::CParticleSystemModel::reallocRsc(), NL3D::CChannelMixer::refreshList(), NL3D::CCamera::setFov(), NL3D::ITransformable::setPivot(), NL3D::ITransformable::setPos(), NL3D::CCamera::setRoll(), NL3D::ITransformable::setRotEuler(), NL3D::ITransformable::setRotQuat(), NL3D::ITransformable::setScale(), NL3D::CCamera::setTargetPos(), NL3D::ITransformable::setTransformMode(), and NL3D::CParticleSystemInstanceUser::setUserParam().

00169         {
00170                 // Set the bit
00171                 setFlag(valueId);
00172                 // Set the owner bit
00173                 setFlag(ownerValueId);
00174 
00175                 // propagate the touch to the fathers.
00176                 propagateTouch();
00177         }


Field Documentation

CTrackDefaultFloat NL3D::CAnimatedMorph::_DefaultFactor [private]
 

Definition at line 117 of file animated_morph.h.

CAnimatedValueFloat NL3D::CAnimatedMorph::_Factor [private]
 

Definition at line 116 of file animated_morph.h.

CMorphBase* NL3D::CAnimatedMorph::_MorphBase [private]
 

Definition at line 114 of file animated_morph.h.

Referenced by CAnimatedMorph(), and getName().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 06:44:23 2004 for NeL by doxygen 1.3.6