//============================================================ // <T>加载浮点颜色。</T> //============================================================ public void LoadColor(SFloatColor4 color) { _color.Assign(color); // 获得透明度 int alpha = (int)(color.A * 100); if (alpha < 0) { alpha = 0; } else if (alpha > 100) { alpha = 100; } // 设置内容 qcpColorRgb.SelectColorText = color.ToHexString3(); tkbColorAlpha.Value = alpha; txtColorAlpha.Text = alpha.ToString(); }
//============================================================ // <T>接收材质内容。</T> // // @param material 材质信息 //============================================================ public void AssignInfo(FDrMaterialInfo material) { // 存储属性 _effectName = material.EffectName; _transformName = material.TransformName; // 存储设置 _optionLight = material.OptionLight; _optionMerge = material.OptionMerge; _optionDepth = material.OptionDepth; _optionCompare = material.OptionCompare; _optionAlpha = material.OptionAlpha; _optionDouble = material.OptionDouble; _optionOpacity = material.OptionOpacity; _optionShadow = material.OptionShadow; _optionShadowSelf = material.OptionShadowSelf; _optionTransmittance = material.OptionTransmittance; // 存储信息 _sortLevel = material.SortLevel; // 存储颜色 _colorMin = material.ColorMin; _colorMax = material.ColorMax; _colorRate = material.ColorRate; _colorMerge = material.ColorMerge; // 存储透明 _alphaBase = material.AlphaBase; _alphaRate = material.AlphaRate; _alphaLevel = material.AlphaLevel; _alphaMerge = material.AlphaMerge; // 存储属性 _ambientColor.Assign(material.AmbientColor); _ambientShadow = material.AmbientShadow; _diffuseColor.Assign(material.DiffuseColor); _diffuseShadow = material.DiffuseShadow; _diffuseViewColor.Assign(material.DiffuseViewColor); _diffuseViewShadow = material.DiffuseViewShadow; _specularColor.Assign(material.SpecularColor); _specularBase = material.SpecularBase; _specularRate = material.SpecularRate; _specularAverage = material.SpecularAverage; _specularShadow = material.SpecularShadow; _specularViewColor.Assign(material.SpecularViewColor); _specularViewBase = material.SpecularViewBase; _specularViewRate = material.SpecularViewRate; _specularViewAverage = material.SpecularViewAverage; _specularViewShadow = material.SpecularViewShadow; _reflectColor.Assign(material.ReflectColor); _reflectMerge = material.ReflectMerge; _reflectShadow = material.ReflectShadow; _refractFrontColor.Assign(material.RefractFrontColor); _refractFrontMerge = material.RefractFrontMerge; _refractFrontShadow = material.RefractFrontShadow; _refractBackColor.Assign(material.RefractBackColor); _refractBackMerge = material.RefractBackMerge; _refractBackShadow = material.RefractBackShadow; _opacityColorColor.Assign(material.OpacityColor); _opacityRate = material.OpacityRate; _opacityAlpha = material.OptionAlpha; _opacityDepth = material.OptionDepth; _opacityTransmittance = material.OptionTransmittance; _emissiveColor.Assign(material.EmissiveColor); }