Beispiel #1
0
        private static AxeSecondProps GetModel_Second_Props(SortedList <string, double> from, SortedList <string, double> to, bool hasBeard)
        {
            AxeSecondProps retVal = new AxeSecondProps();

            Random rand = StaticRandom.GetRandomForThread();

            #region Points

            // Edge
            retVal.EndTR = new Point3D(2, -1.1, 0) + WeaponDNA.GetKeyValue_Vector("EndTR", from, to, Math3D.GetRandomVector_Circular(.25));
            retVal.EndBR = new Point3D(1.3, 1.8, 0) + WeaponDNA.GetKeyValue_Vector("EndBR", from, to, Math3D.GetRandomVector_Circular(.25));

            // Left
            retVal.EndTL   = new Point3D(-1.5, -1, 0);
            retVal.EndBL_1 = new Point3D(-1.5, .5, 0);

            if (hasBeard)
            {
                // Put an extra point along the bottom (left of this is that circle cutout)
                retVal.EndBL_2 = retVal.EndBL_1;        // 2 is now the last point
                retVal.EndBL_1 = new Point3D(.3, 1.2, 0) + WeaponDNA.GetKeyValue_Vector("EndBL_1", from, to, Math3D.GetRandomVector_Circular(.25));
            }
            else
            {
                retVal.EndBL_2 = null;
            }

            if (retVal.EndBL_2 != null && WeaponDNA.GetKeyValue_Bool("shouldExtendBeard", from, to, rand.NextBool()))
            {
                // Extend the beard
                retVal.EndBR   += new Vector3D(0, WeaponDNA.GetKeyValue("extendBR", from, to, rand.NextDouble(.25, 2.2)), 0);
                retVal.EndBL_1 += new Vector3D(0, WeaponDNA.GetKeyValue("extendBL", from, to, rand.NextDouble(.25, 1.8)), 0);
            }

            double maxY = retVal.EndBR.Y - .25;

            if (retVal.EndBL_2 != null && retVal.EndBL_1.Y > maxY)
            {
                retVal.EndBL_1 = new Point3D(retVal.EndBL_1.X, maxY, retVal.EndBL_1.Z);       // can't let the middle point get lower, because the 3D would look wrong)
            }

            #endregion

            #region Curve Controls

            retVal.EdgeAngleT   = WeaponDNA.GetKeyValue("EdgeAngleT", from, to, rand.NextPercent(15, .25));
            retVal.EdgePercentT = WeaponDNA.GetKeyValue("EdgePercentT", from, to, rand.NextPercent(.3, .25));

            retVal.EdgeAngleB   = WeaponDNA.GetKeyValue("EdgeAngleB", from, to, rand.NextPercent(15, .25));
            retVal.EdgePercentB = WeaponDNA.GetKeyValue("EdgePercentB", from, to, rand.NextPercent(.3, .25));

            // Only used if EndBL_2 is null
            retVal.B1AngleR   = WeaponDNA.GetKeyValue("B1AngleR", from, to, rand.NextPercent(10, .25));
            retVal.B1PercentR = WeaponDNA.GetKeyValue("B1PercentR", from, to, rand.NextPercent(.5, .25));

            retVal.B1AngleL   = WeaponDNA.GetKeyValue("B1AngleL", from, to, rand.NextPercent(10, .25));
            retVal.B1PercentL = WeaponDNA.GetKeyValue("B1PercentL", from, to, rand.NextPercent(.33, .25));

            // Only used if EndBL_2 is populated
            retVal.B2AngleR   = WeaponDNA.GetKeyValue("B2AngleR", from, to, rand.NextDouble(40, 80));
            retVal.B2PercentR = WeaponDNA.GetKeyValue("B2PercentR", from, to, rand.NextPercent(.6, .25));

            retVal.B2AngleL   = WeaponDNA.GetKeyValue("B2AngleL", from, to, rand.NextDouble(40, 80));
            retVal.B2PercentL = WeaponDNA.GetKeyValue("B2PercentL", from, to, rand.NextPercent(.4, .25));

            #endregion

            return(retVal);
        }
Beispiel #2
0
        private static AxeSymetricalProps GetModel_Symetrical_Props(SortedList <string, double> from, SortedList <string, double> to)
        {
            AxeSymetricalProps retVal = new AxeSymetricalProps();

            Random rand = StaticRandom.GetRandomForThread();

            // Center Filled
            retVal.isCenterFilled = WeaponDNA.GetKeyValue_Bool("isCenterFilled", from, to, rand.NextBool());

            // Edge
            retVal.edgeAngle   = WeaponDNA.GetKeyValue("edgeAngle", from, to, rand.NextPercent(45, 1));
            retVal.edgePercent = WeaponDNA.GetKeyValue("edgePercent", from, to, rand.NextPercent(.33, .75));

            // Left
            retVal.leftAway = WeaponDNA.GetKeyValue_Bool("leftAway", from, to, rand.NextBool());

            if (retVal.leftAway)
            {
                retVal.leftAngle   = WeaponDNA.GetKeyValue("leftAngle", from, to, rand.NextDouble(0, 15));
                retVal.leftPercent = WeaponDNA.GetKeyValue("leftPercent", from, to, rand.NextPercent(.25, .5));
            }
            else
            {
                retVal.leftAngle   = WeaponDNA.GetKeyValue("leftAngle", from, to, rand.NextPercent(20, .5));
                retVal.leftPercent = WeaponDNA.GetKeyValue("leftPercent", from, to, rand.NextPercent(.25, .75));
            }

            // Right
            retVal.rightAway = retVal.leftAway ? true : WeaponDNA.GetKeyValue_Bool("rightAway", from, to, rand.NextBool());        // it looks like a vase when left is away, and right is toward

            if (retVal.rightAway)
            {
                retVal.rightAngle   = WeaponDNA.GetKeyValue("rightAngle", from, to, rand.NextDouble(0, 15));
                retVal.rightPercent = WeaponDNA.GetKeyValue("rightPercent", from, to, rand.NextPercent(.25, .5));
            }
            else
            {
                retVal.rightAngle   = WeaponDNA.GetKeyValue("rightAngle", from, to, rand.NextPercent(20, .75));
                retVal.rightPercent = WeaponDNA.GetKeyValue("rightPercent", from, to, rand.NextPercent(.25, .75));
            }

            // Points
            retVal.leftX = -WeaponDNA.GetKeyValue("leftX", from, to, rand.NextDouble(1, 3));
            if (retVal.leftAway)
            {
                retVal.leftY = WeaponDNA.GetKeyValue("leftY", from, to, rand.NextDouble(2, 2.5));
            }
            else
            {
                retVal.leftY = WeaponDNA.GetKeyValue("leftY", from, to, rand.NextDouble(1.25, 2.5));
            }

            retVal.rightX = 2;
            retVal.rightY = 3.4;

            // Z
            retVal.Scale1X = WeaponDNA.GetKeyValue("Scale1X", from, to, rand.NextDouble(.6, .8));
            retVal.Scale1Y = WeaponDNA.GetKeyValue("Scale1Y", from, to, rand.NextDouble(.8, .95));
            retVal.Z1      = WeaponDNA.GetKeyValue("Z1", from, to, rand.NextPercent(.2, .5));

            retVal.Scale2X = WeaponDNA.GetKeyValue("Scale2X", from, to, rand.NextPercent(.4, .25));
            retVal.Scale2Y = WeaponDNA.GetKeyValue("Scale2Y", from, to, rand.NextPercent(.4, .25));
            retVal.Z2L     = WeaponDNA.GetKeyValue("Z2L", from, to, rand.NextPercent(.55, .25));
            retVal.Z2R     = WeaponDNA.GetKeyValue("Z2R", from, to, rand.NextPercent(.33, .25));

            return(retVal);
        }