Пример #1
0
        void LoadParticleEmitter(ref int var)
        {
            System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog();

            // Default to the directory which contains our content files.
            string assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string relativePath     = System.IO.Path.Combine(assemblyLocation, "../../../../../../Client/Driver/Content");
            string contentPath      = System.IO.Path.GetFullPath(relativePath);

            fileDialog.InitialDirectory = contentPath;

            fileDialog.Title = "Load Particle Emitter";

            fileDialog.Filter = "VTank Particle System (*.vtpes)|*.vtpes";

            if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings();
                StreamReader read = new StreamReader(fileDialog.FileName);
                newPSS.Load(read);
                read.Close();
                Renderer.RendererAssetPool.ParticleEmitterSettings.Clear();
                Renderer.RendererAssetPool.ParticleEmitterSettings.Add("Emitter", newPSS);
                Renderer.SceneTools.Entities.ParticleEmitter emitter = new Renderer.SceneTools.Entities.ParticleEmitter("Emitter");
                emitter.Position = Vector3.Zero;
                var = renderer.ActiveScene.Add(emitter, 1);
            }
        }
        /// <summary>
        /// Add an effect to the collection of EnvironmentProperties
        /// </summary>
        /// <param name="envProp">The environment property.</param>
        /// <param name="id">The environment property's Id</param>
        /// <param name="position">The position to add it in the scene.</param>
        public void AddEffect(EnvironmentProperty envProp, int id, Vector3 position)
        {
            if (envProps.ContainsKey(id))
                RemoveEffect(id);

            ParticleEmitter emitter = new ParticleEmitter(envProp.ParticleEffectName);
            ParticleEmitterSettings settings = emitter.Settings;

            settings.Radius = (int)Math.Floor(envProp.AoERadius);
            ParticleEmitter __emitterCopy = new ParticleEmitter(settings);

            __emitterCopy.Position = position;

            envProp.RenderID = ServiceManager.Scene.Add(__emitterCopy, 3);
            envProp.SetCreationTime();
            envProps[id] = envProp;
        }
Пример #3
0
        /// <summary>
        /// Constructor for a Base
        /// </summary>
        /// <param name="color">The team color of the base</param>
        /// <param name="position">The position to place the base at</param>
        /// <param name="eventId">The event ID of the base</param>
        /// <param name="_model">The model of the base.</param>
        public Base(GameSession.Alliance color, Vector3 position, int eventId, Model _model)
            : base(_model, position)
        {
            this.originalOwner = color;
            this.BaseColor = color;
            this.Position = position;
            this.eventId = eventId;
            this.health = Constants.MAX_BASE_HEALTH;
            this.destroyed = false;

            previousDamageState = DamageState.None;

            ParticleEmitter0 = new ParticleEmitter("DamagedBaseFire");
            ParticleEmitter1 = new ParticleEmitter("DamagedBaseFire");
            ParticleEmitter2 = new ParticleEmitter("DamagedBaseFire");
            ParticleEmitter3 = new ParticleEmitter("DamagedBaseFire");

            StopEmitters();

            ServiceManager.Scene.Add(ParticleEmitter0, 3);
            ServiceManager.Scene.Add(ParticleEmitter1, 3);
            ServiceManager.Scene.Add(ParticleEmitter2, 3);
            ServiceManager.Scene.Add(ParticleEmitter3, 3);
        }
Пример #4
0
        /// <summary>
        /// Add a particle emitter at a specified position, on the default layer (3).
        /// </summary>
        /// <param name="emitter">The ParticleEmitter object to add.</param>
        /// <param name="position">The X, Y, Z position of the emitter.</param>
        /// <returns>The emitter's render ID.</returns>
        public int AddParticleEmitterAtPosition(ParticleEmitter emitter, Vector3 position)
        {
            emitter.Position = position;
            int renderID = entityID.GetID();
            entityList.Add(renderID, emitter);
            AddLayers(3);
            layers[3].Add(renderID, emitter);

            return renderID;
        }
Пример #5
0
        /// <summary>
        /// Add a particle emitter at a specified position, on the default layer (3).
        /// </summary>
        /// <param name="particleSettingsName">The name of the particle emitter settings file.</param>
        /// <param name="position">The X, Y, Z position of the emitter.</param>
        /// <returns>The emitter's render ID.</returns>
        public int AddParticleEmitterAtPosition(string particleSettingsName, Vector3 position)
        {
            ParticleEmitter emitter = new ParticleEmitter(particleSettingsName, position);

            int renderID = entityID.GetID();
            entityList.Add(renderID, emitter);
            AddLayers(3);
            layers[3].Add(renderID, emitter);

            return renderID;
        }
Пример #6
0
        /// <summary>
        /// Adds a new ParticleEmitter to the scene.
        /// </summary>
        /// <param name="_entity">The ParticleEmitter object to add.</param>
        /// <param name="_layer">The layer to add the emitter.</param>
        /// <returns>The unique Renderer ID of the added emitter. </returns>
        public int Add(ParticleEmitter _entity, int _layer)
        {
            int x = entityID.GetID();
            entityList.Add(x, _entity);
            AddLayers(_layer);
            layers[_layer].Add(x, _entity);

            return x;
        }
Пример #7
0
        /// <summary>
        /// Handle the events that should take place when a base is destroyed.
        /// </summary>
        private void handleDestruction()
        {
            this.StopEmitters();

            base.Model = ServiceManager.Resources.GetModel("events\\base_dead");
            ParticleEmitter explosion = new ParticleEmitter("BaseExplosion", Position);
            ServiceManager.Scene.Add(explosion, 3);

            ParticleEmitter baseFire = new ParticleEmitter("DeadBaseFire",
                Position + DEAD_FIRE_OFFSET);
            destroyedFireEffectId = ServiceManager.Scene.Add(baseFire, 3);

            this.AddArrow();

            if (this.swordOrShieldRenderId != -1 && this.inConflict == true)
            {
                this.RemoveSwordOrShield();
            }
        }
Пример #8
0
 /// <summary>
 /// Adds a ParticleEmitter object to the layer.
 /// </summary>
 /// <param name="_entityID">The id to assign to the ParticleEmitter.</param>
 /// <param name="_entity">The ParticleEmitter object.</param>
 public void Add(int _entityID, ParticleEmitter _entity)
 {
     entityDictionaryEmitter.Add(_entityID, _entity);
 }
Пример #9
0
        /// <summary>
        /// Apply an instant health utility to the tank
        /// </summary>
        /// <param name="utility">The utility</param>
        public void ApplyInstantHealth(VTankObject.Utility utility)
        {
            int healthBonus = (int)(MaxHealth * utility.healthFactor) + utility.healthIncrease;

            if (this.Health + healthBonus > MaxHealth)
            {
                //For updating the healthbar, inflictdamage heals with negative values
                this.InflictDamage(-(MaxHealth - Health), false);
            }
            else
            {
                this.InflictDamage(-healthBonus, false);
            }
            ParticleEmitterSettings pset = Renderer.RendererAssetPool.ParticleEmitterSettings["Utility"];
            pset.ParticleSystemName = utility.model;
            ParticleEmitter pemit1 = new ParticleEmitter(pset);
            pemit1.Position = Position;
            pemit1.MimicPosition(this, Vector3.Zero);
            pemit1.MimicRotation(this);
            ServiceManager.Scene.Add(pemit1, 3);
        }
Пример #10
0
        void LoadParticleEmitter(ref int var)
        {
            System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog();

            // Default to the directory which contains our content files.
            string assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string relativePath = System.IO.Path.Combine(assemblyLocation, "../../../../../../Client/Driver/Content");
            string contentPath = System.IO.Path.GetFullPath(relativePath);

            fileDialog.InitialDirectory = contentPath;

            fileDialog.Title = "Load Particle Emitter";

            fileDialog.Filter = "VTank Particle System (*.vtpes)|*.vtpes";

            if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings();
                StreamReader read = new StreamReader(fileDialog.FileName);
                newPSS.Load(read);
                read.Close();
                Renderer.RendererAssetPool.ParticleEmitterSettings.Clear();
                Renderer.RendererAssetPool.ParticleEmitterSettings.Add("Emitter", newPSS);
                Renderer.SceneTools.Entities.ParticleEmitter emitter = new Renderer.SceneTools.Entities.ParticleEmitter("Emitter");
                emitter.Position = Vector3.Zero;
                var = renderer.ActiveScene.Add(emitter, 1);
            }
        }
Пример #11
0
        void InputHandler()
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Q))
                this.Exit();
            //Load tank model

            if (Keyboard.GetState().IsKeyDown(Keys.C))
            {
                if (!camChanged && overhead)
                {
                    renderer.ActiveScene.CurrentCamera = renderer.ActiveScene.AccessCamera("Chase");
                    overhead = false;
                }
                else if (!camChanged)
                {
                    renderer.ActiveScene.CurrentCamera = renderer.ActiveScene.AccessCamera("Overhead");
                    overhead = true;
                }
                camChanged = true;
            }
            if (Keyboard.GetState().IsKeyUp(Keys.C))
            { camChanged = false; }

            if (Keyboard.GetState().IsKeyDown(Keys.S))
            {
                if (!shadowChanged)
                {
                    Renderer.RendererAssetPool.DrawShadows = !Renderer.RendererAssetPool.DrawShadows;
                    shadowChanged = true;
                }
            }
            else
            { shadowChanged = false; }

            if (Keyboard.GetState().IsKeyDown(Keys.L))
            {
                if (!lightChanged)
                {
                    Renderer.GraphicOptions.ShadingSupport = !Renderer.GraphicOptions.ShadingSupport;
                    lightChanged = true;
                }
            }
            else
            { lightChanged = false; }

            if (Keyboard.GetState().IsKeyDown(Keys.Add))
            {
                percentDay = (percentDay + 0.01f);
                if (percentDay > 1.0) percentDay = 0.0f;
                renderer.ActiveScene.PercentOfDayComplete = percentDay;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right) && renderer.ActiveScene.Access3D(tank) != null)
                renderer.ActiveScene.Access3D(tank).Translate(Vector3.UnitX);
            if (Keyboard.GetState().IsKeyDown(Keys.Left) && renderer.ActiveScene.Access3D(tank) != null)
                renderer.ActiveScene.Access3D(tank).Translate(-Vector3.UnitX);

            if (Keyboard.GetState().IsKeyDown(Keys.RightControl) || Keyboard.GetState().IsKeyDown(Keys.LeftControl))
            {
                if (Keyboard.GetState().IsKeyDown(Keys.T))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(tank);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; tank = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Tank", "ModelProcessor", ref tank);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                        renderer.ActiveScene.MainEntity = renderer.ActiveScene.Access3D(tank);
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.A))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(tank);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; tank = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Animation", "SkinnedModelProcessor", ref other);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.W))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(turret);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; turret = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Weapon", "ModelProcessor", ref turret);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.P))
                {
                    renderer.ActiveScene.Clear(1);
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Powerup", "ModelProcessor", ref powerup);
                    if (powerup != -1)
                    { renderer.ActiveScene.Access3D(powerup).Position = new Vector3(0, 0, 30); }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.O))
                {
                    renderer.ActiveScene.Clear(1);
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Any Model", "ModelProcessor", ref other);
                    renderer.ActiveScene.Access3D(other).Position = new Vector3(32, 32, 0);
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.E))
                {
                    renderer.ActiveScene.Clear(1);
                    Renderer.RendererAssetPool.ParticleEmitterSettings.Remove("Emitter");
                    Renderer.RendererAssetPool.ParticleSystemSettings.Remove("Emitter");
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadParticleSystem();
                    LoadParticleEmitter(ref emitter);
                }
            }

            else if (Keyboard.GetState().IsKeyDown(Keys.E))
            {
                if (!emitterAdded)
                {
                    renderer.ActiveScene.Clear(1);
                    emitter = -1;
                    if (Renderer.RendererAssetPool.ParticleEmitterSettings.ContainsKey("Emitter"))
                    {
                        Renderer.SceneTools.Entities.ParticleEmitter em = new Renderer.SceneTools.Entities.ParticleEmitter("Emitter");
                        em.Position = Vector3.Zero;
                        emitter = renderer.ActiveScene.Add(em, 1);
                        emitterAdded = true;
                    }
                }
            }
            else if (Keyboard.GetState().IsKeyUp(Keys.E))
            {
                emitterAdded = false;
            }

            else if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                renderer.ActiveScene.Access3D(tank).RotateZ(0.1f);
            }
            else if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                renderer.ActiveScene.Access3D(tank).RotateZ(-0.1f);
            }
        }
Пример #12
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="_model">Projectile model</param>
        /// <param name="_position">Position of the missile</param>
        /// <param name="_angle">Angle at which the missile will be fired</param>
        /// <param name="_velocity">Velocity of the missile</param>
        /// <param name="_alive">Alive</param>
        /// <param name="_firedBy">Who fired the missile</param>
        public Projectile(Vector3 _position, VTankObject.Point target, double _angle, double _velocity,
            float _alive, PlayerTank _firedBy, ProjectileData projectileData)
        {
            this.data = projectileData;
            this.position = _position;

            position = _position + Vector3.UnitZ; ;
            base.ZRotation = (float)_angle;
            velocity = (float)_velocity;
            timeAlive = _alive;
            elapsed = 0;
            this.boundingSphere.Radius = projectileData.CollisionRadius;
            SetBoundingSpherePosition();
            owner = _firedBy;
            RenderID = -1;
            ID = projectileData.ID;
            origin = position;

            if (_firedBy.Weapon.HasFiringArc)
            {
                this.usingLaunchAngle = true;

                float swivelAngle = ZRotation;
                float tiltAngle = _firedBy.Weapon.LaunchAngle;

                float projection = DEFAULT_CANNON_LENGTH * (float)Math.Cos(tiltAngle);
                float tipX = -projection * (float)Math.Cos(swivelAngle);
                float tipY = -projection * (float)Math.Sin(swivelAngle);
                float tipZ = Math.Abs(DEFAULT_CANNON_LENGTH * (float)Math.Sin(swivelAngle));
                tip = new float[] { tipX, tipY, tipZ };

                Vector3 newPosition = position + new Vector3(tipX, tipY, tipZ);
                // Calculate initial velocity based on the distance we travel.
                float distance = (float)Math.Sqrt(
                    Math.Pow(target.x - newPosition.X, 2) +
                    Math.Pow(target.y - newPosition.Y, 2));
                float maxDistance = (int)projectileData.Range;
                if (distance > maxDistance)
                    distance = maxDistance;

                // TODO: This is a temporary work-around until we figure out what velocity component
                // is missing from the formula.
                float offset = 1.1f;
                if (tiltAngle > MathHelper.ToRadians(45.0f))
                    offset = 1.6f;

                float V  = (float)Math.Sqrt(-gravity * distance * offset);
                float Vx = -V * (float)(Math.Cos(tiltAngle) * Math.Cos(swivelAngle));
                float Vy = -V * (float)(Math.Cos(tiltAngle) * Math.Sin(swivelAngle));
                float Vz = V * (float)Math.Sin(tiltAngle);

                componentVelocity = new float[] { Vx, Vy, Vz };
                elapsedDelta = 0f;

                /*this.verticalVelocity = this.FindVerticalVelocity(_firedBy.Weapon.LaunchAngle, velocity);
                float flightTime = this.FindFlightTime(verticalVelocity, gravity);
                float horizontalVelocity = this.FindHorizontalVelocity(
                    distance,
                    flightTime);
                velocity = horizontalVelocity;*/
            }

            Object3 turret = owner.Turret;
            ModelBoneCollection.Enumerator collection = turret.Model.Bones.GetEnumerator();
            List<ModelBone> emitters = new List<ModelBone>();
            while (collection.MoveNext())
            {
                if (collection.Current.Name.StartsWith("Emitter"))
                {
                    emitters.Add(collection.Current);
                }
            }

            if (emitters.Count == 0)
            {
                ServiceManager.Game.Console.DebugPrint(
                    "Warning: Can't attach to owner tank, no emitter exists.");
            }
            else
            {
                int emitter = _firedBy.Weapon.GetNextEmitterIndex();
                this.Attach(turret, emitters[emitter].Name);

                this.MimicRotation(turret);
                this.Unattach();
                Vector3 forward = emitters[emitter].Transform.Forward;
                forward.Z = Math.Abs(forward.Z);
                //position *= forward;
            }

            if (!String.IsNullOrEmpty(projectileData.Model))
            {
                model = new Object3(ServiceManager.Resources.GetModel("projectiles\\" + projectileData.Model), position);
                model.MimicPosition(this, Vector3.Zero);
                model.MimicRotation(this);
                modelRenderID = ServiceManager.Scene.Add(model, 3);
            }
            else
            {
                model = null;
            }

            if (!String.IsNullOrEmpty(projectileData.ParticleEffect) && projectileData.Model == null)
            {
                ParticleEmitter.MimicPosition(this, Vector3.Zero);
                ParticleEmitter.MimicRotation(this);
                particleEmitterRenderID = ServiceManager.Scene.Add(ParticleEmitter, 3);
            }
            else if (!String.IsNullOrEmpty(projectileData.ParticleEffect))
            {
                ParticleEmitter = new ParticleEmitter(projectileData.ParticleEffect, this.Position);
                this.particleEmitterRenderID = ServiceManager.Scene.Add(ParticleEmitter, 3);
                ParticleEmitter.Follow(this);
            }
        }
Пример #13
0
        /// <summary>
        /// Constructor for a MobileEmitter
        /// </summary>
        /// <param name="velocity">The speed at which the emitter should travel.</param>
        /// <param name="emitter">The particle emitter it should become.</param>
        /// <param name="startPosition">The point at which the emitter should originate.</param>
        /// <param name="endPosition">The point at which the emitter should expire.</param>
        public MobileEmitter(float velocity, ParticleEmitter emitter, Vector3 startPosition, Vector3 endPosition)
            : base(emitter.Settings, startPosition)
        {
            this.angle = (float)Math.Atan2((startPosition.Y - endPosition.Y), (startPosition.X - endPosition.X));
            base.ZRotation = this.angle;

            float distance = (float)Math.Abs(Math.Sqrt(
                       Math.Pow(endPosition.X - startPosition.X, 2) +
                       Math.Pow(endPosition.Y - startPosition.Y, 2)));
            this.flightTime = (long)((distance / velocity)*1000);
            this.startTime = Network.Util.Clock.GetTimeMilliseconds();

            this.velocity = velocity;
            this.start = startPosition;
            this.end = endPosition;

            this.emitterRenderID = -1;

            base.Update(true);
        }
Пример #14
0
        void InputHandler()
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Q))
            {
                this.Exit();
            }
            //Load tank model

            if (Keyboard.GetState().IsKeyDown(Keys.C))
            {
                if (!camChanged && overhead)
                {
                    renderer.ActiveScene.CurrentCamera = renderer.ActiveScene.AccessCamera("Chase");
                    overhead = false;
                }
                else if (!camChanged)
                {
                    renderer.ActiveScene.CurrentCamera = renderer.ActiveScene.AccessCamera("Overhead");
                    overhead = true;
                }
                camChanged = true;
            }
            if (Keyboard.GetState().IsKeyUp(Keys.C))
            {
                camChanged = false;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.S))
            {
                if (!shadowChanged)
                {
                    Renderer.RendererAssetPool.DrawShadows = !Renderer.RendererAssetPool.DrawShadows;
                    shadowChanged = true;
                }
            }
            else
            {
                shadowChanged = false;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.L))
            {
                if (!lightChanged)
                {
                    Renderer.GraphicOptions.ShadingSupport = !Renderer.GraphicOptions.ShadingSupport;
                    lightChanged = true;
                }
            }
            else
            {
                lightChanged = false;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Add))
            {
                percentDay = (percentDay + 0.01f);
                if (percentDay > 1.0)
                {
                    percentDay = 0.0f;
                }
                renderer.ActiveScene.PercentOfDayComplete = percentDay;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right) && renderer.ActiveScene.Access3D(tank) != null)
            {
                renderer.ActiveScene.Access3D(tank).Translate(Vector3.UnitX);
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Left) && renderer.ActiveScene.Access3D(tank) != null)
            {
                renderer.ActiveScene.Access3D(tank).Translate(-Vector3.UnitX);
            }

            if (Keyboard.GetState().IsKeyDown(Keys.RightControl) || Keyboard.GetState().IsKeyDown(Keys.LeftControl))
            {
                if (Keyboard.GetState().IsKeyDown(Keys.T))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(tank);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; tank = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Tank", "ModelProcessor", ref tank);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                    renderer.ActiveScene.MainEntity = renderer.ActiveScene.Access3D(tank);
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.A))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(tank);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; tank = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Animation", "SkinnedModelProcessor", ref other);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.W))
                {
                    renderer.ActiveScene.Delete(other);
                    renderer.ActiveScene.Delete(turret);
                    renderer.ActiveScene.Delete(powerup);
                    renderer.ActiveScene.Delete(emitter);
                    other = -1; turret = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Weapon", "ModelProcessor", ref turret);
                    if (tank != -1 && turret != -1)
                    {
                        renderer.ActiveScene.Access3D(turret).Attach(renderer.ActiveScene.Access3D(tank), "Mount");
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.P))
                {
                    renderer.ActiveScene.Clear(1);
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Powerup", "ModelProcessor", ref powerup);
                    if (powerup != -1)
                    {
                        renderer.ActiveScene.Access3D(powerup).Position = new Vector3(0, 0, 30);
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.O))
                {
                    renderer.ActiveScene.Clear(1);
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadFile("Load Any Model", "ModelProcessor", ref other);
                    renderer.ActiveScene.Access3D(other).Position = new Vector3(32, 32, 0);
                }
                else if (Keyboard.GetState().IsKeyDown(Keys.E))
                {
                    renderer.ActiveScene.Clear(1);
                    Renderer.RendererAssetPool.ParticleEmitterSettings.Remove("Emitter");
                    Renderer.RendererAssetPool.ParticleSystemSettings.Remove("Emitter");
                    tank = -1; turret = -1; other = -1; powerup = -1; emitter = -1;
                    LoadParticleSystem();
                    LoadParticleEmitter(ref emitter);
                }
            }

            else if (Keyboard.GetState().IsKeyDown(Keys.E))
            {
                if (!emitterAdded)
                {
                    renderer.ActiveScene.Clear(1);
                    emitter = -1;
                    if (Renderer.RendererAssetPool.ParticleEmitterSettings.ContainsKey("Emitter"))
                    {
                        Renderer.SceneTools.Entities.ParticleEmitter em = new Renderer.SceneTools.Entities.ParticleEmitter("Emitter");
                        em.Position  = Vector3.Zero;
                        emitter      = renderer.ActiveScene.Add(em, 1);
                        emitterAdded = true;
                    }
                }
            }
            else if (Keyboard.GetState().IsKeyUp(Keys.E))
            {
                emitterAdded = false;
            }

            else if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                renderer.ActiveScene.Access3D(tank).RotateZ(0.1f);
            }
            else if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                renderer.ActiveScene.Access3D(tank).RotateZ(-0.1f);
            }
        }