Axiom.Graphics.Material.GetTechnique C# (CSharp) Метод

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

Gets the technique at the specified index.
public GetTechnique ( int index ) : Technique
index int Index of the technique to return.
Результат Technique
		public Technique GetTechnique( int index )
		{
			Debug.Assert( index < this.techniques.Count, "index < techniques.Count" );

			return this.techniques[ index ];
		}

Usage Example

Пример #1
0
        /// <summary>
        /// Helper function to set the texture coordinates.  Instead of taking a movie
        /// object, this takes a specific texture name, video size, texture size, and
        /// material.  Sets a texture matrix to adjust the existing coordinates.
        /// </summary>
        /// <param name="textureName">
        /// The name of the texture to adjust.
        /// </param>
        /// <param name="videoSize">
        /// The size of the video in pixels.
        /// </param>
        /// <param name="textureSize">
        /// The size of the expected texture in pixels.
        /// </param>
        /// <param name="material">
        /// The name of the material to search for textures.
        /// </param>
        /// <returns>
        /// True if any texture coordinates were adjusted, false if not.
        /// </returns>
        public static bool SetTextureCoordinates(string textureName, Size videoSize, Size textureSize, string material)
        {
            bool ans = false;

            Axiom.Graphics.Material m = MaterialManager.Instance.GetByName(material);
            if (m != null)
            {
                for (int i = 0; i < m.NumTechniques; i++)
                {
                    for (int j = 0; j < m.GetTechnique(i).NumPasses; j++)
                    {
                        Pass p = m.GetTechnique(i).GetPass(j);
                        for (int k = 0; k < p.NumTextureUnitStages; k++)
                        {
                            if (p.GetTextureUnitState(k).TextureName == textureName)
                            {
                                TextureUnitState tu     = p.GetTextureUnitState(k);
                                float            uRatio = ((float)videoSize.Width) / ((float)textureSize.Width);
                                float            vRatio = ((float)videoSize.Height) / ((float)textureSize.Height);
                                tu.SetTextureScale(1.0f / uRatio, 1.0f / vRatio);
                                tu.SetTextureScroll(-0.5f * (1.0f - uRatio), -0.5f * (1.0f - vRatio));
                                ans = true;
                            }
                        }
                    }
                }
            }
            return(ans);
        }
All Usage Examples Of Axiom.Graphics.Material::GetTechnique