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


C# LightType类代码示例

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


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


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