• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# LightType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LightType的典型用法代码示例。如果您正苦于以下问题:C# LightType类的具体用法?C# LightType怎么用?C# LightType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LightType类属于命名空间,在下文中一共展示了LightType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LightClass

        /// <summary>
        /// Constructor or added a new light to the scene
        /// </summary>
        /// <param name="type">the light type you wish to have or default of point</param>
        public LightClass(LightType type = LightType.Point)
        {
            if (type == LightType.Point)
            {
                light.Type = type;
                light.Diffuse = Color.White;
                light.Ambient = Color.White;
                light.Specular = Color.White;
                light.Position = Vector3.Zero;
                light.Range = 100.0f;

            }
            else if (type == LightType.Directional)
            {
                light.Type = type;
                light.Direction = Vector3.Zero;
                light.Ambient = Color.White;
                light.Diffuse = Color.White;
                light.Specular = Color.White;
                light.Range = 100.0f;
            }

            isLightEnabled = false;
            Type = type.ToString();
            Position = Vector3.Zero;
            Direction = Vector3.Zero;
            world = Matrix.Identity;
            mesh = Mesh.CreateSphere(DeviceManager.LocalDevice, .1f, 10, 10);

            material.Diffuse = Color.White;
            material.Ambient = Color.White;

            DeviceManager.LocalDevice.Material = material;
        }
开发者ID:senbeiwabaka,项目名称:Computer-Graphics-Project,代码行数:38,代码来源:LightClass.cs


示例2: Light

 // Default Constructor
 public Light()
     : base()
 {
     red = green = blue = 255.0f;
     intensity = radius = 0.0f;
     type = LightType.Point;
 }
开发者ID:SmegheadSev,项目名称:mbw-blank-leveleditor,代码行数:8,代码来源:Light.cs


示例3: Light

 public Light(Color _color, float _intensity, LightType _type, Point _position)
 {
     color = _color;
     intensity = _intensity;
     type = _type;
     position = _position;
 }
开发者ID:AaronCC,项目名称:Dread-Dungeon,代码行数:7,代码来源:Light.cs


示例4: Light

        public Light(LightType type, Vector3D p1, Vector3D p2, Vector3D p3, Color3D color)
        {
            Type = type;
            Color = color;

            _grid = new Vector3D[16];
            _grid[0] = new Vector3D(1, 2, 0);
            _grid[1] = new Vector3D(3, 3, 0);
            _grid[2] = new Vector3D(2, 0, 0);
            _grid[3] = new Vector3D(0, 1, 0);
            _grid[4] = new Vector3D(2, 3, 0);
            _grid[5] = new Vector3D(0, 3, 0);
            _grid[6] = new Vector3D(0, 0, 0);
            _grid[7] = new Vector3D(2, 2, 0);
            _grid[8] = new Vector3D(3, 1, 0);
            _grid[9] = new Vector3D(1, 3, 0);
            _grid[10] = new Vector3D(1, 0, 0);
            _grid[11] = new Vector3D(3, 2, 0);
            _grid[12] = new Vector3D(2, 1, 0);
            _grid[13] = new Vector3D(3, 0, 0);
            _grid[14] = new Vector3D(1, 1, 0);
            _grid[15] = new Vector3D(0, 2, 0);

            CellX = (p2 - p1) * .25f;
            CellY = (p3 - p1) * .25f;

            for (int i = 0; i < 16; i++)
                _grid[i] = _grid[i][0] * CellX + _grid[i][1] * CellY + p1;

            Position = p1 + 2 * CellX + 2 * CellY;
        }
开发者ID:pirho,项目名称:RaySharp,代码行数:31,代码来源:Light.cs


示例5: Light

 /// <summary>
 /// Initializes a new instance of the <see cref="Light"/> class.
 /// </summary>
 public Light()
 {
     _CastShadows = true;
     _Enabled = true;
     _Range = 20;
     _Type = LightType.Point;
 }
开发者ID:atulloh,项目名称:IMML,代码行数:10,代码来源:Light.cs


示例6: InitLight

	/// <summary>
	/// Initializes a light, setting the light position. The
	/// diffuse color is set to white; specular and ambient are left as black.
	/// </summary>
	/// <param name="light">Which light to initialize</param>
	/// <param name="ltType">The type</param>
	public static void InitLight(Light light, LightType ltType, float x, float y, float z)
	{
		light.Type = ltType;
		light.Diffuse = System.Drawing.Color.White;
		light.Position = new Vector3(x, y, z);
		light.Direction = Vector3.Normalize(light.Position);
		light.Range = 1000.0f;
	}
开发者ID:kasertim,项目名称:sentience,代码行数:14,代码来源:D3DUtil.cs


示例7: Light

 public Light(LightType type, Color color, Vector3 pos, Vector3 dir, float att)
 {
     Type = type;
     Color = color;
     Position = pos;
     Direction = dir;
     Attenuation = att;
 }
开发者ID:szyszart,项目名称:Junkyard,代码行数:8,代码来源:Light.cs


示例8: LightClass

 public LightClass(LightType Type, Vector3 Position, Color Ambiant, Color Diffuse, Color Specular, float Range)
 {
     this.Type = Type;
     this.Position = Position;
     this.Ambiant = Ambiant;
     this.Diffuse = Diffuse;
     this.Specular = Specular;
     this.Range = Range;
 }
开发者ID:Arys02,项目名称:Underground,代码行数:9,代码来源:LightClass.cs


示例9: create

    public static Light create(float x, float y, float size, float intensity, float r, float g, float b, float a, LightType type = LightType.VERTEX)
    {
        Light l = new Light();
        l.set_colour(r, g, b, a);
        l.attrib_size = size;
        l.set_pos(x, y);
        l.set_attribs(size, intensity);
        l.set_type(type);

        return l;
    }
开发者ID:fordream,项目名称:Anglers-Prey,代码行数:11,代码来源:Light.cs


示例10: CreateApproachLight

		public static void CreateApproachLight( int x, int y, int z, int off, int on, LightType light )
		{
			if ( FindMorphItem( x, y, z, off, on ) )
				return;

			MorphItem item = new MorphItem( off, on, 2, 3 );
			item.Light = light;

			item.MoveToWorld( new Point3D( x, y, z ), Map.Felucca );
			m_Count++;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:11,代码来源:KhaldunGen.cs


示例11: Light

 public Light(LightType lightType, Vector3 color, Vector3 position, bool castsShadows)
     : base()
 {
     this.type = lightType;
     this.Color = color;
     this.Transformation.SetPosition(position);
     this.castsShadows = castsShadows;
     if (castsShadows)
     {
         CreateCascadeShadows(1024);
     }
 }
开发者ID:nhippenmeyer,项目名称:CS248,代码行数:12,代码来源:Light.cs


示例12: LightSceneNode_GetLight

		static extern void LightSceneNode_GetLight(IntPtr light, [MarshalAs(UnmanagedType.LPArray)] float[] ambient, 
                                        [MarshalAs(UnmanagedType.LPArray)] float[] diffuse, 
                                        [MarshalAs(UnmanagedType.LPArray)] float[] specular, 
                                        [MarshalAs(UnmanagedType.LPArray)] float[] pos, 
                                        [MarshalAs(UnmanagedType.LPArray)] float[] dir,
		                                [MarshalAs(UnmanagedType.LPArray)] float[] att, 
                                        ref float falloff, 
                                        ref float innercone,
                                        ref float outercone,
                                        ref float radius, 
                                        ref bool castshadows, 
                                        ref LightType type);		
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:12,代码来源:LightSceneNode.cs


示例13: GetLight

        public int GetLight(LightType type, int x, int y, int z)
        {
            if (!IsValid(x, y, z))
                return 0;

            int chunkX = x >> 4;
            int chunkY = z >> 4;
            if (!IsChunkLoaded(chunkX, chunkY))
                return 0;

            var chunk = GetChunk(chunkX, chunkY);
            return chunk.GetLight(type, x & 0xF, y, z & 0xF);
        }
开发者ID:fry,项目名称:Survivalist,代码行数:13,代码来源:World.cs


示例14: Light

        public Light(LightType aType)
        {
            fLightType = aType;

            fConstant = 1.0f;
            fLinear = 0.0f;
            fQuadratic = 0.0f;
            fIntensity = 1.0f;
        
            // Setting up spotlight stuff
            fAngle = (float)Math.PI;
            fCosAngle = -1;
            fSinAngle = 0.0f;
            fExponent = 1.0f;

        }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:16,代码来源:Light.cs


示例15: Light

        protected Light(LightType lightType)
        {
            LightType = lightType;

            Texture2D LightTexture = LightTextureBuilder.CreatePointLight(Renderer.GD, 512);

            KryptonLight = new Light2D()
            {
                Texture = LightTexture,
                Range = (float)(1.5f),
                Color = new Color(0.8f, 0.8f, 0.8f, 1f),
                Intensity = 1f,
                Angle = MathHelper.TwoPi * 0.5f,
                X = (float)(0),
                Y = (float)(0),
            };
        }
开发者ID:BartoszF,项目名称:ArtifactsRider,代码行数:17,代码来源:Light.cs


示例16: LightData

        public LightType type; //read

        #endregion Fields

        #region Constructors

        public LightData(ConfigNode node, Part part)
        {
            name = node.GetStringValue("name");
            intensity = node.GetFloatValue("intensity");
            range = node.GetFloatValue("range");
            angle = node.GetFloatValue("angle");
            type = (LightType)Enum.Parse(typeof(LightType), node.GetStringValue("type", LightType.Point.ToString()));

            transform = part.transform.FindRecursive(name);
            light = transform.GetComponent<Light>();
            if (light == null)
            {
                light = transform.gameObject.AddComponent<Light>();//add it if it does not exist
            }

            light.intensity = intensity;
            light.range = range;
            light.spotAngle = angle;
            light.type = type;
        }
开发者ID:shadowmage45,项目名称:SSTULabs,代码行数:26,代码来源:SSTUAnimateLight.cs


示例17: LightSource

        public LightSource(float[] RGB, Vector2 worldPos, LightType type, int range, GraphicsDevice graphicsDevice)
        {
            this.RGB = RGB;
            this.worldPos = worldPos;
            this.type = type;
            this.range = range;
            area = new RenderTarget2D(graphicsDevice, range*2, range*2);
            output.Add(new RenderTarget2D(graphicsDevice, range * 2, range * 2));
            output.Add(new RenderTarget2D(graphicsDevice, range * 2, range * 2));
            int order = 2;
            while(Math.Pow(2,order)<=range*2)
            {
                output.Add(new RenderTarget2D(graphicsDevice, (range * 2) / (int)Math.Pow(2, order), (range * 2)));
                order++;
            }

            RenderArea.X = 0;
            RenderArea.Y = 0;
            RenderArea.Width = 2*range;
            RenderArea.Height = 2*range;
        }
开发者ID:Fireeyes,项目名称:The-Day-After,代码行数:21,代码来源:LightSource.cs


示例18: FetchLight

        LightSource FetchLight(LightType type, Color color, float intensity, float range, float spotAngle = 0.0f)
        {
            LightSource light = null;

            if (activeHeadlights.Count == 0)
            {
                light = Singleton<RenderManager>.instance.ObtainLightSource();
            }
            else
            {
                light = activeHeadlights[0];
                activeHeadlights.RemoveAt(0);
            }

            light.m_light.intensity = intensity*fadingHeadlightsFactor;
            light.m_light.type = type;
            light.m_light.color = color;
            light.m_light.range = range;
            light.m_light.spotAngle = spotAngle;
            light.m_light.shadows = LightShadows.None;
            light.enabled = true;

            return light;
        }
开发者ID:abdulrahmanwaly,项目名称:Skylines-Daybreak,代码行数:24,代码来源:HeadlightsController.cs


示例19: SetRunOncePerLight

		/// <summary>
		///    Sets whether or not this pass should be run once per light which 
		///    can affect the object being rendered.
		/// </summary>
		/// <remarks>
		///    The default behavior for a pass (when this option is 'false'), is 
		///    for a pass to be rendered only once, with all the lights which could 
		///    affect this object set at the same time (up to the maximum lights 
		///    allowed in the render system, which is typically 8). 
		///    <p/>
		///    Setting this option to 'true' changes this behavior, such that 
		///    instead of trying to issue render this pass once per object, it 
		///    is run once <b>per light</b> which can affect this object. In 
		///    this case, only light index 0 is ever used, and is a different light 
		///    every time the pass is issued, up to the total number of lights 
		///    which is affecting this object. This has 2 advantages: 
		///    <ul><li>There is no limit on the number of lights which can be 
		///    supported</li> 
		///    <li>It's easier to write vertex / fragment programs for this because 
		///    a single program can be used for any number of lights</li> 
		///    </ul> 
		///    However, this technique is a lot more expensive, and typically you 
		///    will want an additional ambient pass, because if no lights are 
		///    affecting the object it will not be rendered at all, which will look 
		///    odd even if ambient light is zero (imagine if there are lit objects 
		///    behind it - the objects silhouette would not show up). Therefore, 
		///    use this option with care, and you would be well advised to provide 
		///    a less expensive fallback technique for use in the distance. 
		///    <p/>
		///    Note: The number of times this pass runs is still limited by the maximum 
		///    number of lights allowed as set in MaxLights, so 
		///    you will never get more passes than this. 
		/// </remarks>
		/// <param name="enabled">Whether this feature is enabled.</param>
		/// <param name="onlyForOneLightType">
		///    If true, the pass will only be run for a single type of light, other light types will be ignored. 
		/// </param>
		/// <param name="lightType">The single light type which will be considered for this pass.</param>
		public void SetRunOncePerLight( bool enabled, bool onlyForOneLightType, LightType lightType )
		{
			_iteratePerLight = enabled;
			_runOnlyForOneLightType = onlyForOneLightType;
			_onlyLightType = lightType;
		}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:44,代码来源:Pass.cs


示例20: GetLights

		public static extern Light[] GetLights(LightType type, int layer);
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:1,代码来源:Light.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LimitState类代码示例发布时间:2022-05-24
下一篇:
C# LightSetting类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap