28 #ifndef __ANIMABLE_H__
29 #define __ANIMABLE_H__
104 { memcpy(mBaseValueReal, val.
ptr(),
sizeof(
Real)*2); }
107 { memcpy(mBaseValueReal, val.
ptr(),
sizeof(
Real)*3); }
110 { memcpy(mBaseValueReal, val.
ptr(),
sizeof(
Real)*4); }
113 { memcpy(mBaseValueReal, val.
ptr(),
sizeof(
Real)*4); }
115 virtual void setAsBaseValue(
const Any& val);
119 mBaseValueReal[0] = val.
r;
120 mBaseValueReal[1] = val.
g;
121 mBaseValueReal[2] = val.
b;
122 mBaseValueReal[3] = val.
a;
144 virtual void setCurrentStateAsBaseValue(
void) = 0;
183 virtual void setValue(
const Any& val);
186 virtual void resetToBaseValue(
void);
225 virtual void applyDeltaValue(
const Any& val);
255 if (msAnimableDictionary.find(getAnimableDictionaryName())
256 == msAnimableDictionary.end())
259 initialiseAnimableDictionary(vec);
260 msAnimableDictionary[getAnimableDictionaryName()] = vec;
268 AnimableDictionaryMap::iterator i =
269 msAnimableDictionary.find(getAnimableDictionaryName());
270 if (i != msAnimableDictionary.end())
277 "Animable value list not found for " + getAnimableDictionaryName(),
278 "AnimableObject::getAnimableValueNames");
296 createAnimableDictionary();
298 AnimableDictionaryMap::iterator i =
299 msAnimableDictionary.find(getAnimableDictionaryName());
300 if (i != msAnimableDictionary.end())
307 "Animable value list not found for " + getAnimableDictionaryName(),
308 "AnimableObject::getAnimableValueNames");
322 "No animable value named '" + valueName +
"' present.",
323 "AnimableObject::createAnimableValue");
virtual void setValue(Real)
Set value.
Real * ptr()
Pointer accessor for direct copying.
virtual void setAsBaseValue(const Radian &val)
Internal method to set a value as base.
virtual void applyDeltaValue(const Vector4 &)
Apply delta value.
float Real
Software floating point type.
virtual void setAsBaseValue(int val)
Internal method to set a value as base.
Defines an object property which is animable, i.e.
Variant type that can hold Any other type.
virtual ~AnimableObject()
SharedPtr< AnimableValue > AnimableValuePtr
virtual void applyDeltaValue(const ColourValue &)
Apply delta value.
virtual void applyDeltaValue(const Vector3 &)
Apply delta value.
Class representing colour.
virtual void initialiseAnimableDictionary(StringVector &) const
Internal method for initialising dictionary; should be implemented by subclasses wanting to expose an...
Real valueRadians() const
virtual void setValue(const Quaternion &)
Set value.
virtual void setValue(const Degree &)
Set value.
virtual void setValue(const Vector2 &)
Set value.
virtual void setValue(const Vector3 &)
Set value.
Defines an interface to classes which have one or more AnimableValue instances to expose...
virtual void setValue(const Radian &)
Set value.
virtual AnimableValuePtr createAnimableValue(const String &valueName)
Create a reference-counted AnimableValuePtr for the named value.
const StringVector & getAnimableValueNames(void) const
Gets a list of animable value names for this object.
Real * ptr()
Pointer accessor for direct copying.
Implementation of a Quaternion, i.e.
ValueType mType
Value type.
Real * ptr()
Pointer accessor for direct copying.
map< String, StringVector >::type AnimableDictionaryMap
virtual void applyDeltaValue(const Degree &)
Apply delta value.
ValueType getType(void) const
Gets the value type of this animable value.
virtual void setAsBaseValue(const ColourValue &val)
Internal method to set a value as base.
virtual void applyDeltaValue(const Radian &)
Apply delta value.
virtual void applyDeltaValue(Real)
Set value.
virtual void setAsBaseValue(const Vector2 &val)
Internal method to set a value as base.
StringVector & _getAnimableValueNames(void)
Get an updateable reference to animable value list.
ValueType
The type of the value being animated.
#define OGRE_EXCEPT(num, desc, src)
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Standard 2-dimensional vector.
Wrapper class which indicates a given angle value is in Degrees.
vector< String >::type StringVector
virtual void applyDeltaValue(const Vector2 &)
Apply delta value.
virtual void setValue(const Vector4 &)
Set value.
Real valueRadians() const
virtual void setAsBaseValue(Real val)
Internal method to set a value as base.
virtual const String & getAnimableDictionaryName(void) const
Get the name of the animable dictionary for this class.
virtual void setAsBaseValue(const Vector3 &val)
Internal method to set a value as base.
Standard 3-dimensional vector.
std::map< K, V, P, A > type
virtual void setAsBaseValue(const Quaternion &val)
Internal method to set a value as base.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
AnimableValue(ValueType t)
static AnimableDictionaryMap msAnimableDictionary
Static map of class name to list of animable value names.
Wrapper class which indicates a given angle value is in Radians.
virtual void setValue(const ColourValue &)
Set value.
virtual void applyDeltaValue(const Quaternion &)
Apply delta value.
virtual void applyDeltaValue(int)
Apply delta value.
4-dimensional homogeneous vector.
void createAnimableDictionary(void) const
Internal method for creating a dictionary of animable value names for the class, if it does not alrea...
Real * ptr()
Pointer accessor for direct copying.
virtual void setAsBaseValue(const Vector4 &val)
Internal method to set a value as base.
virtual void setAsBaseValue(const Degree &val)
Internal method to set a value as base.
virtual void setValue(int)
Set value.