当前位置: 首页>>代码示例>>C#>>正文


C# ParameterSet.GetVector4方法代码示例

本文整理汇总了C#中ParameterSet.GetVector4方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet.GetVector4方法的具体用法?C# ParameterSet.GetVector4怎么用?C# ParameterSet.GetVector4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParameterSet的用法示例。


在下文中一共展示了ParameterSet.GetVector4方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Sun

        public Sun(ParameterSet parm)
        {
            if (parm.HasParm("SunColor"))
                lightColor = parm.GetVector4("SunColor");
            if (parm.HasParm("AmbientLightColor"))
                ambientLightColor = parm.GetVector4("AmbientLightColor");
            Vector2 sunAngles = Vector2.Zero;
            if (parm.HasParm("SunAngles"))
                sunAngles = parm.GetVector2("SunAngles");

            if ( shadowMap == null )
                shadowMap = new RenderTarget2D(Renderer.Instance.GraphicsDevice, SHADOW_MAP_WIDTH_HEIGHT * NUM_CASCADES, SHADOW_MAP_WIDTH_HEIGHT, false, SurfaceFormat.Single, DepthFormat.Depth24);
            SetSunDirectionFromSphericalCoords(sunAngles.X, sunAngles.Y);
        }
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:14,代码来源:Sun.cs

示例2: PostLoadInit

        public override void PostLoadInit(ParameterSet Parm)
        {
            int index = 0;

            while (Parm.HasParm("Light" + index))
            {
                string keyString = "Light" + index;
                string lightType = Parm.GetString(keyString);

                switch (lightType)
                {
                    case "Directional":
                        {
                            // read directional light parameters and create light
                            Vector3 direction = Parm.GetVector3(keyString + "Direction");
                            Vector4 color = Parm.GetVector4(keyString + "Color");
                            float intensity = Parm.GetFloat(keyString + "Intensity");
                            directionalLights.Add(new DirectionalLight(direction, color, intensity));
                        }
                        break;
                    case "Spot":
                        {
                            Vector3 position = Parm.GetVector3(keyString + "Position");
                            Vector3 direction = Parm.GetVector3(keyString + "Direction");
                            Vector4 color = Parm.GetVector4(keyString + "Color");
                            float intensity = Parm.GetFloat(keyString + "Intensity");
                            spotLights.Add(new SpotLight(DeferredRenderer.Instance.GraphicsDevice, position, direction, color, intensity, true, 1024, spotCookie));
                        }
                        break;
                    case "Point":
                        {
                            Vector3 position = Parm.GetVector3(keyString + "Position");
                            float radius = Parm.GetFloat(keyString + "Radius");
                            Vector4 color = Parm.GetVector4(keyString + "Color");
                            float intensity = Parm.GetFloat(keyString + "Intensity");
                            pointLights.Add(new PointLight(DeferredRenderer.Instance.GraphicsDevice, position, radius, color, intensity, true, 256));
                        }
                        break;
                }
                index++;
            }
        }
开发者ID:scotttorgeson,项目名称:HeroesOfRock,代码行数:42,代码来源:LightManager.cs


注:本文中的ParameterSet.GetVector4方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。