NL3D::CAnimatedValueBlendable< T > Class Template Reference

#include <animated_value.h>

Inheritance diagram for NL3D::CAnimatedValueBlendable< T >:

NL3D::IAnimatedValue

Detailed Description

template<class T>
class NL3D::CAnimatedValueBlendable< T >

A template implementation of IAnimatedValue.

Author:
Cyril 'Hulud' Corvazier

Nevrax France

Date:
2001

Definition at line 77 of file animated_value.h.

Public Member Functions

virtual void affect (const IAnimatedValue &value)
virtual void blend (const IAnimatedValue &value, float blendFactor)
 A default blend method. Doesn't work for all type.


Data Fields

Value


Member Function Documentation

template<class T>
virtual void NL3D::CAnimatedValueBlendable< T >::affect const IAnimatedValue value  )  [inline, virtual]
 

An assignation method. This method assign a values in the object.

Parameters:
value is the new value.

Implements NL3D::IAnimatedValue.

Definition at line 101 of file animated_value.h.

Referenced by NL3D::CAnimatedLightmap::CAnimatedLightmap(), and NL3D::CAnimatedMaterial::CAnimatedMaterial().

00102         {
00103                 // Check types of value. typeid is slow, assert only in debug
00104 #ifdef NL_DEBUG
00105                 nlassert (typeid (value)==typeid(*this));
00106 #endif
00107 
00108                 // Cast
00109                 CAnimatedValueBlendable<T>      *pValue=(CAnimatedValueBlendable<T>*)&value;
00110 
00111                 // Blend
00112                 Value=pValue->Value;
00113         }

template<class T>
virtual void NL3D::CAnimatedValueBlendable< T >::blend const IAnimatedValue value,
float  blendFactor
[inline, virtual]
 

A default blend method. Doesn't work for all type.

Implements NL3D::IAnimatedValue.

Definition at line 82 of file animated_value.h.

00083         {
00084                 // Check types of value. typeid is slow, assert only in debug
00085 #ifdef NL_DEBUG
00086                 nlassert (typeid (value)==typeid(*this));
00087 #endif
00088 
00089                 // Cast
00090                 CAnimatedValueBlendable<T>      *pValue=(CAnimatedValueBlendable<T>*)&value;
00091 
00092                 // Blend
00093                 Value=(T) (Value*blendFactor+pValue->Value*(1.f-blendFactor));
00094         }


Field Documentation

template<class T>
T NL3D::CAnimatedValueBlendable< T >::Value
 

Definition at line 116 of file animated_value.h.

Referenced by NL3D::CAnimatedValueBlendable< NLMISC::CRGBA >::affect(), NL3D::CAnimatedValueBlendable< NLMISC::CQuat >::affect(), NL3D::CAnimatedValueBlendable< CVector >::affect(), NL3D::CAnimatedValueBlendable< NLMISC::CRGBA >::blend(), NL3D::CAnimatedValueBlendable< NLMISC::CQuat >::blend(), NL3D::CAnimatedValueBlendable< CVector >::blend(), NL3D::CCamera::CCamera(), NL3D::CTrackSampledVector::eval(), NL3D::CTrackSampledQuat::eval(), NL3D::CChannelMixer::evalSingleChannel(), NL3D::CAnimatedLightmap::getFactor(), NL3D::ITransformable::getPivot(), NL3D::ITransformable::getPos(), NL3D::ITransformable::getRotEuler(), NL3D::ITransformable::getRotQuat(), NL3D::ITransformable::getScale(), NL3D::CCamera::getTargetPos(), NL3D::ITransformable::ITransformable(), NL3D::ITransformable::setPivot(), NL3D::ITransformable::setPos(), NL3D::ITransformable::setRotEuler(), NL3D::ITransformable::setRotQuat(), NL3D::ITransformable::setScale(), NL3D::CCamera::setTargetPos(), NL3D::CCamera::update(), NL3D::CAnimatedMaterial::update(), NL3D::CAnimatedLightmap::updateGroupColors(), and NL3D::ITransformable::updateMatrix().


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