Axiom.Graphics.Material.InsertSupportedTechnique C# (CSharp) Méthode

InsertSupportedTechnique() private méthode

private InsertSupportedTechnique ( Technique technique ) : void
technique Technique
Résultat void
		private void InsertSupportedTechnique( Technique technique )
		{
			this.SupportedTechniques.Add( technique );
			// get scheme
			ushort schemeIndex = technique.SchemeIndex;
			Dictionary<int, Technique> lodTechniques;
			if ( !this.bestTechniquesByScheme.ContainsKey( schemeIndex ) )
			{
				lodTechniques = new Dictionary<int, Technique>();
				this.bestTechniquesByScheme.Add( schemeIndex, lodTechniques );
			}
			else
			{
				lodTechniques = this.bestTechniquesByScheme[ schemeIndex ];
			}

			// Insert won't replace if supported technique for this scheme/lod is
			// already there, which is what we want
			if ( !lodTechniques.ContainsKey( technique.LodIndex ) )
			{
				lodTechniques.Add( technique.LodIndex, technique );
			}
		}

Usage Example

        /// <summary>
        ///		Copies the details of this material into another, preserving the target's handle and name
        ///		(unlike operator=) but copying everything else.
        /// </summary>
        /// <param name="target">Material which will receive this material's settings.</param>
        public void CopyTo(Material target, bool copyUniqueInfo)
        {
            if (copyUniqueInfo)
            {
                target.name     = name;
                target.handle   = handle;
                target.isLoaded = isLoaded;
                target.isManual = isManual;
            }
            // copy basic data
            target.size                     = size;
            target.lastAccessed             = lastAccessed;
            target.receiveShadows           = receiveShadows;
            target.transparencyCastsShadows = transparencyCastsShadows;

            target.RemoveAllTechniques();

            // clone a copy of all the techniques
            for (int i = 0; i < techniques.Count; i++)
            {
                Technique technique    = (Technique)techniques[i];
                Technique newTechnique = target.CreateTechnique();
                technique.CopyTo(newTechnique);

                // only add this technique to supported techniques if its...well....supported :-)
                if (newTechnique.IsSupported)
                {
                    target.InsertSupportedTechnique(newTechnique);
                }
            }

            // clear LOD distances
            target.lodDistances.Clear();

            // copy LOD distances
            for (int i = 0; i < lodDistances.Count; i++)
            {
                target.lodDistances.Add(lodDistances[i]);
            }

            target.compilationRequired = compilationRequired;
        }
All Usage Examples Of Axiom.Graphics.Material::InsertSupportedTechnique