public override void init()
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;

            SystemState_Particulas.Instance.SetState_Zero();

            //Relative Positioning
            width = GuiController.Instance.Panel3d.Width;
            height = GuiController.Instance.Panel3d.Height;

            //Variables
            int cantExplosion = 10;
            float particleTime = 20f, sizeMax = 30f, speed = 0.05f, sizeSpeed = 1.5f;
            float updateTime = 0.01f;

            explosion = new ExplosionEmitter(cantExplosion, new Vector3(width / 2, height / 2, 0), new Vector3(speed, speed, speed), new Vector3(0.00f, 0.00f, 0.00f), 0f, sizeMax, particleTime, Color.White, 150, 0f, updateTime,r.Next(0, 1000), sizeSpeed,5);

            explosion.Init();
            explosion.AgregarModifiers(width, height);

            //Camara
            GuiController.Instance.RotCamera.Enable = true;
            GuiController.Instance.RotCamera.CameraDistance = 20;
            GuiController.Instance.BackgroundColor = Color.Black;
            GuiController.Instance.RotCamera.CameraCenter = new Vector3(width / 2, height / 2, 0);
        }
Пример #2
0
        public void init()
        {
            Device device = GuiController.Instance.D3dDevice;
                sphere = new TgcBoundingSphere(posicion, EXPLOSION_RADIUS);

                sound = new TgcStaticSound();
                time = 0;

                int width = GuiController.Instance.Panel3d.Width;
                int height = GuiController.Instance.Panel3d.Height;

                int cantExplosion = 20;
                float particleTime = 1f, sizeMax = 2000f, expSpeed = 1f, expSizeSpeed = 20f; ;
                float expUpdateTime = 0;

                //Creo el emisor de explosion
                emisorExplosion = new ExplosionEmitter(cantExplosion, posicion, new Vector3(expSpeed, expSpeed, expSpeed), new Vector3(0.00f, 0.00f, 0.00f), 500f, sizeMax, particleTime, Color.White, 150, 0f, expUpdateTime, GameManager.Instance.random.Next(0, 1000), expSizeSpeed, 2);
                emisorExplosion.Init();

                int cantidad = 20;
                Vector3 origen1 = posicion;
                float speed = 5f;
                float divergence = 7f;
                Vector3 velocidad = new Vector3(divergence, speed, divergence);
                Vector3 aceleracion = new Vector3(0, 0, 0);
                float min = 500f, max = 1000f, tiempoVida_Particula = 1f;
                int alpha = 150;
                float spawn = 0.01f;
                float sizeSpeed = 1000f;
                float updateTime = 0.02f;

                //Creo los emisores de humo
                emisorHumo = new SmokeEmitter(cantidad, origen1, velocidad, aceleracion, min, max, tiempoVida_Particula, Color.DarkGray, alpha, spawn, updateTime, sizeSpeed);
                emisorHumo.Init();
        }
        public override void init()
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;

            SystemState_Particulas.Instance.SetState_Zero();

            //Relative Positioning
            width  = GuiController.Instance.Panel3d.Width;
            height = GuiController.Instance.Panel3d.Height;

            //Variables
            int   cantExplosion = 10;
            float particleTime = 20f, sizeMax = 30f, speed = 0.05f, sizeSpeed = 1.5f;
            float updateTime = 0.01f;

            explosion = new ExplosionEmitter(cantExplosion, new Vector3(width / 2, height / 2, 0), new Vector3(speed, speed, speed), new Vector3(0.00f, 0.00f, 0.00f), 0f, sizeMax, particleTime, Color.White, 150, 0f, updateTime, r.Next(0, 1000), sizeSpeed, 5);

            explosion.Init();
            explosion.AgregarModifiers(width, height);

            //Camara
            GuiController.Instance.RotCamera.Enable         = true;
            GuiController.Instance.RotCamera.CameraDistance = 20;
            GuiController.Instance.BackgroundColor          = Color.Black;
            GuiController.Instance.RotCamera.CameraCenter   = new Vector3(width / 2, height / 2, 0);
        }
        public override void Update_Modifiers(Emitter emisor)
        {
            ExplosionEmitter e = (ExplosionEmitter)emisor;

            if (e.SizeSpeed != this.SizeSpeed)
            {
                this.SizeSpeed = e.SizeSpeed;
            }
            base.Update_Modifiers(emisor);
        }
Пример #5
0
        public void init()
        {
            Device device = GuiController.Instance.D3dDevice;

            sphere = new TgcBoundingSphere(posicion, EXPLOSION_RADIUS);

            sound = new TgcStaticSound();
            time  = 0;

            int width  = GuiController.Instance.Panel3d.Width;
            int height = GuiController.Instance.Panel3d.Height;

            int   cantExplosion = 20;
            float particleTime = 1f, sizeMax = 2000f, expSpeed = 1f, expSizeSpeed = 20f;;
            float expUpdateTime = 0;

            //Creo el emisor de explosion
            emisorExplosion = new ExplosionEmitter(cantExplosion, posicion, new Vector3(expSpeed, expSpeed, expSpeed), new Vector3(0.00f, 0.00f, 0.00f), 500f, sizeMax, particleTime, Color.White, 150, 0f, expUpdateTime, GameManager.Instance.random.Next(0, 1000), expSizeSpeed, 2);
            emisorExplosion.Init();


            int     cantidad = 20;
            Vector3 origen1 = posicion;
            float   speed = 5f;
            float   divergence = 7f;
            Vector3 velocidad = new Vector3(divergence, speed, divergence);
            Vector3 aceleracion = new Vector3(0, 0, 0);
            float   min = 500f, max = 1000f, tiempoVida_Particula = 1f;
            int     alpha      = 150;
            float   spawn      = 0.01f;
            float   sizeSpeed  = 1000f;
            float   updateTime = 0.02f;

            //Creo los emisores de humo
            emisorHumo = new SmokeEmitter(cantidad, origen1, velocidad, aceleracion, min, max, tiempoVida_Particula, Color.DarkGray, alpha, spawn, updateTime, sizeSpeed);
            emisorHumo.Init();
        }
        public override void Render(Emitter emisor)
        {
            this.Update_Modifiers(emisor);
            this.Agrandar(emisor);
            base.Render(emisor);
            ExplosionEmitter e = (ExplosionEmitter)emisor;

            if (this.Spawn > 0.01f)
            {
                if (this.Alpha > e.AlphaDecr)
                {
                    this.Alpha -= e.AlphaDecr;
                }
                else
                {
                    if (Alpha > 0)
                    {
                        this.Alpha--;
                    }
                }

                this.Spawn = 0f;
            }
        }