OGRE-Next 4.0.0unstable
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::TextureAnimationControllerValue Class Reference

Predefined controller value for getting / setting a texture coordinate modifications (scales and translates). More...

#include <OgreTextureAnimationController.h>

Inheritance diagram for Ogre::TextureAnimationControllerValue:

Public Member Functions

 TextureAnimationControllerValue (Ogre::HlmsDatablock *datablock, Ogre::uint8 textureUnit)
 Constructor.
Ogre::Real getValue () const override
void rotationAnimation (bool rotate)
 rotationAnimation.
void scaleAnimation (bool scaleU, bool scaleV)
 scaleAnimation.
void scrollAnimation (bool translateU, bool translateV)
 scrollAnimation.
void setValue (Ogre::Real value) override
void tiledAnimation (Ogre::uint16 numFramesHorizontal, Ogre::uint16 numFramesVertical)
 tiledAnimation.
Public Member Functions inherited from Ogre::ControllerValue< Ogre::Real >
virtual ~ControllerValue ()

Detailed Description

Predefined controller value for getting / setting a texture coordinate modifications (scales and translates).

Remarks
Effects can be applied to the scale or the offset of the u or v coordinates, or both. If separate modifications are required to u and v then 2 instances are required to control both independently, or 4 if you want separate u and v scales as well as separate u and v offsets.
Because of the nature of this value, it can accept values outside the 0..1 parametric range.
Example usage to scroll across U (make sure the sampler is set to wrap):
using namespace Ogre;
Ogre::HlmsDatablock *datablock = hlmsManager->getDatablock( "MyMat" );
HlmsUnlitDatablock *datablockUnlit = (HlmsUnlitDatablock *)datablock;
datablockUnlit->setEnableAnimationMatrix( true, texUnit ); // Make sure it's enabled.
// Setup
new TextureAnimationControllerValue( datablock, texUnit );
texAnim->scrollAnimation( true, false );
ControllerManager::getSingleton().getFrameTimeSource(),
ControllerValueRealPtr( texAnim ), func );
// Destruction
controllerMgr.destroyController( ctrl );
Instances of this class 'control' the value of another object in the system.
Definition OgreController.h:130
Class for managing Controller instances.
Definition OgreControllerManager.h:61
static ControllerManager & getSingleton()
Override standard Singleton retrieval.
Controller< Real > * createController(const ControllerValueRealPtr &src, const ControllerValueRealPtr &dest, const ControllerFunctionRealPtr &func)
Creates a new controller and registers it with the manager.
void destroyController(Controller< Real > *controller)
Removes & destroys the controller passed in as a pointer.
An hlms datablock contains individual information about a specific material.
Definition OgreHlmsDatablock.h:430
Contains information needed by PBS (Physically Based Shading) for OpenGL 3+ & D3D11+.
Definition OgreHlmsUnlitDatablock.h:59
void setEnableAnimationMatrix(uint8 textureUnit, bool bEnable)
Enables the animation of the given texture unit.
Predefined controller function which simply scales an input to an output value.
Definition OgrePredefinedControllers.h:232
Definition OgreSharedPtr.h:57
TextureAnimationControllerValue(Ogre::HlmsDatablock *datablock, Ogre::uint8 textureUnit)
Constructor.
void scrollAnimation(bool translateU, bool translateV)
scrollAnimation.
SharedPtr< ControllerValue< Real > > ControllerValueRealPtr
Definition OgreControllerManager.h:51
bswapNN may be defined as macros in <sys/endian.h> or <sys/bswap.h>
Definition OgreAndroidLogListener.h:35

Constructor & Destructor Documentation

◆ TextureAnimationControllerValue()

Ogre::TextureAnimationControllerValue::TextureAnimationControllerValue ( Ogre::HlmsDatablock * datablock,
Ogre::uint8 textureUnit )

Constructor.

Parameters
datablockHlmsDatablock to apply the modification to.
textureUnittextureUnit to apply the modification to.

Member Function Documentation

◆ getValue()

Ogre::Real Ogre::TextureAnimationControllerValue::getValue ( ) const
overridevirtual

◆ rotationAnimation()

void Ogre::TextureAnimationControllerValue::rotationAnimation ( bool rotate)

rotationAnimation.

Parameters
rotateIf true, the texture will be rotated by the modification.

◆ scaleAnimation()

void Ogre::TextureAnimationControllerValue::scaleAnimation ( bool scaleU,
bool scaleV )

scaleAnimation.

Parameters
scaleUIf true, the u coordinates will be scaled by the modification.
scaleVIf true, the v coordinates will be scaled by the modification.

◆ scrollAnimation()

void Ogre::TextureAnimationControllerValue::scrollAnimation ( bool translateU,
bool translateV )

scrollAnimation.

Parameters
textureUnittextureUnit to apply the modification to.
translateVIf true, the v coordinates will be translated by the modification.

◆ setValue()

void Ogre::TextureAnimationControllerValue::setValue ( Ogre::Real value)
overridevirtual

◆ tiledAnimation()

void Ogre::TextureAnimationControllerValue::tiledAnimation ( Ogre::uint16 numFramesHorizontal,
Ogre::uint16 numFramesVertical )

tiledAnimation.

Parameters
numFramesHorizontalnumber of horizontal tiles.
numFramesVerticalnumber of vertical tiles.

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