Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueMatrixArray C# (CSharp) Метод

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

public GetValueMatrixArray ( int count ) : System.Matrix[]
count int
Результат System.Matrix[]
		public Matrix[] GetValueMatrixArray (int count)
		{
            if (ParameterClass != EffectParameterClass.Matrix || ParameterType != EffectParameterType.Single)
                throw new InvalidCastException();

            var ret = new Matrix[count];
            for (var i = 0; i < count; i++)
                ret[i] = Elements[i].GetValueMatrix();

		    return ret;
		}

Usage Example

Пример #1
0
        /// <summary>
        /// Gets a copy of the current skinning bone transform matrices.
        /// </summary>
        public Matrix4x4[] GetBoneTransforms(int count)
        {
            if (count <= 0 || count > MaxBones)
            {
                throw new ArgumentOutOfRangeException("count");
            }

            Matrix4x4[] bones = bonesParam.GetValueMatrixArray(count);

            // Convert matrices from 43 to 44 format.
            for (int i = 0; i < bones.Length; i++)
            {
                bones[i].M44 = 1;
            }

            return(bones);
        }