public Controller<float> CreateTextureWaveTransformer( TextureUnitState layer, TextureTransform type, WaveformType waveType,
float baseVal, float frequency, float phase, float amplitude )
{
IControllerValue<float> val = null;
IControllerFunction<float> function = null;
// determine which type of controller value this layer needs
switch ( type )
{
case TextureTransform.TranslateU:
val = new TexCoordModifierControllerValue( layer, true, false );
break;
case TextureTransform.TranslateV:
val = new TexCoordModifierControllerValue( layer, false, true );
break;
case TextureTransform.ScaleU:
val = new TexCoordModifierControllerValue( layer, false, false, true, false, false );
break;
case TextureTransform.ScaleV:
val = new TexCoordModifierControllerValue( layer, false, false, false, true, false );
break;
case TextureTransform.Rotate:
val = new TexCoordModifierControllerValue( layer, false, false, false, false, true );
break;
} // switch
// create a new waveform controller function
function = new WaveformControllerFunction( waveType, baseVal, frequency, phase, amplitude, true );
// finally, create the controller using frame time as the source value
return CreateController( frameTimeController, val, function );
}