Loading...
Searching...
No Matches
Ogre::ControllerManager Class Reference
Core » Animation

Class for managing Controller instances. More...

`#include <OgreControllerManager.h>`

Inheritance diagram for Ogre::ControllerManager:
[legend]

## Public Member Functions

| ControllerManager ()
| ~ControllerManager ()
void | clearControllers (void)
| Destroys all the controllers in existence.
ControllerFloat * | createController (const ControllerValueRealPtr &src, const ControllerValueRealPtr &dest, const ControllerFunctionRealPtr &func)
| Creates a new controller and registers it with the manager.
ControllerFloat * | createFrameTimePassthroughController (const ControllerValueRealPtr &dest)
| Creates a new controller use frame time source and passthrough controller function.
ControllerFloat * | createGpuProgramTimerParam (GpuProgramParametersPtr params, size_t paramIndex, Real timeFactor=1.0f)
| Creates a controller for passing a frame time value through to a vertex / fragment program parameter.
ControllerFloat * | createTextureAnimator (TextureUnitState *layer, Real sequenceTime)
| Creates a texture layer animator controller.
ControllerFloat * | createTextureRotater (TextureUnitState *layer, Real speed)
| Creates a basic time-based texture coordinate modifier designed for creating rotating textures.
ControllerFloat * | createTextureUScroller (TextureUnitState *layer, Real uSpeed)
| Creates a basic time-based texture u coordinate modifier designed for creating scrolling textures.
ControllerFloat * | createTextureUVScroller (TextureUnitState *layer, Real speed)
| Creates a basic time-based texture uv coordinate modifier designed for creating scrolling textures.
ControllerFloat * | createTextureVScroller (TextureUnitState *layer, Real vSpeed)
| Creates a basic time-based texture v coordinate modifier designed for creating scrolling textures.
ControllerFloat * | createTextureWaveTransformer (TextureUnitState *layer, TextureUnitState::TextureTransformType ttype, WaveformType waveType, Real base=0, Real frequency=1, Real phase=0, Real amplitude=1)
| Creates a very flexible time-based texture transformation which can alter the scale, position or rotation of a texture based on a wave function.
void | destroyController (ControllerFloat *controller)
| Removes & destroys the controller passed in as a pointer.
Real | getElapsedTime (void) const
| Return the elapsed time.
Real | getFrameDelay (void) const
| Gets the constant that is added to time lapsed between each frame.
const ControllerValueRealPtr & | getFrameTimeSource (void) const
| Returns a ControllerValue which provides the time since the last frame as a control value source.
const ControllerFunctionRealPtr & | getPassthroughControllerFunction (void) const
| Retrieve a simple passthrough controller function.
Real | getTimeFactor (void) const
| Return relative speed of time as perceived by time based controllers.
void | setElapsedTime (Real elapsedTime)
| Set the elapsed time.
void | setFrameDelay (Real fd)
| Sets a constant frame rate.
void | setTimeFactor (Real tf)
| Set the relative speed to update frame time based controllers.
void | updateAllControllers (void)
| Updates all the registered controllers.
Public Member Functions inherited from Ogre::Singleton< ControllerManager >
| ~Singleton (void)

## Static Public Member Functions

static ControllerManager & | getSingleton (void)
| Get the singleton instance.
static ControllerManager * | getSingletonPtr (void)
| Get the singleton instance.
Static Public Member Functions inherited from Ogre::Singleton< ControllerManager >
static ControllerManager & | getSingleton (void)
| Get the singleton instance.
static ControllerManager * | getSingletonPtr (void)
| Get the singleton instance.

## Detailed Description

Class for managing Controller instances.

This class is responsible to keeping tabs on all the Controller instances registered and updating them when requested. It also provides a number of convenience methods for creating commonly used controllers (such as texture animators).

## Constructor & Destructor Documentation

## ControllerManager()

Ogre::ControllerManager::ControllerManager | ( |  | ) |

Referenced by getSingleton(), and getSingletonPtr().

## ~ControllerManager()

Ogre::ControllerManager::~ControllerManager | ( |  | ) |

## Member Function Documentation

## createController()

ControllerFloat * Ogre::ControllerManager::createController | ( | const ControllerValueRealPtr & | src,
|  | const ControllerValueRealPtr & | dest,
|  | const ControllerFunctionRealPtr & | func )

Creates a new controller and registers it with the manager.

## createFrameTimePassthroughController()

ControllerFloat * Ogre::ControllerManager::createFrameTimePassthroughController | ( | const ControllerValueRealPtr & | dest | ) |

Creates a new controller use frame time source and passthrough controller function.

## clearControllers()

void Ogre::ControllerManager::clearControllers | ( | void |  | ) |

Destroys all the controllers in existence.

## updateAllControllers()

void Ogre::ControllerManager::updateAllControllers | ( | void |  | ) |

Updates all the registered controllers.

## getFrameTimeSource()

const ControllerValueRealPtr & Ogre::ControllerManager::getFrameTimeSource | ( | void |  | ) | const

Returns a ControllerValue which provides the time since the last frame as a control value source.

A common source value to use to feed into a controller is the time since the last frame. This method returns a pointer to a common source value which provides this information.

  Remember the value will only be up to date after the RenderSystem::beginFrame method is called.

See also
  RenderSystem::beginFrame

## getPassthroughControllerFunction()

const ControllerFunctionRealPtr & Ogre::ControllerManager::getPassthroughControllerFunction | ( | void |  | ) | const

Retrieve a simple passthrough controller function.

## createTextureAnimator()

ControllerFloat * Ogre::ControllerManager::createTextureAnimator | ( | TextureUnitState * | layer,
|  | Real | sequenceTime )

Creates a texture layer animator controller.

This helper method creates the Controller, ControllerValue and ControllerFunction classes required to animate a texture.

Parameters

  layer | TextureUnitState object to animate
  sequenceTime | The amount of time in seconds it will take to loop through all the frames.

## createTextureUVScroller()

ControllerFloat * Ogre::ControllerManager::createTextureUVScroller | ( | TextureUnitState * | layer,
|  | Real | speed )

Creates a basic time-based texture uv coordinate modifier designed for creating scrolling textures.

This simple method allows you to easily create constant-speed uv scrolling textures. If you want to specify different speed values for horizontal and vertical scroll, use the specific methods ControllerManager::createTextureUScroller and ControllerManager::createTextureVScroller. If you want more control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based scrollers / stretchers / rotators.

Parameters

  layer | The texture layer to animate.
  speed | Speed of horizontal (u-coord) and vertical (v-coord) scroll, in complete wraps per second.

## createTextureUScroller()

ControllerFloat * Ogre::ControllerManager::createTextureUScroller | ( | TextureUnitState * | layer,
|  | Real | uSpeed )

Creates a basic time-based texture u coordinate modifier designed for creating scrolling textures.

This simple method allows you to easily create constant-speed u scrolling textures. If you want more control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based scrollers / stretchers / rotators.

Parameters

  layer | The texture layer to animate.
  uSpeed | Speed of horizontal (u-coord) scroll, in complete wraps per second.

## createTextureVScroller()

ControllerFloat * Ogre::ControllerManager::createTextureVScroller | ( | TextureUnitState * | layer,
|  | Real | vSpeed )

Creates a basic time-based texture v coordinate modifier designed for creating scrolling textures.

This simple method allows you to easily create constant-speed v scrolling textures. If you want more control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based scrollers / stretchers / rotators.

Parameters

  layer | The texture layer to animate.
  vSpeed | Speed of vertical (v-coord) scroll, in complete wraps per second.

## createTextureRotater()

ControllerFloat * Ogre::ControllerManager::createTextureRotater | ( | TextureUnitState * | layer,
|  | Real | speed )

Creates a basic time-based texture coordinate modifier designed for creating rotating textures.

This simple method allows you to easily create constant-speed rotating textures. If you want more control, look up the ControllerManager::createTextureWaveTransformer for more complex wave-based scrollers / stretchers / rotators.

Parameters

  layer | The texture layer to rotate.
  speed | Speed of rotation, in complete anticlockwise revolutions per second.

## createTextureWaveTransformer()

ControllerFloat * Ogre::ControllerManager::createTextureWaveTransformer | ( | TextureUnitState * | layer,
|  | TextureUnitState::TextureTransformType | ttype,
|  | WaveformType | waveType,
|  | Real | base = 0,
|  | Real | frequency = 1,
|  | Real | phase = 0,
|  | Real | amplitude = 1 )

Creates a very flexible time-based texture transformation which can alter the scale, position or rotation of a texture based on a wave function.

Parameters

  layer | The texture layer to affect.
  ttype | The type of transform, either translate (scroll), scale (stretch) or rotate (spin).
  waveType | The shape of the wave, see WaveformType enum for details.
  base | The base value of the output.
  frequency | The speed of the wave in cycles per second.
  phase | The offset of the start of the wave, e.g. 0.5 to start half-way through the wave.
  amplitude | Scales the output so that instead of lying within 0..1 it lies within 0..1*amplitude for exaggerated effects.

## createGpuProgramTimerParam()

ControllerFloat * Ogre::ControllerManager::createGpuProgramTimerParam | ( | GpuProgramParametersPtr | params,
|  | size_t | paramIndex,
|  | Real | timeFactor = 1.0f )

Creates a controller for passing a frame time value through to a vertex / fragment program parameter.

The destination parameter is expected to be a float, and the '.x' attribute will be populated with the appropriately scaled time value.

Parameters

  params | The parameters to update.
  paramIndex | The index of the parameter to update; if you want a named parameter, then retrieve the index beforehand using GpuProgramParameters::getParamIndex.
  timeFactor | The factor by which to adjust the time elapsed by before passing it to the program.

## destroyController()

void Ogre::ControllerManager::destroyController | ( | ControllerFloat * | controller | ) |

Removes & destroys the controller passed in as a pointer.

## getTimeFactor()

Real Ogre::ControllerManager::getTimeFactor | ( | void |  | ) | const

Return relative speed of time as perceived by time based controllers.

See setTimeFactor for full information on the meaning of this value.

## setTimeFactor()

void Ogre::ControllerManager::setTimeFactor | ( | Real | tf | ) |

Set the relative speed to update frame time based controllers.

Normally any controllers which use time as an input (FrameTimeController) are updated automatically in line with the real passage of time. This method allows you to change that, so that controllers are told that the time is passing slower or faster than it actually is. Use this to globally speed up / slow down the effect of time-based controllers.

Parameters

  tf | The virtual speed of time (1.0 is real time).

## getFrameDelay()

Real Ogre::ControllerManager::getFrameDelay | ( | void |  | ) | const

Gets the constant that is added to time lapsed between each frame.

See setFrameDelay for full information on the meaning of this value.

## setFrameDelay()

void Ogre::ControllerManager::setFrameDelay | ( | Real | fd | ) |

Sets a constant frame rate.

This function is useful when rendering a sequence to files that should create a film clip with constant frame rate. It will ensure that scrolling textures and animations move at a constant frame rate.

Parameters

  fd | The delay in seconds wanted between each frame (1.0f / 25.0f means a seconds worth of animation is done in 25 frames).

## getElapsedTime()

Real Ogre::ControllerManager::getElapsedTime | ( | void |  | ) | const

Return the elapsed time.

See setElapsedTime for full information on the meaning of this value.

## setElapsedTime()

void Ogre::ControllerManager::setElapsedTime | ( | Real | elapsedTime | ) |

Set the elapsed time.

Normally elapsed time accumulated all frames time (which speed relative to time factor) since the rendering loop started. This method allows your to change that to special time, so some elapsed-time-based globally effect is repeatable.

Parameters

  elapsedTime | The new elapsed time.

## getSingleton()

ControllerManager & Ogre::ControllerManager::getSingleton | ( | void |  | ) |

static

Get the singleton instance.

References ControllerManager().

## getSingletonPtr()

ControllerManager * Ogre::ControllerManager::getSingletonPtr | ( | void |  | ) |

static

Get the singleton instance.

References ControllerManager().

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

- OgreControllerManager.h