public static void AddFire(int value, int x, int y, int z)
        {
            const float size = 0.15f;
            var         fireParticleSystem = new FireParticleSystem(new Vector3(x + 0.5f, y + 0.2f, z + 0.5f), size, 16f);

            m_subsystemParticles.AddParticleSystem(fireParticleSystem);
            m_particleSystemsByCell[new Point3(x, y, z)] = fireParticleSystem;
        }
Пример #2
0
        public void RemoveFire(int x, int y, int z)
        {
            Point3             key            = new Point3(x, y, z);
            FireParticleSystem particleSystem = m_particleSystemsByCell[key];

            m_subsystemParticles.RemoveParticleSystem(particleSystem);
            m_particleSystemsByCell.Remove(key);
        }
Пример #3
0
        public void AddFire(int value, int x, int y, int z)
        {
            Vector3            v    = new Vector3(0.5f, 0.2f, 0.5f);
            float              size = 0.15f;
            FireParticleSystem fireParticleSystem = new FireParticleSystem(new Vector3(x, y, z) + v, size, 16f);

            m_subsystemParticles.AddParticleSystem(fireParticleSystem);
            m_particleSystemsByCell[new Point3(x, y, z)] = fireParticleSystem;
        }
        public void AddCampfireParticleSystem(int value, int x, int y, int z)
        {
            int num = Terrain.ExtractData(value);

            if (num > 0)
            {
                Vector3            v    = new Vector3(0.5f, 0.15f, 0.5f);
                float              size = MathUtils.Lerp(0.2f, 0.5f, (float)num / 15f);
                FireParticleSystem fireParticleSystem = new FireParticleSystem(new Vector3(x, y, z) + v, size, 256f);
                m_subsystemParticles.AddParticleSystem(fireParticleSystem);
                m_particleSystemsByCell[new Point3(x, y, z)] = fireParticleSystem;
            }
        }
        public void AddTorch(int value, int x, int y, int z)
        {
            Vector3 v;
            float   size;

            switch (Terrain.ExtractContents(value))
            {
            case 31:
                switch (Terrain.ExtractData(value))
                {
                case 0:
                    v = new Vector3(0.5f, 0.58f, 0.27f);
                    break;

                case 1:
                    v = new Vector3(0.27f, 0.58f, 0.5f);
                    break;

                case 2:
                    v = new Vector3(0.5f, 0.58f, 0.73f);
                    break;

                case 3:
                    v = new Vector3(0.73f, 0.58f, 0.5f);
                    break;

                default:
                    v = new Vector3(0.5f, 0.53f, 0.5f);
                    break;
                }
                size = 0.15f;
                break;

            case 132:
                v    = new Vector3(0.5f, 0.1f, 0.5f);
                size = 0.1f;
                break;

            default:
                v    = new Vector3(0.5f, 0.2f, 0.5f);
                size = 0.2f;
                break;
            }
            FireParticleSystem fireParticleSystem = new FireParticleSystem(new Vector3(x, y, z) + v, size, 24f);

            m_subsystemParticles.AddParticleSystem(fireParticleSystem);
            m_particleSystemsByCell[new Point3(x, y, z)] = fireParticleSystem;
        }
Пример #6
0
        public void AddParticleSystems(int value, int x, int y, int z)
        {
            if (Terrain.ExtractContents(value) != 227)
            {
                return;
            }
            int             data        = Terrain.ExtractData(value);
            int             rotation    = FurnitureBlock.GetRotation(data);
            int             designIndex = FurnitureBlock.GetDesignIndex(data);
            FurnitureDesign design      = GetDesign(designIndex);

            if (design == null)
            {
                return;
            }
            List <FireParticleSystem> list = new List <FireParticleSystem>();

            BoundingBox[] torchPoints = design.GetTorchPoints(rotation);
            if (torchPoints.Length != 0)
            {
                BoundingBox[] array = torchPoints;
                for (int i = 0; i < array.Length; i++)
                {
                    BoundingBox        boundingBox        = array[i];
                    float              num                = (boundingBox.Size().X + boundingBox.Size().Y + boundingBox.Size().Z) / 3f;
                    float              size               = MathUtils.Clamp(1.5f * num, 0.1f, 1f);
                    FireParticleSystem fireParticleSystem = new FireParticleSystem(new Vector3(x, y, z) + boundingBox.Center(), size, 24f);
                    m_subsystemParticles.AddParticleSystem(fireParticleSystem);
                    list.Add(fireParticleSystem);
                }
            }
            if (list.Count > 0)
            {
                m_particleSystemsByCell[new Point3(x, y, z)] = list;
            }
        }