public Chunk(Vector3D position, double radius, int detailLevel, WaterFace face)
 {
     this.position    = position;
     this.radius      = radius;
     this.face        = face;
     this.detailLevel = detailLevel;
     this.wakeKey     = (Vector3I)(position / 10);
     this.textureId   = Math.Abs(((int)(position.X + position.Y + position.Z) / 10) % 2);
     this.children    = null;
 }
Exemple #2
0
        /// <summary>Provide a planet entity and it will set everything up for you</summary>
        public Water(MyPlanet planet, WaterSettings settings = null, float radiusMultiplier = 1.032f)
        {
            if (settings != null)
            {
                this.radius         = settings.Radius * planet.MinimumRadius;
                this.waveHeight     = settings.WaveHeight;
                this.waveSpeed      = settings.WaveSpeed;
                this.waveScale      = settings.WaveScale;
                this.viscosity      = settings.Viscosity;
                this.buoyancy       = settings.Buoyancy;
                this.enableFish     = settings.EnableFish;
                this.enableSeagulls = settings.EnableSeagulls;
                this.texture        = settings.Texture;
                this.crushDepth     = settings.CrushDepth;
                this.transparent    = settings.Transparent;
                this.lit            = settings.Lit;
                this.fogColor       = settings.FogColor;
                this.collectionRate = settings.CollectionRate;
                this.fluidDensity   = settings.FluidDensity;
            }
            else
            {
                radius = planet.MinimumRadius * radiusMultiplier;
            }

            planetID = planet.EntityId;

            position = planet.PositionComp.GetPosition();

            currentRadius = radius;

            this.planet = planet;

            waterFaces = new WaterFace[WaterData.Directions.Length];
            for (int i = 0; i < WaterData.Directions.Length; i++)
            {
                waterFaces[i] = new WaterFace(this, WaterData.Directions[i]);
            }

            Init();
        }