Example #1
0
        // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        private Spec BuildVertSpec(Spec inSpec1, Spec inSpec2, Spec inSpec3, int inPos)
        {
            int sideA;
            int sideB;
            int sideC;

            switch (inPos)
            {
            case 0:
                sideA = inSpec1.sideA;
                sideB = inSpec2.sideA;
                sideC = inSpec3.sideA;
                break;

            case 1:
                sideA = inSpec1.sideB;
                sideB = inSpec2.sideB;
                sideC = inSpec3.sideB;
                break;

            case 2:
                sideA = inSpec1.sideC;
                sideB = inSpec2.sideC;
                sideC = inSpec3.sideC;
                break;

            default:
                throw new Exception("ERROR building vert spec");
                break;
            }

            // create new object
            var newSpec = new Spec();

            newSpec.sideA = sideA;
            newSpec.sideB = sideB;
            newSpec.sideC = sideC;

            return(newSpec);
        }