OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::Controller< T > Class Template Reference

Instances of this class 'control' the value of another object in the system. More...

#include <OgreController.h>

+ Inheritance diagram for Ogre::Controller< T >:
+ Collaboration diagram for Ogre::Controller< T >:

Public Member Functions

 Controller (const SharedPtr< ControllerValue< T > > &src, const SharedPtr< ControllerValue< T > > &dest, const SharedPtr< ControllerFunction< T > > &func)
 Usual constructor. More...
 
virtual ~Controller ()
 Default d-tor. More...
 
const SharedPtr
< ControllerValue< T > > & 
getDestination (void) const
 Gets the output controller value. More...
 
bool getEnabled (void) const
 Returns true if this controller is currently enabled. More...
 
const SharedPtr
< ControllerFunction< T > > & 
getFunction (void) const
 Returns a pointer to the function object used by this controller. More...
 
const SharedPtr
< ControllerValue< T > > & 
getSource (void) const
 Gets the input controller value. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
void setDestination (const SharedPtr< ControllerValue< T > > &dest)
 Sets the output controller value. More...
 
void setEnabled (bool enabled)
 Sets whether this controller is enabled. More...
 
void setFunction (const SharedPtr< ControllerFunction< T > > &func)
 Sets the function object to be used by this controller. More...
 
void setSource (const SharedPtr< ControllerValue< T > > &src)
 Sets the input controller value. More...
 
void update (void)
 Tells this controller to map it's input controller value to it's output controller value, via the controller function. More...
 

Protected Attributes

SharedPtr< ControllerValue< T > > mDest
 Destination value. More...
 
bool mEnabled
 Controller is enabled or not. More...
 
SharedPtr< ControllerFunction
< T > > 
mFunc
 Function. More...
 
SharedPtr< ControllerValue< T > > mSource
 Source value. More...
 

Detailed Description

template<typename T>
class Ogre::Controller< T >

Instances of this class 'control' the value of another object in the system.

Remarks
Controller classes are used to manage the values of object automatically based on the value of some input. For example, a Controller could animate a texture by controlling the current frame of the texture based on time, or a different Controller could change the colour of a material used for a spaceship shield mesh based on the remaining shield power level of the ship.
The Controller is an intentionally abstract concept - it can generate values based on input and a function, which can either be one of the standard ones supplied, or a function can be 'plugged in' for custom behaviour - see the ControllerFunction class for details. Both the input and output values are via ControllerValue objects, meaning that any value can be both input and output of the controller.
Whilst this is very flexible, it can be a little bit confusing so to make it simpler the most often used controller setups are available by calling methods on the ControllerManager object.
See also
ControllerFunction

Definition at line 135 of file OgreController.h.

Constructor & Destructor Documentation

template<typename T>
Ogre::Controller< T >::Controller ( const SharedPtr< ControllerValue< T > > &  src,
const SharedPtr< ControllerValue< T > > &  dest,
const SharedPtr< ControllerFunction< T > > &  func 
)
inline

Usual constructor.

Remarks
Requires source and destination values, and a function object. None of these are destroyed with the Controller when it is deleted (they can be shared) so you must delete these as appropriate.

Definition at line 155 of file OgreController.h.

template<typename T>
virtual Ogre::Controller< T >::~Controller ( )
inlinevirtual

Default d-tor.

Definition at line 164 of file OgreController.h.

Member Function Documentation

template<typename T>
const SharedPtr< ControllerValue<T> >& Ogre::Controller< T >::getDestination ( void  ) const
inline

Gets the output controller value.

Definition at line 184 of file OgreController.h.

template<typename T>
bool Ogre::Controller< T >::getEnabled ( void  ) const
inline

Returns true if this controller is currently enabled.

Definition at line 190 of file OgreController.h.

template<typename T>
const SharedPtr< ControllerFunction<T> >& Ogre::Controller< T >::getFunction ( void  ) const
inline

Returns a pointer to the function object used by this controller.

Definition at line 210 of file OgreController.h.

template<typename T>
const SharedPtr< ControllerValue<T> >& Ogre::Controller< T >::getSource ( void  ) const
inline

Gets the input controller value.

Definition at line 173 of file OgreController.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<typename T>
void Ogre::Controller< T >::setDestination ( const SharedPtr< ControllerValue< T > > &  dest)
inline

Sets the output controller value.

Definition at line 178 of file OgreController.h.

template<typename T>
void Ogre::Controller< T >::setEnabled ( bool  enabled)
inline

Sets whether this controller is enabled.

Definition at line 196 of file OgreController.h.

template<typename T>
void Ogre::Controller< T >::setFunction ( const SharedPtr< ControllerFunction< T > > &  func)
inline

Sets the function object to be used by this controller.

Definition at line 203 of file OgreController.h.

template<typename T>
void Ogre::Controller< T >::setSource ( const SharedPtr< ControllerValue< T > > &  src)
inline

Sets the input controller value.

Definition at line 168 of file OgreController.h.

template<typename T>
void Ogre::Controller< T >::update ( void  )
inline

Tells this controller to map it's input controller value to it's output controller value, via the controller function.

Remarks
This method is called automatically every frame by ControllerManager.

Definition at line 220 of file OgreController.h.

Member Data Documentation

template<typename T>
SharedPtr< ControllerValue<T> > Ogre::Controller< T >::mDest
protected
template<typename T>
bool Ogre::Controller< T >::mEnabled
protected
template<typename T>
SharedPtr< ControllerFunction<T> > Ogre::Controller< T >::mFunc
protected
template<typename T>
SharedPtr< ControllerValue<T> > Ogre::Controller< T >::mSource
protected

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