28 #ifndef __Controller_H__ 29 #define __Controller_H__ 70 while (mDeltaCount >= 1.0)
72 while (mDeltaCount < 0.0)
91 mDeltaInput = deltaInput;
103 template <
typename T>
109 virtual T getValue(
void)
const = 0;
110 virtual void setValue(T value) = 0;
134 template <
typename T>
157 : mSource(src), mDest(dest), mFunc(func)
223 mDest->setValue(mFunc->calculate(mSource->getValue()));
virtual ~Controller()
Default d-tor.
SharedPtr< ControllerFunction< T > > mFunc
Function.
Subclasses of this class are responsible for performing a function on an input value for a Controller...
bool mEnabled
Controller is enabled or not.
Can either be used as an input or output value.
void setSource(const SharedPtr< ControllerValue< T > > &src)
Sets the input controller value.
Instances of this class 'control' the value of another object in the system.
void update(void)
Tells this controller to map it's input controller value to it's output controller value...
bool getEnabled(void) const
Returns true if this controller is currently enabled.
const SharedPtr< ControllerFunction< T > > & getFunction(void) const
Returns a pointer to the function object used by this controller.
bool mDeltaInput
If true, function will add input values together and wrap at 1.0 before evaluating.
SharedPtr< ControllerValue< T > > mDest
Destination value.
void setDestination(const SharedPtr< ControllerValue< T > > &dest)
Sets the output controller value.
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
T getAdjustedInput(T input)
Gets the input value as adjusted by any delta.
Reference-counted shared pointer, used for objects where implicit destruction is required.
const SharedPtr< ControllerValue< T > > & getDestination(void) const
Gets the output controller value.
virtual T calculate(T sourceValue)=0
Controller(const SharedPtr< ControllerValue< T > > &src, const SharedPtr< ControllerValue< T > > &dest, const SharedPtr< ControllerFunction< T > > &func)
Usual constructor.
void setFunction(const SharedPtr< ControllerFunction< T > > &func)
Sets the function object to be used by this controller.
virtual ~ControllerValue()
void setEnabled(bool enabled)
Sets whether this controller is enabled.
const SharedPtr< ControllerValue< T > > & getSource(void) const
Gets the input controller value.
ControllerFunction(bool deltaInput)
Constructor.
virtual ~ControllerFunction()
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
SharedPtr< ControllerValue< T > > mSource
Source value.