Axiom.Core.SubEntity.UpdateCustomGpuParameter C# (CSharp) Method

UpdateCustomGpuParameter() public method

public UpdateCustomGpuParameter ( GpuProgramParameters entry, GpuProgramParameters gpuParams ) : void
entry Axiom.Graphics.GpuProgramParameters
gpuParams Axiom.Graphics.GpuProgramParameters
return void
		public void UpdateCustomGpuParameter( GpuProgramParameters.AutoConstantEntry entry, GpuProgramParameters gpuParams )
		{
			if ( entry.Type == GpuProgramParameters.AutoConstantType.AnimationParametric )
			{
				// Set up to 4 values, or up to limit of hardware animation entries
				// Pack into 4-element constants offset based on constant data index
				// If there are more than 4 entries, this will be called more than once
				Vector4 val = Vector4.Zero;

				int animIndex = entry.Data * 4;
				for ( int i = 0; i < 4 &&
					animIndex < hardwareVertexAnimVertexData.HWAnimationDataList.Count;
					++i, ++animIndex )
				{
					val[ i ] = hardwareVertexAnimVertexData.HWAnimationDataList[ animIndex ].Parametric;
				}
				// set the parametric morph value
				gpuParams.SetConstant( entry.PhysicalIndex, val );
			}
			else if ( customParams[ entry.Data ] != null )
			{
				gpuParams.SetConstant( entry.PhysicalIndex, (Vector4)customParams[ entry.Data ] );
			}
		}