Esempio n. 1
0
        protected override void AddParticleDirectly(Particle part)
        {
            base.AddParticleDirectly(part);
            Coordinate3D coord = TransformToCoord(part.Position);

            ParticleMap.Add(part, coord);
            GetCell(coord).AddParticle(part);
        }
Esempio n. 2
0
        protected override void AddParticleDirectly(Particle part)
        {
            base.AddParticleDirectly(part);
            Coord3D coord = TransformToCoord(part.Position);

            ParticleMap.Add(part, coord);
            Grid[coord].AddLast(part);
        }
Esempio n. 3
0
        public GameMap(int width, int height)
        {
            this.width  = width;
            this.height = height;

            partMap = new ParticleMap(this, width, height);
            tempMap = new TemperatureMap(this, width, height);
            /* fluidMap = new FluidMap(this, width, height); */
        }
Esempio n. 4
0
        protected override void RemoveParticleDirectly(Particle part)
        {
            base.RemoveParticleDirectly(part);

            if (ParticleMap.ContainsKey(part))
            {
                Coordinate3D coord = ParticleMap[part];
                GetCell(coord).RemoveParticle(part);
                ParticleMap.Remove(part);
            }
        }
Esempio n. 5
0
        protected override void RemoveParticleDirectly(Particle part)
        {
            base.RemoveParticleDirectly(part);

            if (ParticleMap.ContainsKey(part))
            {
                Coord3D coord = ParticleMap[part];
                Grid[coord].Remove(part);
                ParticleMap.Remove(part);
            }
        }
Esempio n. 6
0
        public static void ApplyPhysics(ParticleMap input, GameTime GameTime)
        {
            foreach (Particle Particle in input.Particles)
            {
                if (GravityEnabled)
                {
                    Gravity.ApplyGravity(Particle);
                }

                Particle.Update(GameTime);
            }
        }