Axiom.Controllers.ControllerManager.CreateTextureWaveTransformer C# (CSharp) Метод

CreateTextureWaveTransformer() публичный Метод

Creates a very flexible time-based texture transformation which can alter the scale, position or rotation of a texture based on a wave function.
public CreateTextureWaveTransformer ( TextureUnitState layer, TextureTransform type, WaveformType waveType, float baseVal, float frequency, float phase, float amplitude ) : Controller
layer Axiom.Graphics.TextureUnitState The texture unit to effect.
type TextureTransform The type of transform, either translate (scroll), scale (stretch) or rotate (spin).
waveType WaveformType The shape of the wave, see WaveformType enum for details.
baseVal float The base value of the output.
frequency float The speed of the wave in cycles per second.
phase float The offset of the start of the wave, e.g. 0.5 to start half-way through the wave.
amplitude float Scales the output so that instead of lying within 0..1 it lies within 0..(1 * amplitude) for exaggerated effects
Результат Controller
		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 );
		}