Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Controller Class Reference

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

#include <OgreController.h>

List of all members.

Public Methods

 Controller (ControllerValue *src, ControllerValue *dest, ControllerFunction *func)
 Usual constructor. More...

virtual ~Controller ()
 Default d-tor. More...

void setSource (ControllerValue *src)
ControllerValue * getSource (void)
void setDestination (ControllerValue *dest)
ControllerValue * getDestination (void)
bool getEnabled (void) const
 Returns true if this controller is currently enabled. More...

void setEnabled (bool enabled)
 Sets whether this controller is enabled. More...

void setFunction (ControllerFunction *func)
 Sets the function object to be used by this controller. More...

ControllerFunction * getFunction (void)
 Returns a pointer to the function object used by this controller. More...

void update (void)

Protected Attributes

ControllerValue * mSource
 Source value. More...

ControllerValue * mDest
 Destination value. More...

ControllerFunction * mFunc
 Function. More...

bool mEnabled
 Controller is enabled or not. More...


Detailed Description

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


Constructor & Destructor Documentation

Ogre::Controller::Controller (  ControllerValue *    src,
ControllerValue *    dest,
ControllerFunction *    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.
Todo:
Maybe for this and any other class that does not delete member data we should implement either a self-delete feature that could be enabled as wished, or make a self-deleting subclass.

Ogre::Controller::~Controller (    )  [virtual]
 

Default d-tor.


Member Function Documentation

ControllerValue * Ogre::Controller::getDestination (  void    ) 
 

bool Ogre::Controller::getEnabled (  void    )  const
 

Returns true if this controller is currently enabled.

ControllerFunction * Ogre::Controller::getFunction (  void    ) 
 

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

ControllerValue * Ogre::Controller::getSource (  void    ) 
 

void Ogre::Controller::setDestination (  ControllerValue *    dest ) 
 

void Ogre::Controller::setEnabled (  bool    enabled ) 
 

Sets whether this controller is enabled.

void Ogre::Controller::setFunction (  ControllerFunction *    func ) 
 

Sets the function object to be used by this controller.

void Ogre::Controller::setSource (  ControllerValue *    src ) 
 

void Ogre::Controller::update (  void    ) 
 


Member Data Documentation

ControllerValue* Ogre::Controller::mDest [protected]
 

Destination value.

bool Ogre::Controller::mEnabled [protected]
 

Controller is enabled or not.

ControllerFunction* Ogre::Controller::mFunc [protected]
 

Function.

ControllerValue* Ogre::Controller::mSource [protected]
 

Source value.

Copyright © 2002 by The OGRE Team