OGRE  1.9.0
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 >:

Public Member Functions

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

Protected Attributes

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

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 136 of file OgreController.h.

Constructor & Destructor Documentation

◆ Controller()

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

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 156 of file OgreController.h.

References mDest, mEnabled, mFunc, and mSource.

◆ ~Controller()

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

Default d-tor.

Definition at line 165 of file OgreController.h.

Member Function Documentation

◆ getDestination()

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

Gets the output controller value.

Definition at line 185 of file OgreController.h.

References mDest.

◆ getEnabled()

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

Returns true if this controller is currently enabled.

Definition at line 191 of file OgreController.h.

References mEnabled.

◆ getFunction()

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

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

Definition at line 211 of file OgreController.h.

References mFunc.

◆ getSource()

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

Gets the input controller value.

Definition at line 174 of file OgreController.h.

References mSource.

◆ operator delete() [1/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr)
inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [2/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr)
inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [3/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [4/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [5/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
void *  )
inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [6/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
void *  )
inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [1/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr)
inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [2/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr)
inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [3/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [4/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

◆ operator new() [1/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz)
inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

◆ operator new() [2/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz)
inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

◆ operator new() [3/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
const char * file,
int line,
const char * func )
inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

◆ operator new() [4/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
const char * file,
int line,
const char * func )
inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

◆ operator new() [5/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
void * ptr )
inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

◆ operator new() [6/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
void * ptr )
inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [1/4]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new[] ( size_t sz)
inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [2/4]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new[] ( size_t sz)
inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [3/4]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new[] ( size_t sz,
const char * file,
int line,
const char * func )
inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [4/4]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new[] ( size_t sz,
const char * file,
int line,
const char * func )
inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

◆ setDestination()

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

Sets the output controller value.

Definition at line 179 of file OgreController.h.

References mDest.

◆ setEnabled()

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

Sets whether this controller is enabled.

Definition at line 197 of file OgreController.h.

References mEnabled.

◆ setFunction()

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

Sets the function object to be used by this controller.

Definition at line 204 of file OgreController.h.

References mFunc.

◆ setSource()

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

Sets the input controller value.

Definition at line 169 of file OgreController.h.

References mSource.

◆ update()

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

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 221 of file OgreController.h.

References mDest, mEnabled, mFunc, and mSource.

Member Data Documentation

◆ mDest

template<typename T>
SharedPtr< ControllerValue<T> > Ogre::Controller< T >::mDest
protected

Destination value.

Definition at line 142 of file OgreController.h.

Referenced by Controller(), getDestination(), setDestination(), and update().

◆ mEnabled

template<typename T>
bool Ogre::Controller< T >::mEnabled
protected

Controller is enabled or not.

Definition at line 146 of file OgreController.h.

Referenced by Controller(), getEnabled(), setEnabled(), and update().

◆ mFunc

template<typename T>
SharedPtr< ControllerFunction<T> > Ogre::Controller< T >::mFunc
protected

Function.

Definition at line 144 of file OgreController.h.

Referenced by Controller(), getFunction(), setFunction(), and update().

◆ mSource

template<typename T>
SharedPtr< ControllerValue<T> > Ogre::Controller< T >::mSource
protected

Source value.

Definition at line 140 of file OgreController.h.

Referenced by Controller(), getSource(), setSource(), and update().


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