Ejemplo n.º 1
0
        private void inheritShape(WingProcedural parent)
        {
            if (parent.isCtrlSrf || isCtrlSrf)
                return;

            if (Input.GetMouseButtonUp(0))
                inheritBase(parent);
            sharedBaseThicknessRoot = parent.sharedBaseThicknessTip;

            float tip = sharedBaseWidthRoot + ((parent.sharedBaseWidthTip - parent.sharedBaseWidthRoot) / (parent.sharedBaseLength)) * sharedBaseLength;
            if (sharedBaseWidthTip < 0)
                sharedBaseLength *= sharedBaseWidthRoot  / (sharedBaseWidthRoot - sharedBaseWidthTip);
            //else if (sharedBaseWidthTip > sharedBaseWidthTipLimits.y)
            //    sharedBaseLength *= sharedBaseWidthTipLimits.y / sharedBaseWidthTip;

            float offset = sharedBaseLength / parent.sharedBaseLength * parent.sharedBaseOffsetTip;
            /*
            if (offset > sharedBaseOffsetLimits.y)
                sharedBaseLength *= sharedBaseOffsetLimits.y / offset;
            else if (offset < sharedBaseOffsetLimits.x)
                sharedBaseLength *= sharedBaseOffsetLimits.x / offset;
                */

            //sharedBaseLength = Mathf.Clamp(sharedBaseLength, sharedBaseLengthLimits.x, sharedBaseLengthLimits.y);
            sharedBaseWidthTip =tip;
            sharedBaseOffsetTip = offset;
                //Mathf.Clamp(offset, sharedBaseOffsetLimits.x, sharedBaseOffsetLimits.y);
            sharedBaseThicknessTip = min(sharedBaseThicknessRoot + (float)(sharedBaseLength / parent.sharedBaseLength) * (float)(parent.sharedBaseThicknessTip - parent.sharedBaseThicknessRoot), 0);

            //if (Input.GetMouseButtonUp(0))
                //inheritEdges(parent);
        }
Ejemplo n.º 2
0
        private void inheritEdges(WingProcedural parent)
        {
            if (parent.isCtrlSrf || isCtrlSrf)
                return;

            sharedEdgeTypeLeading = parent.sharedEdgeTypeLeading;
            sharedEdgeWidthLeadingRoot = parent.sharedEdgeWidthLeadingTip;
            sharedEdgeWidthLeadingTip = Mathf.Clamp(sharedEdgeWidthLeadingRoot + ((parent.sharedEdgeWidthLeadingTip - parent.sharedEdgeWidthLeadingRoot) / parent.sharedBaseLength) * sharedBaseLength, sharedEdgeWidthLimits.x, sharedEdgeWidthLimits.y);

            sharedEdgeTypeTrailing = parent.sharedEdgeTypeTrailing;
            sharedEdgeWidthTrailingRoot = parent.sharedEdgeWidthTrailingTip;
            sharedEdgeWidthTrailingTip = Mathf.Clamp(sharedEdgeWidthTrailingRoot + ((parent.sharedEdgeWidthTrailingTip - parent.sharedEdgeWidthTrailingRoot) / parent.sharedBaseLength) * sharedBaseLength, sharedEdgeWidthLimits.x, sharedEdgeWidthLimits.y);
        }
Ejemplo n.º 3
0
        private void inheritColours(WingProcedural parent)
        {
            sharedMaterialST = parent.sharedMaterialST;
            sharedColorSTOpacity = parent.sharedColorSTOpacity;
            sharedColorSTHue = parent.sharedColorSTHue;
            sharedColorSTSaturation = parent.sharedColorSTSaturation;
            sharedColorSTBrightness = parent.sharedColorSTBrightness;

            sharedMaterialSB = parent.sharedMaterialSB;
            sharedColorSBOpacity = parent.sharedColorSBOpacity;
            sharedColorSBHue = parent.sharedColorSBHue;
            sharedColorSBSaturation = parent.sharedColorSBSaturation;
            sharedColorSBBrightness = parent.sharedColorSBBrightness;

            sharedMaterialET = parent.sharedMaterialET;
            sharedColorETOpacity = parent.sharedColorETOpacity;
            sharedColorETHue = parent.sharedColorETHue;
            sharedColorETSaturation = parent.sharedColorETSaturation;
            sharedColorETBrightness = parent.sharedColorETBrightness;

            sharedMaterialEL = parent.sharedMaterialEL;
            sharedColorELOpacity = parent.sharedColorELOpacity;
            sharedColorELHue = parent.sharedColorELHue;
            sharedColorELSaturation = parent.sharedColorELSaturation;
            sharedColorELBrightness = parent.sharedColorELBrightness;
        }
Ejemplo n.º 4
0
        private void inheritCtrlOffset(WingProcedural parent, bool back)
        {
            if(back)
            {
                float trueoffset = (parent.sharedBaseOffsetTip + parent.sharedBaseWidthTip/2 - parent.sharedBaseWidthRoot/2) / parent.sharedBaseLength;
                sharedBaseOffsetRoot = trueoffset;
                sharedBaseOffsetTip = trueoffset;

            }
            else
            {
                float trueoffset = (-parent.sharedBaseOffsetTip + parent.sharedBaseWidthTip/2 - parent.sharedBaseWidthRoot/2) / parent.sharedBaseLength;
                sharedBaseOffsetRoot = trueoffset;
                sharedBaseOffsetTip = trueoffset;
            }
        }
Ejemplo n.º 5
0
        private void inheritBase(WingProcedural parent)
        {
            if (parent.isCtrlSrf || isCtrlSrf)
                return;

            sharedBaseWidthRoot = parent.sharedBaseWidthTip;
            sharedBaseThicknessRoot = parent.sharedBaseThicknessTip;

            sharedEdgeTypeLeading = parent.sharedEdgeTypeLeading;
            sharedEdgeWidthLeadingRoot = parent.sharedEdgeWidthLeadingTip;

            sharedEdgeTypeTrailing = parent.sharedEdgeTypeTrailing;
            sharedEdgeWidthTrailingRoot = parent.sharedEdgeWidthTrailingTip;
        }