예제 #1
0
    protected override List <Vector3> GenerateVertices(PartDirection direction, PartRotation rotation, int posX, int posY, int posZ)
    {
        List <Vector3> verts = new List <Vector3>();



        Quaternion rotQuat     = Quaternion.Euler(0, 0, 0);
        Vector3    axisForward = direction.ToVector3();

        switch (direction)
        {
        case PartDirection.North:
            rotQuat = Quaternion.Euler(0, 0, 0);
            break;

        case PartDirection.East:
            rotQuat = Quaternion.Euler(0, 90, 0);
            break;

        case PartDirection.South:
            rotQuat = Quaternion.Euler(0, 180, 0);
            break;

        case PartDirection.West:
            rotQuat = Quaternion.Euler(0, -90, 0);
            break;

        case PartDirection.Up:
            rotQuat = Quaternion.Euler(-90, 0, 0);
            break;

        case PartDirection.Down:
            rotQuat = Quaternion.Euler(90, 0, 0);
            break;
        }

        float rotationAngle = 0f;

        switch (rotation)
        {
        case PartRotation.Up:
            rotationAngle = 0f;
            break;

        case PartRotation.Right:
            rotationAngle = 90f;
            break;

        case PartRotation.Down:
            rotationAngle = 0;
            break;

        case PartRotation.Left:
            rotationAngle = 90f;
            break;
        }


        Quaternion rotAxis = Quaternion.AngleAxis(rotationAngle, axisForward);


        float fac = 0.125f * 0.5f;



        #region The both ends


        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, -8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        //
        //
        //
        //
        //
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, 8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 8)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));

        #endregion

        #region InnerCross

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, 8)) * fac));

        #endregion

        float gearToothsHeight = 9f;

        #region The Tooths

        for (int i = 0; i < 8; i++)
        {
            //verts.Add(rotAxis * rotQuat * ((new Vector3(4, PartVerticesHelpMethods.Circle(6f, (i / 8f) - 0.5f).y, PartVerticesHelpMethods.Circle(6f, (i / 8f) - 0.5f).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(4, PartVerticesHelpMethods.Circle(6f, (i / 8f)).y, PartVerticesHelpMethods.Circle(6f, (i / 8f)).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(4, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(4, PartVerticesHelpMethods.Circle(6f, (i / 8f) + 0.5f).y, PartVerticesHelpMethods.Circle(6f, (i / 8f) + 0.5f).x)) * fac));
            //
            //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, PartVerticesHelpMethods.Circle(6f, (i / 8f) + 0.5f).y, PartVerticesHelpMethods.Circle(6f, (i / 8f) + 0.5f).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, PartVerticesHelpMethods.Circle(6f, (i / 8f)).y, PartVerticesHelpMethods.Circle(6f, (i / 8f)).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x)) * fac));
            //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, PartVerticesHelpMethods.Circle(6f, (i / 8f) - 0.5f).y, PartVerticesHelpMethods.Circle(6f, (i / 8f) - 0.5f).x)) * fac));


            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((i - 0.5f) / 8f)).y, PartVerticesHelpMethods.Circle(24f, ((i - 0.5f) / 8f)).x, -8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((i - 0.5f) / 8f)).y, PartVerticesHelpMethods.Circle(24f, ((i - 0.5f) / 8f)).x, 8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x, -8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x, 8)) * fac));

            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((i + 0.5f) / 8f)).y, PartVerticesHelpMethods.Circle(24f, ((i + 0.5f) / 8f)).x, 8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((i + 0.5f) / 8f)).y, PartVerticesHelpMethods.Circle(24f, ((i + 0.5f) / 8f)).x, -8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x, 8)) * fac));
            verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).y, PartVerticesHelpMethods.Circle(gearToothsHeight, (i / 8f)).x, -8)) * fac));
        }

        #endregion

        #region The Faces on the positive Z-Side

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(0, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((-0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((-0.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(0, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).y, -8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 0, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 0, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).y, -8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(0, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(0, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).y, -8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 0, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 0, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).y, -8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).y, -8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((7.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((7.5f) / 8f)).y, -8)) * fac));

        #endregion



        #region The Faces on the negative Z-Side

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((-0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((-0.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(0, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(0, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((0f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((0.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((1f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).y, 8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((1.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 0, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 0, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((2f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((2.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((3f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).y, 8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((3.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(0, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(0, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((4f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((4.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).y, 8)) * fac));



        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((5.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 0, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 0, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((6f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((6.5f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).y, 8)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 1, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).x, PartVerticesHelpMethods.Circle(gearToothsHeight, ((7f) / 8f)).y, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-1, 4, 8)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(PartVerticesHelpMethods.Circle(24f, ((7.5f) / 8f)).x, PartVerticesHelpMethods.Circle(24f, ((7.5f) / 8f)).y, 8)) * fac));

        #endregion

        return(verts);
    }
예제 #2
0
    protected override List <Vector3> GenerateVertices(PartDirection direction, PartRotation rotation, int posX, int posY, int posZ)
    {
        List <Vector3> verts = new List <Vector3>();


        //verts.Add(new Vector3(posX, posY, posZ));               // 0
        //verts.Add(new Vector3(posX + 1, posY, posZ));           // 1
        //verts.Add(new Vector3(posX, posY + 1, posZ));           // 2
        //verts.Add(new Vector3(posX + 1, posY + 1, posZ));       // 3
        //
        //verts.Add(new Vector3(posX, posY, posZ + 5));           // 4
        //verts.Add(new Vector3(posX + 1, posY, posZ + 5));       // 5
        //verts.Add(new Vector3(posX, posY + 1, posZ + 5));       // 6
        //verts.Add(new Vector3(posX + 1, posY + 1, posZ + 5));   // 7



        Quaternion rotQuat     = Quaternion.Euler(0, 0, 0);
        Vector3    axisForward = direction.ToVector3();

        switch (direction)
        {
        case PartDirection.North:
            rotQuat = Quaternion.Euler(0, 0, 0);
            break;

        case PartDirection.East:
            rotQuat = Quaternion.Euler(0, 90, 0);
            break;

        case PartDirection.South:
            rotQuat = Quaternion.Euler(0, 180, 0);
            break;

        case PartDirection.West:
            rotQuat = Quaternion.Euler(0, -90, 0);
            break;

        case PartDirection.Up:
            rotQuat = Quaternion.Euler(-90, 0, 0);
            break;

        case PartDirection.Down:
            rotQuat = Quaternion.Euler(90, 0, 0);
            break;
        }

        float rotationAngle = 0f;

        switch (rotation)
        {
        case PartRotation.Up:
            rotationAngle = 0f;
            break;

        case PartRotation.Right:
            rotationAngle = -90f;
            break;

        case PartRotation.Down:
            rotationAngle = 180;
            break;

        case PartRotation.Left:
            rotationAngle = 90f;
            break;
        }


        Quaternion rotAxis = Quaternion.AngleAxis(rotationAngle, axisForward);



        //float fac = 0.125f * 0.5f;


        PartVerticesHelpMethods.Wheel(verts, rotAxis, rotQuat, amountOfEdgesAtBorder, fullDiameter, innerDiameter, wheelWidth, 0.2f);


        return(verts);
    }
예제 #3
0
    protected override List <Vector3> GenerateVertices(PartDirection direction, PartRotation rotation, int posX, int posY, int posZ)
    {
        List <Vector3> verts = new List <Vector3>();


        //verts.Add(new Vector3(posX, posY, posZ));               // 0
        //verts.Add(new Vector3(posX + 1, posY, posZ));           // 1
        //verts.Add(new Vector3(posX, posY + 1, posZ));           // 2
        //verts.Add(new Vector3(posX + 1, posY + 1, posZ));       // 3
        //
        //verts.Add(new Vector3(posX, posY, posZ + 5));           // 4
        //verts.Add(new Vector3(posX + 1, posY, posZ + 5));       // 5
        //verts.Add(new Vector3(posX, posY + 1, posZ + 5));       // 6
        //verts.Add(new Vector3(posX + 1, posY + 1, posZ + 5));   // 7



        Quaternion rotQuat     = Quaternion.Euler(0, 0, 0);
        Vector3    axisForward = direction.ToVector3();

        switch (direction)
        {
        case PartDirection.North:
            rotQuat = Quaternion.Euler(0, 0, 0);
            break;

        case PartDirection.East:
            rotQuat = Quaternion.Euler(0, 90, 0);
            break;

        case PartDirection.South:
            rotQuat = Quaternion.Euler(0, 180, 0);
            break;

        case PartDirection.West:
            rotQuat = Quaternion.Euler(0, -90, 0);
            break;

        case PartDirection.Up:
            rotQuat = Quaternion.Euler(-90, 0, 0);
            break;

        case PartDirection.Down:
            rotQuat = Quaternion.Euler(90, 0, 0);
            break;
        }

        float rotationAngle = 0f;

        switch (rotation)
        {
        case PartRotation.Up:
            rotationAngle = 0f;
            break;

        case PartRotation.Right:
            rotationAngle = -90f;
            break;

        case PartRotation.Down:
            rotationAngle = 180;
            break;

        case PartRotation.Left:
            rotationAngle = 90f;
            break;
        }


        Quaternion rotAxis = Quaternion.AngleAxis(rotationAngle, axisForward);


        float fac = 0.125f;

        #region The front side

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 9, -2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 9, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, 2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 9, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 9, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 7, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 6, -1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 6, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 6, 1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 6, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 7, 2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 25)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 7)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 6)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 6)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 6)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 6)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 7)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 7)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 9)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 15)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 14)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 14)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 14)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 14)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 9)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 15)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 17)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 23)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 22)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 22)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 22)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 22)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 17)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 23)) * fac));


        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 28)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 28)) * fac));

        #endregion



        #region The back side

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 9, -2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 9, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, 2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 9, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 9, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 7, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 6, -1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 6, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 6, 1)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 6, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 7, 2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 25)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 1)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 7)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 6)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 6)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 6)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 6)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 7)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 7)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 9)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 15)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 14)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 14)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 14)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 10)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 9)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 14)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 15)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 17)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 23)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 22)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 22)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 22)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 18)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 17)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 22)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 23)) * fac));


        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 28)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 25)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 1, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 28)) * fac));

        #endregion



        #region Inner holes

        //Vector2 holePos = new Vector2(0, 0);
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 1, holePos.x - 2)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 1, holePos.x - 2)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 1, holePos.x - 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 2, holePos.x - 1)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 2, holePos.x + 1)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 1, holePos.x + 2)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y + 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y + 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 1, holePos.x + 2)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 1, holePos.x + 2)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 2, holePos.x + 1)) * fac));
        //
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 2, holePos.x + 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(4, holePos.y - 2, holePos.x - 1)) * fac));
        //verts.Add(rotAxis * rotQuat * ((new Vector3(-4, holePos.y - 2, holePos.x - 1)) * fac));

        PartVerticesHelpMethods.InnerHoles(verts, rotAxis, rotQuat, fac, new Vector2(0, 0));
        PartVerticesHelpMethods.InnerHoles(verts, rotAxis, rotQuat, fac, new Vector2(0, 8));
        PartVerticesHelpMethods.InnerHoles(verts, rotAxis, rotQuat, fac, new Vector2(8, 0));
        PartVerticesHelpMethods.InnerHoles(verts, rotAxis, rotQuat, fac, new Vector2(16, 0));
        PartVerticesHelpMethods.InnerHoles(verts, rotAxis, rotQuat, fac, new Vector2(24, 0));

        #endregion



        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, -4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, -2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, 2)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 12, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 12, 2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 10, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 10, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 4)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 4)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 28)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, 2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, 2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 28)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -2, 28)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, 26)) * fac));

        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, 26)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(-4, -4, -2)) * fac));
        verts.Add(rotAxis * rotQuat * ((new Vector3(4, -4, -2)) * fac));



        return(verts);
    }