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


C# Light.SetAttenuation方法代码示例

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


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

示例1: processLightAttenuation

        protected void processLightAttenuation(XmlElement XMLNode, Light pLight)
        {
            // Process attributes
            float range = getAttribReal(XMLNode, "range");
            float constant = getAttribReal(XMLNode, "constant");
            float linear = getAttribReal(XMLNode, "linear");
            float quadratic = getAttribReal(XMLNode, "quadratic");

            // Setup the light attenuation
            pLight.SetAttenuation(range, constant, linear, quadratic);

            #if VERBOSE
            Launch.Log("[DotSceneLoader] Successfully processed light attenuation");
            #endif
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:15,代码来源:DotSceneLoader.cs

示例2: processLightAttenuation

        protected void processLightAttenuation(XmlElement XMLNode, Light pLight)
        {
            // Process attributes
            float range = getAttribReal(XMLNode, "range");
            float constant = getAttribReal(XMLNode, "constant");
            float linear = getAttribReal(XMLNode, "linear");
            float quadratic = getAttribReal(XMLNode, "quadratic");

            // Setup the light attenuation
            pLight.SetAttenuation(range, constant, linear, quadratic);
        }
开发者ID:MSylvia,项目名称:mspriterenderer,代码行数:11,代码来源:DotSceneLoader.cs

示例3: SetupLighting

        private void SetupLighting()
        {
            scene.AmbientLight = new ColorEx(0.2f, 0.2f, 0.2f);
            Light = scene.CreateLight("Light2");
            Light.DiffuseColour = MinLightColour;
            Light.SetAttenuation(8000, 1, 0.0005f, 0);
            Light.SpecularColour = new ColorEx(1, 1, 1);

            LightNode = scene.RootSceneNode.CreateChildSceneNode("MovingLightNode");
            LightNode.AttachObject(Light);
            //create billboard set

            BillboardSet bbs = scene.CreateBillboardSet("lightbbs", 1);
            bbs.SetMaterialName("Examples/Flare");
            Billboard bb = bbs.CreateBillboard(new Vector3(0, 0, 0), MinLightColour);
            LightNode.AttachObject(bbs);

            mLightController = new LightGrassWibbler(Light, bb, MinLightColour, this.MaxLightColour, MinFlareSize, MaxFlareSize);

            // create controller, after this is will get updated on its own
            //WaveformControllerFunction func = new WaveformControllerFunction(WaveformType.Sine, 0.0f, 0.5f);

            //ControllerManager.Instance.CreateController(val, func);

            LightNode.Position = new Vector3(300, 250, -300);

            Animation anim = scene.CreateAnimation("LightTrack", 20);
            //Spline it for nce curves
            anim.SetInterpolationMode(Animation.InterpolationMode.IM_SPLINE);// = Mogre.Animation.InterpolationMode.IM_SPLINE;
            //create a srtack to animte the camera's node
            NodeAnimationTrack track = anim.CreateNodeTrack(0, LightNode);
            //setup keyframes
            TransformKeyFrame key = track.CreateNodeKeyFrame(0);
            key.Translate = new Vector3(300, 550, -300);
            key = track.CreateNodeKeyFrame(2); //B
            key.Translate = new Vector3(150, 600, -250);
            key = track.CreateNodeKeyFrame(4); //C
            key.Translate = new Vector3(-150, 650, -100);
            key = track.CreateNodeKeyFrame(6); //D
            key.Translate = new Vector3(-400, 500, -200);
            key = track.CreateNodeKeyFrame(8); //E
            key.Translate = new Vector3(-200, 500, -400);
            key = track.CreateNodeKeyFrame(10); //F
            key.Translate = new Vector3(-100, 450, -200);
            key = track.CreateNodeKeyFrame(12); //G
            key.Translate = new Vector3(-100, 400, 180);
            key = track.CreateNodeKeyFrame(14); //H
            key.Translate = new Vector3(0, 250, 600);
            key = track.CreateNodeKeyFrame(16); //I
            key.Translate = new Vector3(100, 650, 100);
            key = track.CreateNodeKeyFrame(18); //J
            key.Translate = new Vector3(250, 600, 0);
            key = track.CreateNodeKeyFrame(20); //K == A
            key.Translate = new Vector3(300, 550, -300);
            // Create a new animation state to track this

            AnimState = scene.CreateAnimationState("LightTrack");
            AnimState.Enabled = true;
        }
开发者ID:andyhebear,项目名称:mogrelibrarys,代码行数:59,代码来源:Grass.cs


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