protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            var ob = builder as MyObjectBuilder_PlanetGeneratorDefinition;

            Diameter = ob.Diameter;
            Deviation = ob.Deviation;
            StructureRatio = ob.StructureRatio;
            NormalNoiseValue = ob.NormalNoiseValue;
            HasAtmosphere = ob.HasAtmosphere;

            HillParams = ob.HillParams;
            CanyonParams = ob.CanyonParams;
            NumLayers = ob.NumLayers;
            HostilityProbability = ob.HostilityProbability;

            SouthPole = ob.SouthPole;
            NorthPole = ob.NorthPole;

            FloraMaterialSpawnProbability = ob.FloraMaterialSpawnProbability;


            OrganicHeightEnd = ob.OrganicHeightEnd;

            MetalsOreProbability =  ob.MetalsOreProbability;

            GravityFalloffPower = ob.GravityFalloffPower;

            HostileAtmosphereColorShift = ob.HostileAtmosphereColorShift;

            MaterialsMaxDeph = ob.MaterialsMaxDeph;
            MaterialsMinDeph = ob.MaterialsMinDeph;
        }
        private static MyMaterialLayer CreatePoleLayer(MyRandom random, MyPoleParams poleParams, float startHeight, float outerRadius, ref int layerOffset)
        {
            if (m_materialsByOreType.ContainsKey("Ice") == false)
            {
                return null;
            }

            MyMaterialLayer poleLayer = null;
            float poleProbability = random.NextFloat(0, 1);

            if (poleParams != null && poleProbability < poleParams.Probability)
            {
                layerOffset++;

                poleLayer = new MyMaterialLayer();
                poleLayer.StartHeight = startHeight;
                poleLayer.EndHeight = outerRadius;
                poleLayer.MaterialDefinition = m_materialsByOreType["Ice"][random.Next() % m_materialsByOreType["Ice"].Count];
                poleLayer.HeightEndDeviation = 0;
                poleLayer.HeightStartDeviation = 0;
                poleLayer.StartAngle = random.NextFloat(poleParams.Angle.Min, poleParams.Angle.Max);
                poleLayer.EndAngle = 1.0f;
                poleLayer.AngleStartDeviation = random.NextFloat(poleParams.AngleDeviation.Min, poleParams.AngleDeviation.Max);
            }
            return poleLayer;
        }