Sleeping Wombat Common Library  0.50.0
swCommonLibrary
Public Types | Public Member Functions | Private Attributes | List of all members
AnimEvaluator< KeyType, AddressType > Class Template Reference

Evaluates animation. More...

#include <AnimEvaluator.h>

Public Types

typedef IInterpolator< KeyType > Interpolator
 

Public Member Functions

 AnimEvaluator ()=default
 Constructor for serialization only.
 
 AnimEvaluator (Object *object, const std::string &propertyPath)
 
void Evaluate (Object *object, TimeType time)
 
bool AddKey (TimeType time, const KeyType &value)
 Adds key and sets default interpolator. More...
 
bool AddKey (TimeType time, const KeyType &value, InterpolatorType interpolatorType)
 Adds key and sets given interpolator. More...
 
bool UpdateKey (TimeType time, const KeyType &newValue, UPtr< Interpolator > &&interpolator)
 Udates key given by time. Sets new interpolator. More...
 
bool UpdateKey (TimeType time, const KeyType &newValue)
 Updates key. Leaves interpolator unchanged. More...
 
bool RemoveKey (TimeType time)
 Removes key in given time. More...
 
bool ChangeInterpolator (Size idx, UPtr< Interpolator > &&interpolator)
 Updates interpolator. Key remains unchanged. More...
 
const Key< KeyType > * GetKey (TimeType time)
 Return key in given time.
 
virtual KeySet< KeyType > & GetKeySet ()
 Returns KeySet.
 

Private Attributes

KeySet< KeyType > m_keySet
 
AddressType m_param
 

Detailed Description

template<typename KeyType, typename AddressType>
class AnimEvaluator< KeyType, AddressType >

Evaluates animation.

Uses m_keySet to interpolate animation value and sets it to m_param.

Template parameter AddressType is class which is used to set parameter value. You can provide your own classes or apply build in objects. This library implements parameters using rttr library.

See also
DirectProperty, PropertyPath, StringPropertyPath.

Member Function Documentation

template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::AddKey ( TimeType  time,
const KeyType &  value 
)
inline

Adds key and sets default interpolator.

Returns
False if key already exists.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::AddKey ( TimeType  time,
const KeyType &  value,
InterpolatorType  interpolatorType 
)
inline

Adds key and sets given interpolator.

Returns
False if key already exists.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::ChangeInterpolator ( Size  idx,
UPtr< Interpolator > &&  interpolator 
)
inline

Updates interpolator. Key remains unchanged.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::RemoveKey ( TimeType  time)
inline

Removes key in given time.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::UpdateKey ( TimeType  time,
const KeyType &  newValue,
UPtr< Interpolator > &&  interpolator 
)
inline

Udates key given by time. Sets new interpolator.

Returns
False if There's no key in given time.
template<typename KeyType , typename AddressType >
bool AnimEvaluator< KeyType, AddressType >::UpdateKey ( TimeType  time,
const KeyType &  newValue 
)
inline

Updates key. Leaves interpolator unchanged.

Returns
False if There's no key in given time.

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