Esempio n. 1
0
        public static LightGameObject CreateAmbientLight(IEntityManager manager)
        {
            var tag = new ElementTag("AmbientLight_" + Interlocked.Increment(ref lights));

            manager.CreateEntity(tag)
            .AddComponents(
                LightComponent.CreateAmbient(0.4f, 0),
                ColorComponent.CreateDiffuse(V4Colors.White)
                );

            return(new LightGameObject(tag, "AmbientLight"));
        }
Esempio n. 2
0
        public static LightObject CreateAmbientLight(IEntityManager manager, float intensity = 0.4f)
        {
            var index = 0;

            if (!occupiedIndex.Add(index))
            {
                throw new LightIndexOccupiedException(index);
            }

            var tag = new ElementTag("AmbientLight_" + Interlocked.Increment(ref lights));
            var sv4 = SharpDX.Color.White.ToVector4();

            manager.CreateEntity(tag)
            .AddComponent(LightComponent.CreateAmbient(intensity, index))
            .AddComponent(ColorComponent.CreateDiffuse(new Vector4(sv4.X, sv4.Y, sv4.Z, sv4.W)));

            return(new LightObject(tag, "AmbientLight"));
        }