OgrePredefinedControllers.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __PredefinedControllers_H__
#define __PredefinedControllers_H__
#include "OgrePrerequisites.h"
#include "OgreCommon.h"
#include "OgreController.h"
#include "OgreFrameListener.h"
#include "OgreGpuProgram.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
//-----------------------------------------------------------------------
// Controller Values
//-----------------------------------------------------------------------
class _OgreExport FrameTimeControllerValue : public ControllerValue<Real>, public FrameListener
{
protected:
Real mFrameTime;
Real mTimeFactor;
Real mElapsedTime;
Real mFrameDelay;
public:
FrameTimeControllerValue();
bool frameEnded(const FrameEvent &evt);
bool frameStarted(const FrameEvent &evt);
Real getValue(void) const;
void setValue(Real value);
Real getTimeFactor(void) const;
void setTimeFactor(Real tf);
Real getFrameDelay(void) const;
void setFrameDelay(Real fd);
Real getElapsedTime(void) const;
void setElapsedTime(Real elapsedTime);
};
//-----------------------------------------------------------------------
class _OgreExport TextureFrameControllerValue : public ControllerValue<Real>
{
protected:
TextureUnitState* mTextureLayer;
public:
TextureFrameControllerValue(TextureUnitState* t);
Real getValue(void) const;
void setValue(Real value);
};
//-----------------------------------------------------------------------
class _OgreExport TexCoordModifierControllerValue : public ControllerValue<Real>
{
protected:
bool mTransU, mTransV;
bool mScaleU, mScaleV;
bool mRotate;
TextureUnitState* mTextureLayer;
public:
TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
bool scaleU = false, bool scaleV = false, bool rotate = false );
Real getValue(void) const;
void setValue(Real value);
};
//-----------------------------------------------------------------------
class _OgreExport FloatGpuParameterControllerValue : public ControllerValue<Real>
{
protected:
GpuProgramParametersSharedPtr mParams;
size_t mParamIndex;
public:
FloatGpuParameterControllerValue(GpuProgramParametersSharedPtr params,
size_t index );
~FloatGpuParameterControllerValue() {}
Real getValue(void) const;
void setValue(Real value);
};
//-----------------------------------------------------------------------
// Controller functions
//-----------------------------------------------------------------------
class _OgreExport PassthroughControllerFunction : public ControllerFunction<Real>
{
public:
PassthroughControllerFunction(bool deltaInput = false);
Real calculate(Real source);
};
class _OgreExport AnimationControllerFunction : public ControllerFunction<Real>
{
protected:
Real mSeqTime;
Real mTime;
public:
AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
Real calculate(Real source);
void setTime(Real timeVal);
void setSequenceTime(Real seqVal);
};
//-----------------------------------------------------------------------
class _OgreExport ScaleControllerFunction : public ControllerFunction<Real>
{
protected:
Real mScale;
public:
ScaleControllerFunction(Real scalefactor, bool deltaInput);
Real calculate(Real source);
};
//-----------------------------------------------------------------------
class _OgreExport WaveformControllerFunction : public ControllerFunction<Real>
{
protected:
WaveformType mWaveType;
Real mBase;
Real mFrequency;
Real mPhase;
Real mAmplitude;
Real mDutyCycle;
Real getAdjustedInput(Real input);
public:
WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true, Real dutyCycle = 0.5);
Real calculate(Real source);
};
//-----------------------------------------------------------------------
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::WaveformControllerFunction
Predefined controller function based on a waveform.
Definition: OgrePredefinedControllers.h:258
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::WaveformType
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:161
Ogre::WaveformControllerFunction::mAmplitude
Real mAmplitude
Definition: OgrePredefinedControllers.h:265
Ogre::AnimationControllerFunction
Predefined controller function for dealing with animation.
Definition: OgrePredefinedControllers.h:191
Ogre::ControllerFunction
Subclasses of this class are responsible for performing a function on an input value for a Controller...
Definition: OgreController.h:55
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::WaveformControllerFunction::mDutyCycle
Real mDutyCycle
Definition: OgrePredefinedControllers.h:266
Ogre::WaveformControllerFunction::mBase
Real mBase
Definition: OgrePredefinedControllers.h:262
Ogre::AnimationControllerFunction::mTime
Real mTime
Definition: OgrePredefinedControllers.h:195
Ogre::FrameTimeControllerValue::mElapsedTime
Real mElapsedTime
Definition: OgrePredefinedControllers.h:57
Ogre::WaveformControllerFunction::mFrequency
Real mFrequency
Definition: OgrePredefinedControllers.h:263
OgreFrameListener.h
Ogre::FloatGpuParameterControllerValue::mParamIndex
size_t mParamIndex
The index of the parameter to be read or set.
Definition: OgrePredefinedControllers.h:150
Ogre::TexCoordModifierControllerValue
Predefined controller value for getting / setting a texture coordinate modifications (scales and tran...
Definition: OgrePredefinedControllers.h:101
Ogre::ControllerValue
Can either be used as an input or output value.
Definition: OgreController.h:104
OgreController.h
Ogre::FrameTimeControllerValue::mTimeFactor
Real mTimeFactor
Definition: OgrePredefinedControllers.h:56
OgreCommon.h
Ogre::FloatGpuParameterControllerValue::~FloatGpuParameterControllerValue
~FloatGpuParameterControllerValue()
Definition: OgrePredefinedControllers.h:161
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Definition: OgreTextureUnitState.h:62
OgrePrerequisites.h
Ogre::TexCoordModifierControllerValue::mScaleV
bool mScaleV
Definition: OgrePredefinedControllers.h:105
Ogre::TexCoordModifierControllerValue::mTransV
bool mTransV
Definition: OgrePredefinedControllers.h:104
Ogre::AnimationControllerFunction::mSeqTime
Real mSeqTime
Definition: OgrePredefinedControllers.h:194
Ogre::FrameTimeControllerValue::mFrameTime
Real mFrameTime
Definition: OgrePredefinedControllers.h:55
Ogre::FrameEvent
Struct containing information about a frame event.
Definition: OgreFrameListener.h:44
Ogre::TexCoordModifierControllerValue::mRotate
bool mRotate
Definition: OgrePredefinedControllers.h:106
Ogre::TextureFrameControllerValue::mTextureLayer
TextureUnitState * mTextureLayer
Definition: OgrePredefinedControllers.h:80
Ogre::WaveformControllerFunction::mPhase
Real mPhase
Definition: OgrePredefinedControllers.h:264
OgreHeaderSuffix.h
Ogre::TexCoordModifierControllerValue::mTextureLayer
TextureUnitState * mTextureLayer
Definition: OgrePredefinedControllers.h:107
Ogre::PassthroughControllerFunction
Predefined controller function which just passes through the original source directly to dest...
Definition: OgrePredefinedControllers.h:174
Ogre::ScaleControllerFunction
Predefined controller function which simply scales an input to an output value.
Definition: OgrePredefinedControllers.h:218
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::FloatGpuParameterControllerValue::mParams
GpuProgramParametersSharedPtr mParams
The parameters to access.
Definition: OgrePredefinedControllers.h:148
Ogre::SharedPtr< GpuProgramParameters >
OgreHeaderPrefix.h
Ogre::ScaleControllerFunction::mScale
Real mScale
Definition: OgrePredefinedControllers.h:221
Ogre::TextureFrameControllerValue
Predefined controller value for getting / setting the frame number of a texture layer.
Definition: OgrePredefinedControllers.h:77
Ogre::WaveformControllerFunction::mWaveType
WaveformType mWaveType
Definition: OgrePredefinedControllers.h:261
Ogre::FrameTimeControllerValue::mFrameDelay
Real mFrameDelay
Definition: OgrePredefinedControllers.h:58
Ogre::FloatGpuParameterControllerValue
Predefined controller value for setting a single floating- point value in a constant parameter of a v...
Definition: OgrePredefinedControllers.h:144
Ogre::FrameTimeControllerValue
Predefined controller value for getting the latest frame time.
Definition: OgrePredefinedControllers.h:52
OgreGpuProgram.h
Ogre::FrameListener
A interface class defining a listener which can be used to receive notifications of frame events...
Definition: OgreFrameListener.h:79

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.