private static void RoadJob_DoPrelim(ref GSDRoad tRoad)
        {
            GSDSplineC tSpline = tRoad.GSDSpline;
            //Road,shoulder,ramp and lane widths:
            float RoadWidth = tRoad.RoadWidth();
            float ShoulderWidth = tRoad.opt_ShoulderWidth;
            float RoadSeperation = RoadWidth / 2f;
            float RoadSeperation_NoTurn = RoadWidth / 2f;
            float ShoulderSeperation = RoadSeperation + ShoulderWidth;
            float LaneWidth = tRoad.opt_LaneWidth;
            float RoadSep1Lane = (RoadSeperation + (LaneWidth*0.5f));
            float RoadSep2Lane = (RoadSeperation + (LaneWidth*1.5f));
            float ShoulderSep1Lane = (ShoulderSeperation + (LaneWidth*0.5f));
            float ShoulderSep2Lane = (ShoulderSeperation + (LaneWidth*1.5f));

            //Vector3 buffers used in construction:
            Vector3 rVect = default(Vector3);
            Vector3 lVect = default(Vector3);
            Vector3 ShoulderR_rVect = default(Vector3);
            Vector3 ShoulderR_lVect = default(Vector3);
            Vector3 ShoulderL_rVect = default(Vector3);
            Vector3 ShoulderL_lVect = default(Vector3);
            Vector3 RampR_R = default(Vector3);
            Vector3 RampR_L = default(Vector3);
            Vector3 RampL_R = default(Vector3);
            Vector3 RampL_L = default(Vector3);
            float ShoulderR_OuterAngle = 0f; if(ShoulderR_OuterAngle < 0f){ }
            float ShoulderL_OuterAngle = 0f; if(ShoulderL_OuterAngle < 0f){ }
            //			Vector3 ShoulderR_OuterDirection = default(Vector3);
            //			Vector3 ShoulderL_OuterDirection = default(Vector3);

            //Previous temp storage values:
            Vector3 tVect_Prev = default(Vector3);				if(tVect_Prev == default(Vector3)){ } //Prev step storage of road variable.
            Vector3 rVect_Prev = default(Vector3);				if(rVect_Prev == default(Vector3)){ }//Prev step storage of road variable.
            Vector3 lVect_Prev = default(Vector3);				if(lVect_Prev == default(Vector3)){ }//Prev step storage of road variable.
            Vector3 ShoulderR_PrevLVect = default(Vector3);		if(ShoulderR_PrevLVect == default(Vector3)){ }//Prev step storage of shoulder variable.
            Vector3 ShoulderL_PrevRVect = default(Vector3);		if(ShoulderL_PrevRVect == default(Vector3)){ }//Prev step storage of shoulder variable.
            Vector3 ShoulderR_PrevRVect = default(Vector3);		if(ShoulderR_PrevRVect == default(Vector3)){ }//Prev step storage of shoulder variable.
            Vector3 ShoulderL_PrevLVect = default(Vector3);		if(ShoulderL_PrevLVect == default(Vector3)){ }//Prev step storage of shoulder variable.
            //			Vector3 ShoulderR_PrevRVect2 = default(Vector3);	//Prev storage of shoulder variable (2 step history).
            //			Vector3 ShoulderL_PrevLVect2 = default(Vector3);	//Prev storage of shoulder variable (2 step history).
            //			Vector3 ShoulderR_PrevRVect3 = default(Vector3);	//Prev storage of shoulder variable (3 step history).
            //			Vector3 ShoulderL_PrevLVect3 = default(Vector3);	//Prev storage of shoulder variable (3 step history).
            Vector3 RampR_PrevR = default(Vector3);				if(RampR_PrevR == default(Vector3)){ }//Prev storage of ramp variables (outer shoulder).
            Vector3 RampR_PrevL = default(Vector3);				if(RampR_PrevL == default(Vector3)){ }//Prev storage of ramp variables (outer shoulder).
            Vector3 RampL_PrevR = default(Vector3);				if(RampL_PrevR == default(Vector3)){ }//Prev storage of ramp variables (outer shoulder).
            Vector3 RampL_PrevL = default(Vector3);				if(RampL_PrevL == default(Vector3)){ }//Prev storage of ramp variables (outer shoulder).
            //			Vector3 ShoulderR_OuterDirectionPrev = default(Vector3);	//Prev storage of outer shoulder direction (euler).
            //			Vector3 ShoulderL_OuterDirectionPrev = default(Vector3);	//Prev storage of outer shoulder direction (euler).

            //Height and angle variables, used to change certain parameters of road depending on past & future angle and height changes.
            //			float tAngle = 0f;
            //			float OrigStep = 0.06f;
            float Step = tRoad.opt_RoadDefinition / tSpline.distance;
            //			float AngleStep = 5f;
            Vector3 tHeight0 = new Vector3(0f,0.1f,0f);
            //			Vector3 tHeight2 = new Vector3(0f,0.15f,0f);
            //			Vector3 tHeight1 = new Vector3(0f,0.2f,0f);
            float OuterShoulderWidthR = 0f;
            float OuterShoulderWidthL = 0f;
            float RampOuterWidthR = (OuterShoulderWidthR / 6f) + OuterShoulderWidthR;
            float RampOuterWidthL = (OuterShoulderWidthL / 6f) + OuterShoulderWidthL;
            Vector3 tVect = default(Vector3);
            Vector3 POS = default(Vector3);
            float TempY = 0f;
            //			bool bTempYWasNegative = false;
            //			Vector3 tY = new Vector3(0f,0f,0f);
            float tHeightAdded = 0f;		if(tHeightAdded < 0f){ }
            //			float[] HeightChecks = new float[5];
            Vector3 gHeight = default(Vector3);

            //Bridge variables:
            bool bIsBridge = false;			if(bIsBridge == false){ }
            bool bTempbridge = false;		if(bTempbridge == false){ }
            bool bBridgeInitial = false;	if(bBridgeInitial == false){ }
            bool bBridgeLast = false;		if(bBridgeLast == false){ }
            float BridgeUpComing;
            //			int BridgeLIndex;
            //			int BridgeRIndex;

            //Tunnel variables:
            bool bIsTunnel = false;			if(bIsTunnel == false){ }
            bool bTempTunnel = false;		if(bTempTunnel == false){ }
            bool bTunnelInitial = false; 	if(bTunnelInitial == false){ }
            bool bTunnelLast = false; 		if(bTunnelLast == false){ }
            float TunnelUpComing = 0f;		if(TunnelUpComing < 0f){ }
            //			int TunnelLIndex;
            //			int TunnelRIndex;

            //Intersection variables and buffers:
            float tIntHeight = 0f;			if(tIntHeight < 0f){ }
            float tIntStrength = 0f;		if(tIntStrength < 0f){ }
            float tIntStrength_temp = 0f; 	if(tIntStrength_temp < 0f){ }
            //			float tIntDistCheck = 75f;
            GSDRoadIntersection GSDRI = null;
            bool bIsPastInter = false;
            bool bMaxIntersection = false;
            bool bWasPrevMaxInter = false;
            GSDSplineN xNode = null;
            float tInterSubtract = 4f;
            float tLastInterHeight = -4f;
            bool bOverrideRampR = false;
            bool bOverrideRampL = false;
            Vector3 RampR_Override = default(Vector3);
            Vector3 RampL_Override = default(Vector3);
            bool bFirstInterNode = false;
            bool bInter_PrevWasCorner = false; if(bInter_PrevWasCorner == false){ }
            bool bInter_CurreIsCorner = false;
            bool bInter_CurreIsCornerRR = false;
            bool bInter_CurreIsCornerRL = false;
            bool bInter_CurreIsCornerLL = false;
            bool bInter_CurreIsCornerLR = false;
            bool bInter_PrevWasCornerRR = false;
            bool bInter_PrevWasCornerRL = false;
            bool bInter_PrevWasCornerLL = false;
            bool bInter_PrevWasCornerLR = false;
            Vector3 iTemp_HeightVect = default(Vector3);
            Vector3 rVect_iTemp = default(Vector3);
            Vector3 lVect_iTemp = default(Vector3);
            Vector3 ShoulderR_R_iTemp = default(Vector3);
            Vector3 ShoulderL_L_iTemp = default(Vector3);
            Vector3 RampR_R_iTemp = default(Vector3);
            Vector3 RampR_L_iTemp = default(Vector3);
            Vector3 RampL_R_iTemp = default(Vector3);
            Vector3 RampL_L_iTemp = default(Vector3);
            Vector3 tempIVect_Prev = default(Vector3);
            Vector3 tempIVect = tVect;
            bool b0LAdded = false; if(b0LAdded == false){ }
            bool b1LAdded = false; if(b1LAdded == false){ }
            bool b2LAdded = false; if(b2LAdded == false){ }
            bool b3LAdded = false; if(b3LAdded == false){ }
            bool f0LAdded = false; if(f0LAdded == false){ }
            bool f1LAdded = false; if(f1LAdded == false){ }
            bool f2LAdded = false; if(f2LAdded == false){ }
            bool f3LAdded = false; if(f3LAdded == false){ }
            bool b0RAdded = false; if(b0RAdded == false){ }
            bool b1RAdded = false; if(b1RAdded == false){ }
            bool b2RAdded = false; if(b2RAdded == false){ }
            bool b3RAdded = false; if(b3RAdded == false){ }
            bool f0RAdded = false; if(f0RAdded == false){ }
            bool f1RAdded = false; if(f1RAdded == false){ }
            bool f2RAdded = false; if(f2RAdded == false){ }
            bool f3RAdded = false; if(f3RAdded == false){ }
            bool bInterTestAddAfterR = false; if(bInterTestAddAfterR == false){ }
            bool bInterTestAddAfterL = false; if(bInterTestAddAfterL == false){ }
            //			Vector3 InterTestVect1 = default(Vector3);
            //			Vector3 InterTestVect2 = default(Vector3);
            //			Vector3 InterTestVect3 = default(Vector3);
            //			Vector3 InterTestVect4 = default(Vector3);
            bool bShoulderSkipR = false;
            bool bShoulderSkipL = false;
            bool bShrinkRoadB = false;
            bool bShrinkRoadFNext = false;
            bool bShrinkRoadF = false;
            bool bIsNextInter = false;
            GSDSplineN cNode = null;
            int NodeID = -1;
            int NodeIDPrev = -1;
            int NodeCount = tSpline.GetNodeCount();
            bool bDynamicCut = false;
            float CullDistanceSQ = (3f * RoadWidth) * (3f * RoadWidth);
            float mCornerDist = 0f;
            Vector2 CornerRR = default(Vector2);		if(CornerRR == default(Vector2)){ }
            Vector2 CornerRL = default(Vector2);		if(CornerRL == default(Vector2)){ }
            Vector2 CornerLR = default(Vector2);		if(CornerLR == default(Vector2)){ }
            Vector2 CornerLL = default(Vector2);		if(CornerLL == default(Vector2)){ }
            Vector2 rVect2D = default(Vector2);			if(rVect2D == default(Vector2)){ }
            Vector2 lVect2D = default(Vector2);			if(lVect2D == default(Vector2)){ }
            Vector3 tempIVect_prev = default(Vector3);	if(tempIVect_prev == default(Vector3)){ }
            Vector3 POS_Next = default(Vector3);		if(POS_Next == default(Vector3)){ }
            Vector3 tVect_Next = default(Vector3);		if(tVect_Next == default(Vector3)){ }
            Vector3 rVect_Next = default(Vector3);		if(rVect_Next == default(Vector3)){ }
            Vector3 lVect_Next = default(Vector3);		if(lVect_Next == default(Vector3)){ }
            Vector3 xHeight = default(Vector3); 		if(xHeight == default(Vector3)){ }
            bool bLRtoRR = false;
            bool bLLtoLR = false;
            bool bLine = false;
            bool bImmuneR = false;
            bool bImmuneL = false;
            bool bSpecAddedL = false; if(bSpecAddedL == false){ }
            bool bSpecAddedR = false; if(bSpecAddedR == false){ }
            bool bTriggerInterAddition = false;
            bool bSpecialThreeWayIgnoreR = false;
            bool bSpecialThreeWayIgnoreL = false;
            //			int eCount = -1;
            //			int eIndex = -1;
            //			int uCount = -1;
            //			int uIndex = -1;
            float bMod1 = 1.75f;
            float bMod2 = 1.25f;
            float t2DDist = -1f;
            List<Vector3> vList = null;
            List<int> eList = null;
            float tParam2 = 0f;
            float tParam1 = 0f;
            bool bRecordShoulderForNormals = false;
            bool bRecordShoulderLForNormals = false;

            //Unused for now, for later partial construction methods:
            bool bInterseOn = tRoad.RCS.bInterseOn;
            //			bool bBridgesOn = tRoad.RCS.bBridgesOn;
            //			if(tRoad.RCS.bRoadOn){
                bInterseOn = true;
            //			}

            //Prelim intersection construction and profiling:
            if(tRoad.bProfiling){ Profiler.BeginSample("RoadJob_Prelim_Inter"); }
            if(bInterseOn){
                RoadJob_Prelim_Inter(ref tRoad);
            }

            if(tRoad.bProfiling){ Profiler.EndSample(); }

            if(tRoad.bProfiling){ Profiler.BeginSample("RoadPrelimForLoop"); }

            //Road/shoulder cuts: Init necessary since a road cut is added for the last segment after this function:
            if(tRoad.opt_bRoadCuts || tRoad.opt_bDynamicCuts){
                tRoad.RCS.RoadCutNodes.Add(tSpline.mNodes[0]);
            }
            if(tRoad.opt_bShoulderCuts || tRoad.opt_bDynamicCuts){
                tRoad.RCS.ShoulderCutsLNodes.Add(tSpline.mNodes[0]);
                tRoad.RCS.ShoulderCutsRNodes.Add(tSpline.mNodes[0]);
            }

            //Start initializing the loop. Convuluted to handle special control nodes, so roads don't get rendered where they aren't supposed to, while still preserving the proper curvature.
            float FinalMax = 1f;
            float StartMin = 0f;
            if(tSpline.bSpecialEndControlNode){	//If control node, start after the control node:
                FinalMax = tSpline.mNodes[tSpline.GetNodeCount()-2].tTime;
            }
            if(tSpline.bSpecialStartControlNode){	//If ends in control node, end construction before the control node:
                StartMin = tSpline.mNodes[1].tTime;
            }
            bool bFinalEnd = false;
            float RoadConnection_StartMin1 = StartMin;	//Storage of incremental start values for the road connection mesh construction at the end of this function.
            float RoadConnection_FinalMax1 = FinalMax; 	//Storage of incremental end values for the road connection mesh construction at the end of this function.
            if(tSpline.bSpecialEndNode_IsStart_Delay){
                StartMin += (tSpline.SpecialEndNodeDelay_Start / tSpline.distance);	//If there's a start delay (in meters), delay the start of road construction: Due to special control nodes for road connections or 3 way intersections.
            }else if(tSpline.bSpecialEndNode_IsEnd_Delay){
                FinalMax -= (tSpline.SpecialEndNodeDelay_End / tSpline.distance);	//If there's a end delay (in meters), cut early the end of road construction: Due to special control nodes for road connections or 3 way intersections.
            }
            //			float RoadConnection_StartMin2 = StartMin;	//Storage of incremental start values for the road connection mesh construction at the end of this function.
            //			float RoadConnection_FinalMax2 = FinalMax; 	//Storage of incremental end values for the road connection mesh construction at the end of this function.
            float i=StartMin;

            //			int StartIndex = tSpline.GetClosestRoadDefIndex(StartMin,true,false);
            //			int EndIndex = tSpline.GetClosestRoadDefIndex(FinalMax,false,true);
            //			float cDist = 0f;
            bool kSkip = true;
            bool kSkipFinal = false;
            int kCount = 0;
            int vCount = kCount;
            int kFinalCount = tSpline.RoadDefKeysArray.Length;
            int spamcheckmax1 = 18000;
            int spamcheck1 = 0;

            if(IsApproximately(StartMin,0f,0.0001f)){
                kSkip = false;
            }
            if(IsApproximately(FinalMax,1f,0.0001f)){
                kSkipFinal = true;
            }

            //If startmin > 0 then kcount needs to start at proper road def
            //			bool bStartMinEnabled = false;
            int StartMinIndex1 = 0;

            if(StartMin > 0f){
                kCount = tSpline.GetClosestRoadDefIndex(StartMin,true,false);
            //				bStartMinEnabled = true;
                StartMinIndex1 = 1;
            }

            while(!bFinalEnd && spamcheck1 < spamcheckmax1){
                spamcheck1++;

                if(kSkip){
                    i = StartMin;
                    kSkip = false;
                }else{
                    if(kCount >= kFinalCount){
                        i = FinalMax;
                        if(kSkipFinal){ break; }
                    }else{
                        i = tSpline.TranslateInverseParamToFloat(tSpline.RoadDefKeysArray[kCount]);
                        kCount+=1;
                    }
                }

                if(i > 1f){
                    break;
                }
                if(i < 0f){
                    i = 0f;
                }

                if(IsApproximately(i,FinalMax,0.00001f)){
                    bFinalEnd = true;
                }else if(i > FinalMax){
                    if(tSpline.bSpecialEndControlNode){
                        i = FinalMax;
                        bFinalEnd = true;
                    }else{
                        bFinalEnd = true;
                        break;
                    }
                }
                cNode = tSpline.GetCurrentNode(i);	//Set the current node.
                NodeID = cNode.idOnSpline;			//Set the current node ID.
                if(NodeID != NodeIDPrev && (tRoad.opt_bRoadCuts || tRoad.opt_bDynamicCuts)){	//If different than the previous node id, time to make a cut, if necessary:
                    //Don't ever cut the first node, last node, intersection node, special control nodes, bridge nodes or bridge control nodes:
                    if(NodeID > StartMinIndex1 && NodeID < (NodeCount-1) && !cNode.bIsIntersection && !cNode.bSpecialEndNode){ // && !cNode.bIsBridge_PreNode && !cNode.bIsBridge_PostNode){
                        if(tRoad.opt_bDynamicCuts){
                            bDynamicCut = cNode.bRoadCut;
                        }else{
                            bDynamicCut = true;
                        }

                        if(bDynamicCut){
                            tRoad.RCS.RoadCuts.Add(tRoad.RCS.RoadVectors.Count);			//Add the vector index to cut later.
                            tRoad.RCS.RoadCutNodes.Add(cNode);								//Store the node which was at the beginning of this cut.
                        }
                        if(tRoad.opt_bShoulderCuts && bDynamicCut){	//If option shoulder cuts is on.
                            tRoad.RCS.ShoulderCutsL.Add(tRoad.RCS.ShoulderL_Vectors.Count);	//Add the vector index to cut later.
                            tRoad.RCS.ShoulderCutsLNodes.Add(cNode);						//Store the node which was at the beginning of this cut.
                            tRoad.RCS.ShoulderCutsR.Add(tRoad.RCS.ShoulderR_Vectors.Count);	//Add the vector index to cut later.
                            tRoad.RCS.ShoulderCutsRNodes.Add(cNode);						//Store the node which was at the beginning of this cut.
                        }
                    }
                }
                if(NodeID != NodeIDPrev){
                    if(tRoad.RCS.RoadVectors.Count > 0){
                        cNode.bInitialRoadHeight = tRoad.RCS.RoadVectors[tRoad.RCS.RoadVectors.Count-1].y;
                    }
                }
                NodeIDPrev = NodeID;				//Store the previous node ID for the next round. Done now with road cuts as far as this function is concerned.

                //Set all necessary intersection triggers to false:
                bInter_CurreIsCorner = false;
                bInter_CurreIsCornerRR = false;
                bInter_CurreIsCornerRL = false;
                bInter_CurreIsCornerLL = false;
                bInter_CurreIsCornerLR = false;
                b0LAdded = false;
                b1LAdded = false;
                b2LAdded = false;
                b3LAdded = false;
                f0LAdded = false;
                f1LAdded = false;
                f2LAdded = false;
                f3LAdded = false;
                b0RAdded = false;
                b1RAdded = false;
                b2RAdded = false;
                b3RAdded = false;
                f0RAdded = false;
                f1RAdded = false;
                f2RAdded = false;
                f3RAdded = false;
                bInterTestAddAfterR=false;
                bInterTestAddAfterL=false;
                bShoulderSkipR = false;
                bShoulderSkipL = false;
                bShrinkRoadB = false;
                bShrinkRoadF = false;
                bIsNextInter = false;
                if(bShrinkRoadFNext){
                    bShrinkRoadFNext = false;
                    bShrinkRoadF = true;
                }
                bRecordShoulderForNormals = false;
                bRecordShoulderLForNormals = false;

                //Bridges: Note: This is convoluted due to need for triggers:
                bBridgeInitial = false;
                bBridgeLast = false;
                bTempbridge = tSpline.IsInBridge(i);
                if(!bIsBridge && bTempbridge){
                    bIsBridge = true;
                    bBridgeInitial = true;
                }else if(bIsBridge && !bTempbridge){
                    bIsBridge = false;
                }
                //Check if this is the last bridge run for this bridge:
                if(bIsBridge){
                    bTempbridge = tSpline.IsInBridge(i+Step);
                    if(!bTempbridge){
                        bBridgeLast = true;
                    }
                }

                //Tunnels: Note: This is convoluted due to need for triggers:
                bTunnelInitial = false;
                bTunnelLast = false;
                bTempTunnel = tSpline.IsInTunnel(i);
                if(!bIsTunnel && bTempTunnel){
                    bIsTunnel = true;
                    bTunnelInitial = true;
                }else if(bIsTunnel && !bTempTunnel){
                    bIsTunnel = false;
                }
                //Check if this is the last Tunnel run for this Tunnel:
                if(bIsTunnel){
                    bTempTunnel = tSpline.IsInTunnel(i+Step);
                    if(!bTempTunnel){
                        bTunnelLast = true;
                    }
                }

                //Master Vector3 for the current road construction location:
                tSpline.GetSplineValue_Both(i,out tVect,out POS);

            //				Profiler.EndSample();
            //				Profiler.BeginSample("Test2");

                //Detect downward or upward slope:
                TempY = POS.y;
            //				bTempYWasNegative = false;
                if(TempY < 0f){
            //					bTempYWasNegative = true;
                    TempY *= -1f;
                }
                if(tVect.y < 0f){
                    tVect.y = 0f;
                }

                //Determine if intersection:
                if(bInterseOn){
                    bIsPastInter = false;	//If past intersection
                    tIntStrength = tRoad.GSDSpline.IntersectionStrength(ref tVect,ref tIntHeight, ref GSDRI, ref bIsPastInter, ref i, ref xNode);
                    bMaxIntersection = (tIntStrength >= 1f);	//1f strength = max intersection
                    bFirstInterNode = false;
                }

                //Outer widths:
                if(bMaxIntersection && bInterseOn){
                    GSDRI.SignHeight = tIntHeight;
                    xNode.iConstruction.bBLane0Done_Final_ThisRound = false;
                    xNode.iConstruction.bBLane1Done_Final_ThisRound = false;
                    xNode.iConstruction.bBLane2Done_Final_ThisRound = false;
                    xNode.iConstruction.bBLane3Done_Final_ThisRound = false;
                    xNode.iConstruction.bFLane0Done_Final_ThisRound = false;
                    xNode.iConstruction.bFLane1Done_Final_ThisRound = false;
                    xNode.iConstruction.bFLane2Done_Final_ThisRound = false;
                    xNode.iConstruction.bFLane3Done_Final_ThisRound = false;
                    xNode.iConstruction.bIsFrontFirstRound = false;

                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                        OuterShoulderWidthR = ShoulderSeperation;
                        OuterShoulderWidthL = ShoulderSeperation;
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                        OuterShoulderWidthR = ShoulderSep1Lane;
                        OuterShoulderWidthL = ShoulderSep1Lane;
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                        if(bIsPastInter){
                            OuterShoulderWidthR = ShoulderSep1Lane;
                            OuterShoulderWidthL = ShoulderSep2Lane;
                        }else{
                            OuterShoulderWidthR = ShoulderSep2Lane;
                            OuterShoulderWidthL = ShoulderSep1Lane;
                        }
                    }
                }else{
                    if(TempY < 0.5f || bIsBridge || bIsTunnel){
                        OuterShoulderWidthR = ShoulderSeperation;
                        OuterShoulderWidthL = ShoulderSeperation;
                    }else{
                        OuterShoulderWidthR = ShoulderSeperation + (TempY*0.05f);
                        OuterShoulderWidthL = ShoulderSeperation + (TempY*0.05f);
                    }
                }

                if(bIsBridge){ //No ramps for bridges:
                    RampOuterWidthR = OuterShoulderWidthR;
                    RampOuterWidthL = OuterShoulderWidthL;
                }else{
                    RampOuterWidthR = (OuterShoulderWidthR / 4f) + OuterShoulderWidthR;
                    RampOuterWidthL = (OuterShoulderWidthL / 4f) + OuterShoulderWidthL;
                }

                //The master outer road edges vector locations:
                if(bMaxIntersection && bInterseOn){	//If in maximum intersection, adjust road edge (also the shoulder inner edges):
                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                        rVect = (tVect + new Vector3(RoadSeperation_NoTurn*POS.normalized.z,0,RoadSeperation_NoTurn*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSeperation_NoTurn*-POS.normalized.z,0,RoadSeperation_NoTurn*POS.normalized.x));
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                        rVect = (tVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                        if(bIsPastInter){
                            rVect = (tVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                            lVect = (tVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));;
                        }else{
                            rVect = (tVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                            lVect = (tVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                        }
                    }else{
                        rVect = (tVect + new Vector3(RoadSeperation*POS.normalized.z,0,RoadSeperation*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSeperation*-POS.normalized.z,0,RoadSeperation*POS.normalized.x));
                    }
                }else{
                    //Typical road/shoulder inner edge location:
                    rVect = (tVect + new Vector3(RoadSeperation*POS.normalized.z,0,RoadSeperation*-POS.normalized.x));
                    lVect = (tVect + new Vector3(RoadSeperation*-POS.normalized.z,0,RoadSeperation*POS.normalized.x));
                }

                //Shoulder right vectors:
                ShoulderR_rVect = (tVect + new Vector3(OuterShoulderWidthR*POS.normalized.z,0,OuterShoulderWidthR*-POS.normalized.x));
                ShoulderR_lVect = rVect;	//Note that the shoulder inner edge is the same as the road edge vector.
                //Shoulder left vectors:
                ShoulderL_rVect = lVect;	//Note that the shoulder inner edge is the same as the road edge vector.
                ShoulderL_lVect = (tVect + new Vector3(OuterShoulderWidthL*-POS.normalized.z,0,OuterShoulderWidthL*POS.normalized.x));

            //				Profiler.EndSample();
            //				Profiler.BeginSample("Test3");

                //Now to start the main lane construction for the intersection:
                if(bMaxIntersection && bInterseOn){
            //					if(kCount >= tSpline.RoadDefKeysArray.Length){
            //						vCount = tSpline.RoadDefKeysArray.Length-1;
            //					}else{
            //						vCount = kCount-1;
            //					}
                    vCount = kCount;

                    tParam2 = tSpline.TranslateInverseParamToFloat(tSpline.RoadDefKeysArray[vCount]);
                    float tInterStrNext = tRoad.GSDSpline.IntersectionStrength_Next(tSpline.GetSplineValue(tParam2,false));
                    if(IsApproximately(tInterStrNext,1f,0.001f) || tInterStrNext > 1f){
                        bIsNextInter = true;
                    }else{
                        bIsNextInter = false;
                    }

                    if(string.Compare(xNode.UID,GSDRI.Node1.UID) == 0){
                        bFirstInterNode = true;
                    }else{
                        bFirstInterNode = false;
                    }

                    tempIVect = tVect;
                    if(bIsPastInter){
                        bool bLLtoRL = bFirstInterNode;
                        bool bRLtoRR = !bFirstInterNode;
                        if(xNode.iConstruction.iFLane0L.Count == 0){
                            xNode.iConstruction.bIsFrontFirstRound = true;
                            xNode.iConstruction.bIsFrontFirstRoundTriggered = true;
                            xNode.iConstruction.bFLane0Done_Final_ThisRound = true;
                            xNode.iConstruction.bFLane1Done_Final_ThisRound = true;
                            xNode.iConstruction.bFLane2Done_Final_ThisRound = true;
                            xNode.iConstruction.bFLane3Done_Final_ThisRound = true;

                            if(GSDRI.bFlipped && !bFirstInterNode){
                                if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                    xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerLR[0],tIntHeight));
                                    xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerLR[2],tIntHeight));
                                    xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerLL_CornerLR[2],tIntHeight));
                                    xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerLL_CornerLR[3],tIntHeight));
                                    xNode.iConstruction.iFLane3L.Add(GVC(GSDRI.fCornerLL_CornerLR[3],tIntHeight));
                                    xNode.iConstruction.iFLane3R.Add(GVC(GSDRI.fCornerLL_CornerLR[4],tIntHeight));
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                    xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerLR[0],tIntHeight));
                                    xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerLR[2],tIntHeight));
                                    xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerLL_CornerLR[2],tIntHeight));
                                    xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerLL_CornerLR[3],tIntHeight));
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                    xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerLR[0],tIntHeight));
                                    xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerLR[1],tIntHeight));
                                    xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerLR[2],tIntHeight));
                                }
                            }else{
                                if(bLLtoRL){
                                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerRL[4],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerRL[3],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerRL[3],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerRL[2],tIntHeight));
                                        xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerLL_CornerRL[2],tIntHeight));
                                        xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane3L.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane3R.Add(GVC(GSDRI.fCornerLL_CornerRL[0],tIntHeight));
                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerRL[3],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerRL[2],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerRL[2],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerLL_CornerRL[0],tIntHeight));
                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerLL_CornerRL[2],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerLL_CornerRL[1],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerLL_CornerRL[0],tIntHeight));
                                    }
                                }else if(bRLtoRR){
                                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerRL_CornerRR[4],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerRL_CornerRR[3],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerRL_CornerRR[3],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerRL_CornerRR[2],tIntHeight));
                                        xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerRL_CornerRR[2],tIntHeight));
                                        xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane3L.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane3R.Add(GVC(GSDRI.fCornerRL_CornerRR[0],tIntHeight));
                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerRL_CornerRR[3],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerRL_CornerRR[2],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerRL_CornerRR[2],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane2L.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane2R.Add(GVC(GSDRI.fCornerRL_CornerRR[0],tIntHeight));
                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                        xNode.iConstruction.iFLane0L.Add(GVC(GSDRI.fCornerRL_CornerRR[2],tIntHeight));
                                        xNode.iConstruction.iFLane0R.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane1L.Add(GVC(GSDRI.fCornerRL_CornerRR[1],tIntHeight));
                                        xNode.iConstruction.iFLane1R.Add(GVC(GSDRI.fCornerRL_CornerRR[0],tIntHeight));
                                    }
                                }
                            }

                            xNode.iConstruction.ShoulderFR_End = xNode.iConstruction.iFLane0L[0];
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                xNode.iConstruction.ShoulderFL_End = xNode.iConstruction.iFLane3R[0];
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                xNode.iConstruction.ShoulderFL_End = xNode.iConstruction.iFLane2R[0];
                            }else{
                                xNode.iConstruction.ShoulderFL_End = xNode.iConstruction.iFLane1R[0];
                            }
                            xNode.iConstruction.ShoulderFL_StartIndex = tRoad.RCS.ShoulderL_Vectors.Count-2;
                            xNode.iConstruction.ShoulderFR_StartIndex = tRoad.RCS.ShoulderR_Vectors.Count-2;
                        }

                        //Line 0:
                        xNode.iConstruction.f0LAttempt = rVect;
                        if(!xNode.iConstruction.bFLane0Done && !GSDRI.Contains(ref rVect)){
                            xNode.iConstruction.iFLane0L.Add(GVC(rVect,tIntHeight)); f0LAdded = true;
                        }

                        //Line 1:
                    //	if(f0LAdded){
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            tempIVect = tVect;
                            if(!xNode.iConstruction.bFLane1Done && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(tempIVect,rVect)){
                                if(f0LAdded){ xNode.iConstruction.iFLane0R.Add(GVC(tempIVect,tIntHeight)); f0RAdded = true; }
                                xNode.iConstruction.iFLane1L.Add(GVC(tempIVect,tIntHeight)); f1LAdded = true;
                            }else{
                                if(f0LAdded){ xNode.iConstruction.iFLane0L.RemoveAt(xNode.iConstruction.iFLane0L.Count-1); f0LAdded = false; }
                            }
                        }else{
                            tempIVect = (tVect + new Vector3((LaneWidth*0.5f)*POS.normalized.z,0f,(LaneWidth*0.5f)*-POS.normalized.x));
                            if(!xNode.iConstruction.bFLane1Done && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(tempIVect,rVect)){
                                if(f0LAdded){ xNode.iConstruction.iFLane0R.Add(GVC(tempIVect,tIntHeight));f0RAdded = true; }
                                xNode.iConstruction.iFLane1L.Add(GVC(tempIVect,tIntHeight)); f1LAdded = true;
                            }else{
                                if(f0LAdded){ xNode.iConstruction.iFLane0L.RemoveAt(xNode.iConstruction.iFLane0L.Count-1); f0LAdded = false; }
                            }
                        }
                        //}
                        xNode.iConstruction.f0RAttempt = tempIVect;
                        xNode.iConstruction.f1LAttempt = tempIVect;

                        //Line 2:
                        //if(f1LAdded){
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            tempIVect = lVect;
                            if(!xNode.iConstruction.bFLane2Done && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(tempIVect,rVect)){
                                if(f1LAdded){ xNode.iConstruction.iFLane1R.Add(GVC(tempIVect,tIntHeight)); f1RAdded = true; }
                            }else{
                                if(f1LAdded && xNode.iConstruction.iFLane1L.Count > 1){ xNode.iConstruction.iFLane1L.RemoveAt(xNode.iConstruction.iFLane1L.Count-1); f1LAdded = false; }
                            }
                        }else{
                            tempIVect = (tVect + new Vector3((LaneWidth*0.5f)*-POS.normalized.z,0f,(LaneWidth*0.5f)*POS.normalized.x));
                            tempIVect_prev = tempIVect;
                            if(!xNode.iConstruction.bFLane2Done && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(tempIVect,rVect)){
                                if(f1LAdded){ xNode.iConstruction.iFLane1R.Add(GVC(tempIVect,tIntHeight)); f1RAdded = true; }
                                xNode.iConstruction.iFLane2L.Add(GVC(tempIVect,tIntHeight)); f2LAdded = true;
                            }else{
                                if(f1LAdded){ xNode.iConstruction.iFLane1L.RemoveAt(xNode.iConstruction.iFLane1L.Count-1); f1LAdded = false; f1RAdded=false; }
                            }
                        }
                        //}
                        xNode.iConstruction.f1RAttempt = tempIVect;
                        xNode.iConstruction.f2LAttempt = tempIVect;

                        //Line 3 / 4:
                        //if(f2LAdded){

                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            tempIVect = (tVect + new Vector3(((LaneWidth*0.5f)+RoadSeperation)*-POS.normalized.z,0,((LaneWidth*0.5f)+RoadSeperation)*POS.normalized.x));
                            if(!xNode.iConstruction.bFLane3Done && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(lVect,tempIVect)){

                                xNode.iConstruction.iFLane3L.Add(GVC(tempIVect,tIntHeight));  f3LAdded = true;
                                xNode.iConstruction.iFLane3R.Add(GVC(lVect,tIntHeight)); f3RAdded = true;
            //								if(bIsNextInter && GSDRI.iType == GSDRoadIntersection.IntersectionTypeEnum.FourWay){
                                    if(f2LAdded){ xNode.iConstruction.iFLane2R.Add(GVC(tempIVect,tIntHeight)); f2RAdded = true; }
            //								}
                            }else{
                                if(f2LAdded){
                                    xNode.iConstruction.iFLane2L.RemoveAt(xNode.iConstruction.iFLane2L.Count-1); f2LAdded = false;
                                }
                            }

                        }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                            tempIVect = (tVect + new Vector3(((LaneWidth*0.5f)+RoadSeperation)*-POS.normalized.z,0,((LaneWidth*0.5f)+RoadSeperation)*POS.normalized.x));
                            if(f2LAdded && !GSDRI.Contains(ref tempIVect) && !GSDRI.ContainsLine(rVect,tempIVect)){
                                xNode.iConstruction.iFLane2R.Add(GVC(tempIVect,tIntHeight)); f2RAdded = true;
                            }else if(f2LAdded){
                                xNode.iConstruction.iFLane2L.RemoveAt(xNode.iConstruction.iFLane2L.Count-1);  f2LAdded = false;
                            }
                        }

                    //	}
                        xNode.iConstruction.f2RAttempt = tempIVect;
                        xNode.iConstruction.f3LAttempt = tempIVect;
                        xNode.iConstruction.f3RAttempt = lVect;

                        if(!bIsNextInter && !xNode.iConstruction.bFDone){
            //							xNode.iConstruction.bFDone = true;
                            xNode.iConstruction.bFLane0Done = true;
                            xNode.iConstruction.bFLane1Done = true;
                            xNode.iConstruction.bFLane2Done = true;
                            xNode.iConstruction.bFLane3Done = true;

                            POS_Next = default(Vector3);
                            tVect_Next = default(Vector3);

                            tParam1 = tSpline.TranslateInverseParamToFloat(tSpline.RoadDefKeysArray[kCount]);
                            tSpline.GetSplineValue_Both(tParam1,out tVect_Next,out POS_Next);
                            rVect_Next = (tVect_Next + new Vector3(RoadSeperation*POS_Next.normalized.z,0,RoadSeperation*-POS_Next.normalized.x));
                            lVect_Next = (tVect_Next + new Vector3(RoadSeperation*-POS_Next.normalized.z,0,RoadSeperation*POS_Next.normalized.x));

                            xNode.iConstruction.iFLane0L.Add(GVC(rVect_Next,tIntHeight));
                            xNode.iConstruction.iFLane0R.Add(GVC(tVect_Next,tIntHeight));
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                xNode.iConstruction.iFLane1L.Add(GVC(tVect_Next,tIntHeight));
                                if(tRoad.opt_Lanes == 2){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.475f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 4){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.488f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 6){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.492f)+lVect_Next,tIntHeight));
                                }

                                if(tRoad.opt_Lanes == 2){
                                    xNode.iConstruction.iFLane3L.Add(GVC(((rVect_Next-lVect_Next)*0.03f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 4){
                                    xNode.iConstruction.iFLane3L.Add(GVC(((rVect_Next-lVect_Next)*0.015f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 6){
                                    xNode.iConstruction.iFLane3L.Add(GVC(((rVect_Next-lVect_Next)*0.01f)+lVect_Next,tIntHeight));
                                }

                                xNode.iConstruction.iFLane3R.Add(GVC(lVect_Next,tIntHeight));
            //								xNode.iConstruction.iFLane2L.Add(GVC(tVect_Next,tIntHeight));
            //								xNode.iConstruction.iFLane2R.Add(GVC(lVect_Next,tIntHeight));

                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                xNode.iConstruction.iFLane1L.Add(GVC(tVect_Next,tIntHeight));
                                if(tRoad.opt_Lanes == 2){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.475f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 4){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.488f)+lVect_Next,tIntHeight));
                                }else if(tRoad.opt_Lanes == 6){
                                    xNode.iConstruction.iFLane1R.Add(GVC(((rVect_Next-lVect_Next)*0.492f)+lVect_Next,tIntHeight));
                                }
                                xNode.iConstruction.iFLane2L.Add(GVC(tVect_Next,tIntHeight));
                                xNode.iConstruction.iFLane2R.Add(GVC(lVect_Next,tIntHeight));

                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                xNode.iConstruction.iFLane1L.Add(GVC(tVect_Next,tIntHeight));
                                xNode.iConstruction.iFLane1R.Add(GVC(lVect_Next,tIntHeight));
                            }
                            bShrinkRoadFNext = true;
            //							bShrinkRoadF = true;
                        }

                    }else{
                        bLRtoRR = bFirstInterNode;
                        bLLtoLR = !bFirstInterNode;
                        //B:
                        //Line 0:
                        tempIVect = lVect;
                        bool bFirst123 = false;
                        if(xNode.iConstruction.iBLane0R.Count == 0){
                            xNode.iConstruction.iBLane0L.Add(lVect_Prev);
                            xNode.iConstruction.iBLane0R.Add(tVect_Prev);
                            bShrinkRoadB = true;

                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                xNode.iConstruction.iBLane1L.Add(tVect_Prev);
                                xNode.iConstruction.iBLane1R.Add((tVect_Prev + new Vector3((LaneWidth*0.05f)*POS.normalized.z,0,(LaneWidth*0.05f)*-POS.normalized.x)));
                                xNode.iConstruction.iBLane3L.Add(((lVect_Prev-rVect_Prev)*0.03f)+rVect_Prev);
                                xNode.iConstruction.iBLane3R.Add(rVect_Prev);

                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                xNode.iConstruction.iBLane1L.Add(tVect_Prev);
                                xNode.iConstruction.iBLane1R.Add((tVect_Prev + new Vector3((LaneWidth*0.05f)*POS.normalized.z,0,(LaneWidth*0.05f)*-POS.normalized.x)));
                                xNode.iConstruction.iBLane2L.Add(xNode.iConstruction.iBLane1R[0]);
                                xNode.iConstruction.iBLane2R.Add(rVect_Prev);

                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                xNode.iConstruction.iBLane1L.Add(tVect_Prev);
                                xNode.iConstruction.iBLane1R.Add(rVect_Prev);
                            }

                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                xNode.iConstruction.ShoulderBL_Start = xNode.iConstruction.iBLane0L[0];
                                xNode.iConstruction.ShoulderBR_Start = xNode.iConstruction.iBLane3R[0];
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                xNode.iConstruction.ShoulderBL_Start = xNode.iConstruction.iBLane0L[0];
                                xNode.iConstruction.ShoulderBR_Start = xNode.iConstruction.iBLane2R[0];
                            }else{
                                xNode.iConstruction.ShoulderBL_Start = xNode.iConstruction.iBLane0L[0];
                                xNode.iConstruction.ShoulderBR_Start = xNode.iConstruction.iBLane1R[0];
                            }

                            xNode.iConstruction.ShoulderBL_StartIndex = tRoad.RCS.ShoulderL_Vectors.Count-2;
                            xNode.iConstruction.ShoulderBR_StartIndex = tRoad.RCS.ShoulderR_Vectors.Count-2;
            //							bFirst123 = true;
            //							goto InterSkip;
                        }

                        bLine = false;
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            bLine = !GSDRI.ContainsLine(tempIVect,(tVect + new Vector3((LaneWidth*0.5f)*-POS.normalized.z,0,(LaneWidth*0.5f)*POS.normalized.x)));
                        }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                            bLine = !GSDRI.ContainsLine(tempIVect,(tVect + new Vector3((LaneWidth*0.5f)*-POS.normalized.z,0,(LaneWidth*0.5f)*POS.normalized.x)));
                        }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            bLine = !GSDRI.ContainsLine(lVect,tVect);
                        }
                        if(!xNode.iConstruction.bBLane0Done && !GSDRI.Contains(ref tempIVect) && bLine){
                            xNode.iConstruction.iBLane0L.Add(GVC(tempIVect,tIntHeight)); b0LAdded = true;
                        }else if(!xNode.iConstruction.bBLane0Done_Final){
                            //Finalize lane 0:
                            InterFinalizeiBLane0(ref xNode, ref GSDRI, ref tIntHeight, bLRtoRR, bLLtoLR,bFirstInterNode);
                        }

                        //Line 1:
                        if(xNode.GSDRI.rType != GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            if(xNode.iConstruction.iBLane0L.Count == 2){
                                tempIVect = (tVect + new Vector3((LaneWidth*0.5f)*-POS.normalized.z,0,(LaneWidth*0.5f)*POS.normalized.x));
                                xNode.iConstruction.iBLane0R.Add(GVC(tempIVect,tIntHeight));  		b0RAdded = true;
                            }
                        }
                        tempIVect_Prev = tempIVect;
                        tempIVect = (tVect + new Vector3((LaneWidth*0.5f)*-POS.normalized.z,0,(LaneWidth*0.5f)*POS.normalized.x));
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){ tempIVect = tVect; }
                        bLine = false;
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            bLine = !GSDRI.ContainsLine(tempIVect,(tVect + new Vector3((LaneWidth*0.5f)*POS.normalized.z,0,(LaneWidth*0.5f)*-POS.normalized.x)));
                        }if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                            bLine = !GSDRI.ContainsLine(tempIVect,rVect);
                        }else{
                            bLine = !GSDRI.ContainsLine(tempIVect,rVect);
                        }
                        tempIVect_Prev = tempIVect;
                        if(b0LAdded && !xNode.iConstruction.bBLane1Done && !GSDRI.Contains(ref tempIVect) && bLine){
                            if(b0LAdded && (xNode.iConstruction.iBLane0L.Count != 2 || GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane)){
                                xNode.iConstruction.iBLane0R.Add(GVC(tempIVect,tIntHeight));   	b0RAdded = true;
                            }
                            xNode.iConstruction.iBLane1L.Add(GVC(tempIVect,tIntHeight));		b1LAdded = true;
                        }else if(!xNode.iConstruction.bBLane1Done_Final){
                            //Finalize lane 1:
                            InterFinalizeiBLane1(ref xNode, ref GSDRI, ref tIntHeight, bLRtoRR, bLLtoLR, bFirstInterNode, ref b0LAdded, ref b1RAdded);
                        }

                        //Line 2:
                        if(xNode.iConstruction.iBLane1R.Count == 0 && xNode.GSDRI.rType != GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            xNode.iConstruction.iBLane1R.Add(GVC(tVect,tIntHeight));		b1RAdded = true;
                            xNode.iConstruction.iBLane2L.Add(GVC(tVect,tIntHeight));		b2LAdded = true;
                            b2LAdded = true;
                        }else{
                            tempIVect = (tVect + new Vector3((LaneWidth*0.5f)*POS.normalized.z,0,(LaneWidth*0.5f)*-POS.normalized.x));
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){ tempIVect = rVect; }
                            if(b1LAdded){
                                bLine = !GSDRI.ContainsLine(tempIVect,tempIVect_Prev);
                            }else{
                                bLine = !GSDRI.ContainsLine(tempIVect,rVect);
                            }
                            if(!xNode.iConstruction.bBLane2Done && !GSDRI.Contains(ref tempIVect) && bLine){
                                if(b1LAdded){ xNode.iConstruction.iBLane1R.Add(GVC(tempIVect,tIntHeight)); b1RAdded = true; }
                                xNode.iConstruction.iBLane2L.Add(GVC(tempIVect,tIntHeight)); b2LAdded = true;
                            }else if(!xNode.iConstruction.bBLane2Done_Final){
                                InterFinalizeiBLane2(ref xNode, ref GSDRI, ref tIntHeight, bLRtoRR, bLLtoLR, bFirstInterNode, ref b2LAdded, ref b1LAdded, ref b0LAdded, ref b1RAdded);
                            }
                        }

                        //Line 3 / 4:
                        tempIVect = (tVect + new Vector3(((LaneWidth*0.5f)+RoadSeperation)*POS.normalized.z,0,((LaneWidth*0.5f)+RoadSeperation)*-POS.normalized.x));
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){ tempIVect = rVect; }
                        if(!xNode.iConstruction.bBLane3Done && !GSDRI.ContainsLine(rVect,tempIVect) && !GSDRI.ContainsLine(rVect,lVect)){
                            xNode.iConstruction.iBLane3L.Add(GVC(tempIVect,tIntHeight)); b3LAdded = true;
                            xNode.iConstruction.iBLane3R.Add(GVC(rVect,tIntHeight)); b3RAdded = true;
                            if(!bFirst123 && GSDRI.iType == GSDRoadIntersection.IntersectionTypeEnum.FourWay){
                                if(b2LAdded){ xNode.iConstruction.iBLane2R.Add(GVC(tempIVect,tIntHeight));	 b2RAdded = true; }
                            }
                        }else if(!xNode.iConstruction.bBLane3Done_Final){
                            InterFinalizeiBLane3(ref xNode, ref GSDRI, ref tIntHeight, bLRtoRR, bLLtoLR, bFirstInterNode, ref b2LAdded, ref b1LAdded, ref b0LAdded, ref b1RAdded);
                        }

                    }
                }

            //			InterSkip:

                if(!bIsBridge){
                    BridgeUpComing = tRoad.GSDSpline.BridgeUpComing(i);
            //					if(TempY < 0.5f){
            //						gHeight = tHeight0;
            //					}else if(TempY < 2f){
            //						gHeight = tHeight2;
            //					}else{
            //						if(bTempYWasNegative){
            //							tY = new Vector3(0f,(TempY*0.035f),0f);
            //						}
            //						if(tY.y < tHeight1.y){
            //							tY = tHeight1;
            //						}
            //						gHeight = tY;
            //					}
                    if(BridgeUpComing < 0.2f){
                        BridgeUpComing = 0.2f;
                    }
            //					gHeight.y = gHeight.y * BridgeUpComing;

            //					if(tRoad.opt_MatchTerrain){
                        gHeight.y = 0f;
            //					}

                    lVect += gHeight;
                    rVect += gHeight;
                    ShoulderR_lVect += gHeight;
                    ShoulderL_rVect += gHeight;
                    ShoulderL_lVect += gHeight;
                    ShoulderR_rVect += gHeight;
                    tHeightAdded = gHeight.y;
                }

                if(tIntStrength >= 1f){
                    tVect.y -= tInterSubtract;
                    tLastInterHeight = tVect.y;
                    rVect.y -= tInterSubtract;
                    lVect.y -= tInterSubtract;

                    ShoulderL_rVect.y = tIntHeight;
                    ShoulderR_lVect.y = tIntHeight;
                    ShoulderR_rVect.y = tIntHeight;
                    ShoulderL_lVect.y = tIntHeight;

            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderL_rVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderL_rVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderL_rVect.y); }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderR_lVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderR_lVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderR_lVect.y); }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderR_rVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderR_rVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderR_rVect.y); }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderL_lVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderL_lVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderL_lVect.y); }
                }else if(tIntStrength > 0f){

                    rVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*rVect.y);
                    ShoulderR_lVect = rVect;
                    lVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*lVect.y);
                    ShoulderL_rVect = lVect;
                    ShoulderR_rVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*ShoulderR_rVect.y);
                    ShoulderL_lVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*ShoulderL_lVect.y);

            //					if(!Mathf.Approximately(tIntStrength,0f)){ tVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*tVect.y); }
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref rVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ rVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*rVect.y); ShoulderR_lVect = rVect; }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref lVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ lVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*lVect.y); ShoulderL_rVect = lVect; }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderR_rVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderR_rVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderR_rVect.y); }
            //
            //					tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref ShoulderL_lVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
            //					if(!Mathf.Approximately(tIntStrength_temp,0f)){ ShoulderL_lVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*ShoulderL_lVect.y); }
                }

                //Ramp:
                RampR_L = ShoulderR_rVect;
                RampL_R = ShoulderL_lVect;
                if(bIsBridge){
                    RampR_R = RampR_L;
                    RampL_L = RampL_R;
                }else{
                    RampR_R = (tVect + new Vector3(RampOuterWidthR*POS.normalized.z,0,RampOuterWidthR*-POS.normalized.x)) + gHeight;
                    SetVectorHeight2(ref RampR_R,ref i, ref tSpline.HeightHistory, ref tSpline);
                    RampR_R.y -= 0.35f;

                    RampL_L = (tVect + new Vector3(RampOuterWidthL*-POS.normalized.z,0,RampOuterWidthL*POS.normalized.x)) + gHeight;
                    SetVectorHeight2(ref RampL_L,ref i, ref tSpline.HeightHistory, ref tSpline);
                    RampL_L.y -= 0.35f;
                }

                //Merge points to intersection corners if necessary:
                if(bMaxIntersection && !bIsBridge && !bIsTunnel && bInterseOn){
                    mCornerDist = tRoad.opt_RoadDefinition* 1.35f;
                    mCornerDist *= mCornerDist;

                    CornerRR = new Vector2(GSDRI.CornerRR.x, GSDRI.CornerRR.z);
                    CornerRL = new Vector2(GSDRI.CornerRL.x, GSDRI.CornerRL.z);
                    CornerLR = new Vector2(GSDRI.CornerLR.x, GSDRI.CornerLR.z);
                    CornerLL = new Vector2(GSDRI.CornerLL.x, GSDRI.CornerLL.z);
                    rVect2D = new Vector2(rVect.x,rVect.z);
                    lVect2D = new Vector2(lVect.x,lVect.z);
                    bOverrideRampR = false;
                    bOverrideRampL = false;
                    bImmuneR = false;
                    bImmuneL = false;
                    bMod1 = 1.75f;
                    bMod2 = 1.25f;
                    t2DDist = -1f;

                    //Find equatable lane vect and move it too
            //					eCount = -1;
            //					eIndex = -1;
            //					uCount = -1;
            //					uIndex = -1;

                    xHeight = new Vector3(0f,-0.1f,0f);
                    bSpecAddedL = false;
                    bSpecAddedR = false;

                    if(bFirstInterNode){
                        bSpecAddedL = (b0LAdded || f0LAdded);
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                            bSpecAddedR = (b1RAdded || f1LAdded);
                        }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                            bSpecAddedR = (b2RAdded || f2LAdded);
                        }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            bSpecAddedR = (b3RAdded || f3LAdded);
                        }
                    }

                    float tempRoadDef = Mathf.Clamp(tRoad.opt_LaneWidth, 3f, 5f);

                    if (GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane) {

                    } else if (GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane) {

                    } else if (GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes) {

                    }

                    //RR:
                    if(GSDRI.EvenAngle > 90f){ mCornerDist = tempRoadDef*bMod1; } else { mCornerDist = tempRoadDef*bMod2; }
                    mCornerDist *= mCornerDist;
                    t2DDist = Vector2.SqrMagnitude(CornerRR-rVect2D);
                    if(t2DDist < mCornerDist){
                        bImmuneR = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerRR = true;

                        if(bFirstInterNode){
                            vList = null;
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                vList = xNode.iConstruction.iBLane1R;
                                if(xNode.iConstruction.bBLane1Done_Final_ThisRound){ vList = null; }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                vList = xNode.iConstruction.iBLane2R;
                                if(xNode.iConstruction.bBLane2Done_Final_ThisRound){ vList = null; }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                vList = xNode.iConstruction.iBLane3R;
                                if(xNode.iConstruction.bBLane3Done_Final_ThisRound){ vList = null; }
                            }

                            eList = new List<int>();
                            if(vList != null){
                                for(int m=0;m<vList.Count;m++){
                                    if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                        if(!(IsApproximately(vList[m].x,GSDRI.CornerRR.x,0.01f) && IsApproximately(vList[m].z,GSDRI.CornerRR.z,0.01f))){
                                            eList.Add(m);
                                        }
                                    }
                                }
                                for(int m=(eList.Count-1);m>=0;m--){
                                    vList.RemoveAt(eList[m]);
                                }
                            }
                            eList = null;
                        }else{
                            //2nd node can only come through RR as front with R
                            vList = null;
                            vList = xNode.iConstruction.iFLane0L;
                            eList = new List<int>();
                            if(vList != null){
                                for(int m=1;m<vList.Count;m++){
                                    if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                        if(!(IsApproximately(vList[m].x,GSDRI.CornerRR.x,0.01f) && IsApproximately(vList[m].z,GSDRI.CornerRR.z,0.01f))){
                                            eList.Add(m);
                                        }
                                    }
                                }
                                for(int m=(eList.Count-1);m>=0;m--){
                                    vList.RemoveAt(eList[m]);
                                }
                            }
                            eList = null;
                        }

                        ShoulderR_lVect = new Vector3(CornerRR.x,tIntHeight,CornerRR.y);
                        ShoulderR_rVect = new Vector3(GSDRI.CornerRR_Outer.x,tIntHeight,GSDRI.CornerRR_Outer.z);
                        RampR_Override = new Vector3(GSDRI.CornerRR_RampOuter.x,tIntHeight,GSDRI.CornerRR_RampOuter.z);
                        bRecordShoulderForNormals = true;
                    }else{
                        t2DDist = Vector2.SqrMagnitude(CornerRR-lVect2D);
                        if(t2DDist < mCornerDist){
                            bImmuneL = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerRR = true;

                            //2nd node can come in via left
                            if(!bFirstInterNode){
                                vList = null;
                                vList = xNode.iConstruction.iBLane0L;
                                if(xNode.iConstruction.bBLane0Done_Final_ThisRound){ vList = null; }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=0;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerRR.x) && IsApproximately(vList[m].z,GSDRI.CornerRR.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }

                            ShoulderL_rVect = new Vector3(CornerRR.x,tIntHeight,CornerRR.y);
                            ShoulderL_lVect = new Vector3(GSDRI.CornerRR_Outer.x,tIntHeight,GSDRI.CornerRR_Outer.z);
                            RampL_Override = new Vector3(GSDRI.CornerRR_RampOuter.x,tIntHeight,GSDRI.CornerRR_RampOuter.z);
                            bRecordShoulderLForNormals = true;
                        }
                    }
                    //RL:
                    if(GSDRI.OddAngle > 90f){ mCornerDist = tempRoadDef*bMod1; } else { mCornerDist = tempRoadDef*bMod2; }
                    mCornerDist *= mCornerDist;
                    t2DDist = Vector2.SqrMagnitude(CornerRL-rVect2D);
                    if(t2DDist < mCornerDist){
                        bImmuneR = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerRL = true;

                        if(bFirstInterNode){
                            vList = null;
                            vList = xNode.iConstruction.iFLane0L;
                            eList = new List<int>();
                            if(vList != null){
                                for(int m=1;m<vList.Count;m++){
                                    if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                        if(!(IsApproximately(vList[m].x,GSDRI.CornerRL.x) && IsApproximately(vList[m].z,GSDRI.CornerRL.z))){
                                            eList.Add(m);
                                        }
                                    }
                                }
                                for(int m=(eList.Count-1);m>=0;m--){
                                    vList.RemoveAt(eList[m]);
                                }
                            }
                            eList = null;
                        }else{
                            vList = null;
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                vList = xNode.iConstruction.iBLane1R;
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                vList = xNode.iConstruction.iBLane2R;
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                vList = xNode.iConstruction.iBLane3R;
                            }

                            //Hitting RL from backside with second node:
                            if(!bFirstInterNode){
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=0;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerRL.x) && IsApproximately(vList[m].z,GSDRI.CornerRL.z))){
                                                eList.Add(m);
                                                if(m == vList.Count-1){
                                                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                                        b1RAdded = false;
                                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                                        b2RAdded = false;
                                                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                                        b3RAdded = false;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                            }
                            eList = null;
                        }

                        ShoulderR_lVect = new Vector3(CornerRL.x,tIntHeight,CornerRL.y);
                        ShoulderR_rVect = new Vector3(GSDRI.CornerRL_Outer.x,tIntHeight,GSDRI.CornerRL_Outer.z);
                        RampR_Override = new Vector3(GSDRI.CornerRL_RampOuter.x,tIntHeight,GSDRI.CornerRL_RampOuter.z);
                        bRecordShoulderForNormals = true;
                    }else{
                        t2DDist = Vector2.SqrMagnitude(CornerRL-lVect2D);
                        if(t2DDist < mCornerDist){
                            bImmuneL = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerRL = true;

                            if(!bFirstInterNode){
                                vList = null;
                                if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                    vList = xNode.iConstruction.iFLane1R;
                                    if(xNode.iConstruction.bFLane1Done_Final_ThisRound){ vList = null; }
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                    vList = xNode.iConstruction.iFLane2R;
                                    if(xNode.iConstruction.bFLane2Done_Final_ThisRound){ vList = null; }
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                    vList = xNode.iConstruction.iFLane3R;
                                    if(xNode.iConstruction.bFLane3Done_Final_ThisRound){ vList = null; }
                                }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=1;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerRL.x) && IsApproximately(vList[m].z,GSDRI.CornerRL.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }

                            ShoulderL_rVect = new Vector3(CornerRL.x,tIntHeight,CornerRL.y);
                            ShoulderL_lVect = new Vector3(GSDRI.CornerRL_Outer.x,tIntHeight,GSDRI.CornerRL_Outer.z);
                            RampL_Override = new Vector3(GSDRI.CornerRL_RampOuter.x,tIntHeight,GSDRI.CornerRL_RampOuter.z);
                            bRecordShoulderLForNormals = true;
                        }
                    }
                    //LR:
                    if(GSDRI.OddAngle > 90f){ mCornerDist = tempRoadDef*bMod1; } else { mCornerDist = tempRoadDef*bMod2; }
                    mCornerDist *= mCornerDist;
                    t2DDist = Vector2.SqrMagnitude(CornerLR-rVect2D);
                    if(t2DDist < mCornerDist){
                        bImmuneR = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerLR = true;

                        if(!bFirstInterNode){
                            vList = null;
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                vList = xNode.iConstruction.iBLane1R;
                                if(xNode.iConstruction.bBLane1Done_Final_ThisRound){ vList = null; }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                vList = xNode.iConstruction.iBLane2R;
                                if(xNode.iConstruction.bBLane2Done_Final_ThisRound){ vList = null; }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                vList = xNode.iConstruction.iBLane3R;
                                if(xNode.iConstruction.bBLane3Done_Final_ThisRound){ vList = null; }
                            }

                            eList = new List<int>();
                            if(vList != null){
                                for(int m=0;m<vList.Count;m++){
                                    if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                        if(!(IsApproximately(vList[m].x,GSDRI.CornerLR.x) && IsApproximately(vList[m].z,GSDRI.CornerLR.z))){
                                            eList.Add(m);
                                        }
                                    }
                                }
                                for(int m=(eList.Count-1);m>=0;m--){
                                    vList.RemoveAt(eList[m]);
                                }
                            }
                            eList = null;
                        }

                        ShoulderR_lVect = new Vector3(CornerLR.x,tIntHeight,CornerLR.y);
                        ShoulderR_rVect = new Vector3(GSDRI.CornerLR_Outer.x,tIntHeight,GSDRI.CornerLR_Outer.z);
                        RampR_Override = new Vector3(GSDRI.CornerLR_RampOuter.x,tIntHeight,GSDRI.CornerLR_RampOuter.z);
                        bRecordShoulderForNormals = true;
                    }else{
                        t2DDist = Vector2.SqrMagnitude(CornerLR-lVect2D);
                        if(t2DDist < mCornerDist){
                            bImmuneL = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerLR = true;

                            if(bFirstInterNode){
                                vList = null;
                                vList = xNode.iConstruction.iBLane0L;
                                if(xNode.iConstruction.bBLane0Done_Final_ThisRound){ vList = null; }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=0;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerLR.x) && IsApproximately(vList[m].z,GSDRI.CornerLR.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }else{
                                //2nd node can only come through LR as front with L
                                vList = null;
                                if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                    vList = xNode.iConstruction.iFLane1R;
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                    vList = xNode.iConstruction.iFLane2R;
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                    vList = xNode.iConstruction.iFLane3R;
                                }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=1;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerLR.x) && IsApproximately(vList[m].z,GSDRI.CornerLR.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }

                            ShoulderL_rVect = new Vector3(CornerLR.x,tIntHeight,CornerLR.y);
                            ShoulderL_lVect = new Vector3(GSDRI.CornerLR_Outer.x,tIntHeight,GSDRI.CornerLR_Outer.z);
                            RampL_Override = new Vector3(GSDRI.CornerLR_RampOuter.x,tIntHeight,GSDRI.CornerLR_RampOuter.z);
                            bRecordShoulderLForNormals = true;
                        }
                    }
                    //LL:
                    if(GSDRI.EvenAngle > 90f){ mCornerDist = tempRoadDef*bMod1; } else { mCornerDist = tempRoadDef*bMod2; }
                    mCornerDist *= mCornerDist;
                    t2DDist = Vector2.SqrMagnitude(CornerLL-rVect2D);
                    if(t2DDist < mCornerDist){
                        bImmuneR = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerLL = true;

                        if(!bFirstInterNode){
                            vList = null;
                            vList = xNode.iConstruction.iFLane0L;
                            eList = new List<int>();
                            if(vList != null){
                                for(int m=1;m<vList.Count;m++){
                                    if(Vector3.SqrMagnitude(vList[m]-ShoulderR_lVect) < 0.01f){
                                        if(!(IsApproximately(vList[m].x,GSDRI.CornerLL.x) && IsApproximately(vList[m].z,GSDRI.CornerLL.z))){
                                            eList.Add(m);
                                        }
                                    }
                                }
                                for(int m=(eList.Count-1);m>=0;m--){
                                    vList.RemoveAt(eList[m]);
                                }
                            }
                            eList = null;
                        }

                        ShoulderR_lVect = new Vector3(CornerLL.x,tIntHeight,CornerLL.y);
                        ShoulderR_rVect = new Vector3(GSDRI.CornerLL_Outer.x,tIntHeight,GSDRI.CornerLL_Outer.z);
                        RampR_Override = new Vector3(GSDRI.CornerLL_RampOuter.x,tIntHeight,GSDRI.CornerLL_RampOuter.z);
                        bRecordShoulderForNormals = true;
                    }else{
                        t2DDist = Vector2.SqrMagnitude(CornerLL-lVect2D);
                        if(t2DDist < mCornerDist){
                            bImmuneL = true; bInter_CurreIsCorner = true; bInter_CurreIsCornerLL = true;

                            if(bFirstInterNode){
                                vList = null;
                                if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                                    vList = xNode.iConstruction.iFLane1R;
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                    vList = xNode.iConstruction.iFLane2R;
                                }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                    vList = xNode.iConstruction.iFLane3R;
                                }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=1;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerLL.x) && IsApproximately(vList[m].z,GSDRI.CornerLL.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }else{
                                vList = null;
                                vList = xNode.iConstruction.iBLane0L;
                                if(xNode.iConstruction.bBLane0Done_Final_ThisRound){ vList = null; }
                                eList = new List<int>();
                                if(vList != null){
                                    for(int m=0;m<vList.Count;m++){
                                        if(Vector3.SqrMagnitude(vList[m]-ShoulderL_rVect) < 0.01f){
                                            if(!(IsApproximately(vList[m].x,GSDRI.CornerLL.x) && IsApproximately(vList[m].z,GSDRI.CornerLL.z))){
                                                eList.Add(m);
                                            }
                                        }
                                    }
                                    for(int m=(eList.Count-1);m>=0;m--){
                                        vList.RemoveAt(eList[m]);
                                    }
                                }
                                eList = null;
                            }

                            ShoulderL_rVect = new Vector3(CornerLL.x,tIntHeight,CornerLL.y);
                            ShoulderL_lVect = new Vector3(GSDRI.CornerLL_Outer.x,tIntHeight,GSDRI.CornerLL_Outer.z);
                            RampL_Override = new Vector3(GSDRI.CornerLL_RampOuter.x,tIntHeight,GSDRI.CornerLL_RampOuter.z);
                            bRecordShoulderLForNormals = true;
                        }
                    }

                    if(bImmuneR){
                        bOverrideRampR = true;
                        if(!tRoad.RCS.ImmuneVects.Contains(ShoulderR_lVect)){ tRoad.RCS.ImmuneVects.Add(ShoulderR_lVect); }
                        if(!tRoad.RCS.ImmuneVects.Contains(ShoulderR_rVect)){ tRoad.RCS.ImmuneVects.Add(ShoulderR_rVect); }
                    }
                    if(bImmuneL){
                        bOverrideRampL = true;
                        if(!tRoad.RCS.ImmuneVects.Contains(ShoulderL_rVect)){ tRoad.RCS.ImmuneVects.Add(ShoulderL_rVect); }
                        if(!tRoad.RCS.ImmuneVects.Contains(ShoulderL_lVect)){ tRoad.RCS.ImmuneVects.Add(ShoulderL_lVect); }
                    }
                }

                if(bShrinkRoadB){

                    if (lVect_Prev != new Vector3(0f, 0f, 0f)) {
                        tRoad.RCS.RoadVectors.Add(lVect_Prev);
                        tRoad.RCS.RoadVectors.Add(lVect_Prev);
                        tRoad.RCS.RoadVectors.Add(lVect_Prev);
                        tRoad.RCS.RoadVectors.Add(lVect_Prev);
                    }
                }
                if(bShrinkRoadF){
                    if (lVect != new Vector3(0f, 0f, 0f)) {
                        tRoad.RCS.RoadVectors.Add(lVect);
                        tRoad.RCS.RoadVectors.Add(lVect);
                        tRoad.RCS.RoadVectors.Add(lVect);
                        tRoad.RCS.RoadVectors.Add(lVect);
                    }
                }

                tRoad.RCS.RoadVectors.Add(lVect);
                tRoad.RCS.RoadVectors.Add(lVect);
                tRoad.RCS.RoadVectors.Add(rVect);
                tRoad.RCS.RoadVectors.Add(rVect);

                //Add bounds for later removal:
                if(!bIsBridge && !bIsTunnel && bMaxIntersection && bWasPrevMaxInter && bInterseOn){
                    bool bGoAhead = true;
                    if(xNode.bIsEndPoint){
                        if(xNode.idOnSpline == 1){
                            if(i < xNode.tTime){
                                bGoAhead = false;
                            }
                        }else{
                            if(i > xNode.tTime){
                                bGoAhead = false;
                            }
                        }
                    }

                    //Get this and prev lvect rvect rects:
                    if((Vector3.SqrMagnitude(xNode.pos-tVect) < CullDistanceSQ) && bGoAhead){
                            GSD.Roads.GSDRoadUtil.Construction2DRect vRect = new GSD.Roads.GSDRoadUtil.Construction2DRect(
                                new Vector2(lVect.x,lVect.z),
                                new Vector2(rVect.x,rVect.z),
                                new Vector2(lVect_Prev.x,lVect_Prev.z),
                                new Vector2(rVect_Prev.x,rVect_Prev.z),
                                tLastInterHeight
                                );

                        tRoad.RCS.tIntersectionBounds.Add(vRect);
            //						GameObject tObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
            //						tObj.transform.position = lVect;
            //						tObj.transform.localScale = new Vector3(0.2f,20f,0.2f);
            //						tObj.transform.name = "temp22";
            //
            //						tObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
            //						tObj.transform.position = rVect;
            //						tObj.transform.localScale = new Vector3(0.2f,20f,0.2f);
            //						tObj.transform.name = "temp22";
                    }
                }

                //Ramp construction:
                RampR_L = ShoulderR_rVect;
                RampL_R = ShoulderL_lVect;
                if(bIsBridge){
                    RampR_R = RampR_L;
                    RampL_L = RampL_R;
                }else{
                    RampR_R = (tVect + new Vector3(RampOuterWidthR*POS.normalized.z,0,RampOuterWidthR*-POS.normalized.x)) + gHeight;;
                    if(bOverrideRampR){ RampR_R = RampR_Override; }	//Overrides will come from intersection.
                    SetVectorHeight2(ref RampR_R,ref i, ref tSpline.HeightHistory, ref tSpline);
                    RampR_R.y -= 0.35f;

                    RampL_L = (tVect + new Vector3(RampOuterWidthL*-POS.normalized.z,0,RampOuterWidthL*POS.normalized.x)) + gHeight;;
                    if(bOverrideRampL){ RampL_L = RampL_Override; }	//Overrides will come from intersection.
                    SetVectorHeight2(ref RampL_L,ref i, ref tSpline.HeightHistory, ref tSpline);
                    RampL_L.y -= 0.35f;
                    bOverrideRampR = false;
                    bOverrideRampL = false;
                }

                //If necessary during intersection construction, sometimes an addition will be created inbetween intersection corner points.
                //This addition will create a dip between corner points to 100% ensure there is no shoulder visible on the roads between corner points.
                bTriggerInterAddition = false;
                if(bMaxIntersection && bInterseOn){
                    if(bFirstInterNode){
                        if((bInter_PrevWasCornerLR && bInter_CurreIsCornerLL) || (bInter_PrevWasCornerRR && bInter_CurreIsCornerRL)){
                            bTriggerInterAddition = true;
                        }
                    }else{
                        if(!GSDRI.bFlipped){
                            if((bInter_PrevWasCornerLL && bInter_CurreIsCornerRL) || (bInter_PrevWasCornerLR && bInter_CurreIsCornerRR) || (bInter_PrevWasCornerRR && bInter_CurreIsCornerLR)){
                                bTriggerInterAddition = true;
                            }
                        }else{
                            if((bInter_PrevWasCornerRR && bInter_CurreIsCornerLR) || (bInter_PrevWasCornerLR && bInter_CurreIsCornerRR) || (bInter_PrevWasCornerRL && bInter_CurreIsCornerLL)){
                                bTriggerInterAddition = true;
                            }
                        }
                    }

                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                        bTriggerInterAddition = false;
                    }

                    //For 3-way intersections:
                    bSpecialThreeWayIgnoreR = false;
                    bSpecialThreeWayIgnoreL = false;
                    if(GSDRI.IgnoreSide > -1){
                        if(GSDRI.IgnoreSide == 0){
                            //RR to RL:
                            if(bFirstInterNode && (bInter_PrevWasCornerRR && bInter_CurreIsCornerRL)){
                                bTriggerInterAddition = false;
                            }
                        }else if(GSDRI.IgnoreSide == 1){
                            //RL to LL:
                            if(!bFirstInterNode && ((bInter_PrevWasCornerRL && bInter_CurreIsCornerLL) || (bInter_PrevWasCornerLL && bInter_CurreIsCornerRL))){
                                //bTriggerInterAddition = false;
                                if(GSDRI.bFlipped){
                                    bSpecialThreeWayIgnoreR = true;
                                }else{
                                    bSpecialThreeWayIgnoreL = true;
                                }
                            }
                        }else if(GSDRI.IgnoreSide == 2){
                            //LL to LR:
                            if(bFirstInterNode && (bInter_PrevWasCornerLR && bInter_CurreIsCornerLL)){
                                bTriggerInterAddition = false;
                            }
                        }else if(GSDRI.IgnoreSide == 3){
                            //LR to RR:
                            if(!bFirstInterNode && ((bInter_PrevWasCornerRR && bInter_CurreIsCornerLR) || (bInter_PrevWasCornerLR && bInter_CurreIsCornerRR))){
                                //bTriggerInterAddition = false;
                                if(GSDRI.bFlipped){
                                    bSpecialThreeWayIgnoreL = true;
                                }else{
                                    bSpecialThreeWayIgnoreR = true;
                                }
                            }
                        }
                    }

                    if(bTriggerInterAddition){
                        iTemp_HeightVect = new Vector3(0f,0f,0f);
                        rVect_iTemp = (((rVect_Prev-rVect)*0.5f)+rVect) + iTemp_HeightVect;
                        lVect_iTemp = (((lVect_Prev-lVect)*0.5f)+lVect) + iTemp_HeightVect;
                        ShoulderR_R_iTemp = (((ShoulderR_PrevRVect-ShoulderR_rVect)*0.5f)+ShoulderR_rVect) + iTemp_HeightVect;
                        ShoulderL_L_iTemp = (((ShoulderL_PrevLVect-ShoulderL_lVect)*0.5f)+ShoulderL_lVect) + iTemp_HeightVect;
                        RampR_R_iTemp = (((RampR_PrevR-RampR_R)*0.5f)+RampR_R) + iTemp_HeightVect;
                        RampR_L_iTemp = (((RampR_PrevL-RampR_L)*0.5f)+RampR_L) + iTemp_HeightVect;
                        RampL_R_iTemp = (((RampL_PrevR-RampL_R)*0.5f)+RampL_R) + iTemp_HeightVect;
                        RampL_L_iTemp = (((RampL_PrevL-RampL_L)*0.5f)+RampL_L) + iTemp_HeightVect;

            //						ShoulderL_L_iTemp = lVect_iTemp;
            //						RampL_R_iTemp = lVect_iTemp;
            //						RampL_L_iTemp = lVect_iTemp;
            //
            //						ShoulderR_R_iTemp = rVect_iTemp;
            //						RampR_R_iTemp = rVect_iTemp;
            //						RampR_L_iTemp = rVect_iTemp;
                    }

                    if(bTriggerInterAddition && !(GSDRI.bFlipped && !bFirstInterNode)){
                        if(bFirstInterNode){
                            if((bInter_PrevWasCornerRR && bInter_CurreIsCornerRL && !bSpecialThreeWayIgnoreR)){
                                //Right shoulder:
                                tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                                //Ramps:
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                            }
                            if((bInter_PrevWasCornerLR && bInter_CurreIsCornerLL && !bSpecialThreeWayIgnoreL)){
                                //Left shoulder:
                                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                                //Ramp:
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                            }
                        }else{
                            if((bInter_PrevWasCornerLR && bInter_CurreIsCornerRR && !bSpecialThreeWayIgnoreR)){
                                //Right shoulder:
                                tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                                //Ramps:
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                            }
                            if((bInter_PrevWasCornerLL && bInter_CurreIsCornerRL && !bSpecialThreeWayIgnoreL)){
                                //Left shoulder:
                                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                                //Ramp:
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                                tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                            }
                        }
                    }else if(bTriggerInterAddition && (GSDRI.bFlipped && !bFirstInterNode)){
                        if((bInter_PrevWasCornerRR && bInter_CurreIsCornerLR && !bSpecialThreeWayIgnoreL)){
                            //Left shoulder:
                            tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_L_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(lVect_iTemp);
                            //Ramp:
                            tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(RampL_L_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                            tRoad.RCS.ShoulderL_Vectors.Add(RampL_R_iTemp);
                        }
                        if((bInter_PrevWasCornerRL && bInter_CurreIsCornerLL && !bSpecialThreeWayIgnoreR)){
                            //Right shoulder:
                            tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(rVect_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_R_iTemp);
                            //Ramps:
                            tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(RampR_L_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                            tRoad.RCS.ShoulderR_Vectors.Add(RampR_R_iTemp);
                        }
                    }
                }

                //Right shoulder:
                if(!bShoulderSkipR){
                    if(bRecordShoulderForNormals){
                        tRoad.RCS.normals_ShoulderR_averageStartIndexes.Add(tRoad.RCS.ShoulderR_Vectors.Count);
                    }

                    tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_lVect);
                    tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_lVect);
                    tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                    tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                    tRoad.RCS.ShoulderR_Vectors.Add(RampR_L);
                    tRoad.RCS.ShoulderR_Vectors.Add(RampR_L);
                    tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);
                    tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);

                    //Double up to prevent normal errors from intersection subtraction:
                    if(bImmuneR && bRecordShoulderForNormals){
                        tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_lVect);
                        tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_lVect);
                        tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                        tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                        tRoad.RCS.ShoulderR_Vectors.Add(RampR_L);
                        tRoad.RCS.ShoulderR_Vectors.Add(RampR_L);
                        tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);
                        tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);
                    }
                }

                //Left shoulder:
                if(!bShoulderSkipL){
                    if(bRecordShoulderLForNormals){
                        tRoad.RCS.normals_ShoulderL_averageStartIndexes.Add(tRoad.RCS.ShoulderL_Vectors.Count);
                    }
                    tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                    tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                    tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_rVect);
                    tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_rVect);
                    tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                    tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                    tRoad.RCS.ShoulderL_Vectors.Add(RampL_R);
                    tRoad.RCS.ShoulderL_Vectors.Add(RampL_R);

                    //Double up to prevent normal errors from intersection subtraction:
                    if(bImmuneL && bRecordShoulderForNormals){
                        tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                        tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                        tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_rVect);
                        tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_rVect);
                        tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                        tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                        tRoad.RCS.ShoulderL_Vectors.Add(RampL_R);
                        tRoad.RCS.ShoulderL_Vectors.Add(RampL_R);
                    }
                }

                //Previous storage:
                tVect_Prev = tVect;
                rVect_Prev = rVect;
                lVect_Prev = lVect;
                ShoulderR_PrevLVect = ShoulderR_lVect;
                ShoulderL_PrevRVect = ShoulderL_rVect;
            //				ShoulderR_PrevRVect3 = ShoulderR_PrevRVect2;
            //				ShoulderL_PrevLVect3 = ShoulderL_PrevLVect2;
            //				ShoulderR_PrevRVect2 = ShoulderR_PrevRVect;
            //				ShoulderL_PrevLVect2 = ShoulderL_PrevLVect;
                ShoulderR_PrevRVect = ShoulderR_rVect;
                ShoulderL_PrevLVect = ShoulderL_lVect;
                RampR_PrevR = RampR_R;
                RampR_PrevL = RampR_L;
                RampL_PrevR = RampL_R;
                RampL_PrevL = RampL_L;

                //Store more prev variables:
                bWasPrevMaxInter = bMaxIntersection;
                bInter_PrevWasCorner = bInter_CurreIsCorner;
                bInter_PrevWasCornerRR = bInter_CurreIsCornerRR;
                bInter_PrevWasCornerRL = bInter_CurreIsCornerRL;
                bInter_PrevWasCornerLL = bInter_CurreIsCornerLL;
                bInter_PrevWasCornerLR = bInter_CurreIsCornerLR;

            //				i+=Step;//Master step incrementer.
            }
            if(tRoad.bProfiling){ Profiler.EndSample(); }

            if(tRoad.bProfiling){ Profiler.BeginSample("RoadJob_Prelim_FinalizeInter"); }
            //Finalize intersection vectors:
            if(bInterseOn){
                RoadJob_Prelim_FinalizeInter(ref tRoad);
            }
            if(tRoad.bProfiling){ Profiler.EndSample(); }

            if(tRoad.bProfiling){ Profiler.BeginSample("RoadJob_Prelim_RoadConnections"); }
            //Creates road connections if necessary:
            //			float ExtraHeight = 0f;
            //			float RampPercent = 0.2f;
            if(tSpline.bSpecialEndNode_IsStart_Delay){
                Vector3[] RoadConn_verts = new Vector3[4];

                RampR_R = tRoad.RCS.ShoulderR_Vectors[7];
                ShoulderR_rVect = tRoad.RCS.ShoulderR_Vectors[3];
                rVect = tRoad.RCS.ShoulderR_Vectors[0];

                tRoad.RCS.ShoulderR_Vectors.Insert(0,RampR_R);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,RampR_R);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,rVect);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,rVect);

                RampL_L = tRoad.RCS.ShoulderL_Vectors[4];
                ShoulderL_lVect = tRoad.RCS.ShoulderL_Vectors[0];
                lVect = tRoad.RCS.ShoulderL_Vectors[3];

                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,lVect);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,lVect);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect);

                RoadConn_verts[0] = lVect;
                RoadConn_verts[1] = rVect;
                tSpline.GetSplineValue_Both(RoadConnection_StartMin1,out tVect,out POS);
                RoadSeperation = tSpline.SpecialEndNodeDelay_Start_Result / 2f;
                rVect = (tVect + new Vector3(RoadSeperation*POS.normalized.z,0,RoadSeperation*-POS.normalized.x));
                lVect = (tVect + new Vector3(RoadSeperation*-POS.normalized.z,0,RoadSeperation*POS.normalized.x));
                ShoulderSeperation = RoadSeperation + ShoulderWidth;
                OuterShoulderWidthR = ShoulderSeperation;
                OuterShoulderWidthL = ShoulderSeperation;
                RampOuterWidthR = (OuterShoulderWidthR / 4f) + OuterShoulderWidthR;
                RampOuterWidthL = (OuterShoulderWidthL / 4f) + OuterShoulderWidthL;
                ShoulderR_rVect = (tVect + new Vector3(ShoulderSeperation*POS.normalized.z,0,ShoulderSeperation*-POS.normalized.x));
                ShoulderL_lVect = (tVect + new Vector3(ShoulderSeperation*-POS.normalized.z,0,ShoulderSeperation*POS.normalized.x));
                RampR_R = (tVect + new Vector3(RampOuterWidthR*POS.normalized.z,0,RampOuterWidthR*-POS.normalized.x));
                SetVectorHeight2(ref RampR_R,ref i, ref tSpline.HeightHistory, ref tSpline);
                RampR_R.y -= 0.45f;
                RampL_L = (tVect + new Vector3(RampOuterWidthL*-POS.normalized.z,0,RampOuterWidthL*POS.normalized.x));
                SetVectorHeight2(ref RampL_L,ref i, ref tSpline.HeightHistory, ref tSpline);
                RampL_L.y -= 0.45f;

                tRoad.RCS.ShoulderR_Vectors.Insert(0,RampR_R + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,RampR_R + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,ShoulderR_rVect + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,rVect + tHeight0);
                tRoad.RCS.ShoulderR_Vectors.Insert(0,rVect + tHeight0);

                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,RampL_L + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,RampL_L + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,lVect + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,lVect + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect + tHeight0);
                tRoad.RCS.ShoulderL_Vectors.Insert(0,ShoulderL_lVect + tHeight0);

                RoadConn_verts[2] = lVect + tHeight0;
                RoadConn_verts[3] = rVect + tHeight0;
                //Tris:
                int[] RoadConn_tris = new int[6];
                RoadConn_tris[0] = 2;
                RoadConn_tris[1] = 0;
                RoadConn_tris[2] = 3;
                RoadConn_tris[3] = 0;
                RoadConn_tris[4] = 1;
                RoadConn_tris[5] = 3;

                Vector3[] RoadConn_normals = new Vector3[4];
                RoadConn_normals[0] = -Vector3.forward;
                RoadConn_normals[1] = -Vector3.forward;
                RoadConn_normals[2] = -Vector3.forward;
                RoadConn_normals[3] = -Vector3.forward;
                Vector2[] RoadConn_uv = new Vector2[4];
                float tMod1 = -1;
                float tMod2 = -1;

                if(tRoad.opt_Lanes == 2){
                    tMod1 = 0.5f - (LaneWidth / tSpline.SpecialEndNodeDelay_Start_Result);
                    tMod2 = 0.5f + (LaneWidth / tSpline.SpecialEndNodeDelay_Start_Result);
                }else if(tRoad.opt_Lanes == 4){
                    tMod1 = 0.5f - ((LaneWidth*2f) / tSpline.SpecialEndNodeDelay_Start_Result);
                    tMod2 = 0.5f + ((LaneWidth*2f) / tSpline.SpecialEndNodeDelay_Start_Result);
                }
                RoadConn_uv[0] = new Vector2(tMod1,0f);
                RoadConn_uv[1] = new Vector2(tMod2,0f);
                RoadConn_uv[2] = new Vector2(0f,1f);
                RoadConn_uv[3] = new Vector2(1f,1f);

                tRoad.RCS.RoadConnections_verts.Add(RoadConn_verts);
                tRoad.RCS.RoadConnections_tris.Add(RoadConn_tris);
                tRoad.RCS.RoadConnections_normals.Add(RoadConn_normals);
                tRoad.RCS.RoadConnections_uv.Add(RoadConn_uv);
            }else if(tSpline.bSpecialEndNode_IsEnd_Delay){
                Vector3[] RoadConn_verts = new Vector3[4];
                int rrCount = tRoad.RCS.ShoulderR_Vectors.Count;
                RampR_R = tRoad.RCS.ShoulderR_Vectors[rrCount-1];
                ShoulderR_rVect = tRoad.RCS.ShoulderR_Vectors[rrCount-3];
                rVect = tRoad.RCS.ShoulderR_Vectors[rrCount-7];

                //Right shoulder:
                tRoad.RCS.ShoulderR_Vectors.Add(rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);
                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);

                rrCount = tRoad.RCS.ShoulderL_Vectors.Count;
                RampL_L = tRoad.RCS.ShoulderL_Vectors[rrCount-3];
                ShoulderL_lVect = tRoad.RCS.ShoulderL_Vectors[rrCount-1];
                lVect = tRoad.RCS.ShoulderL_Vectors[rrCount-5];

                //Left shoulder:
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);

                RoadConn_verts[0] = lVect;
                RoadConn_verts[1] = rVect;
                tSpline.GetSplineValue_Both(RoadConnection_FinalMax1,out tVect,out POS);
                RoadSeperation = tSpline.SpecialEndNodeDelay_End_Result / 2f;
                rVect = (tVect + new Vector3(RoadSeperation*POS.normalized.z,0,RoadSeperation*-POS.normalized.x));
                lVect = (tVect + new Vector3(RoadSeperation*-POS.normalized.z,0,RoadSeperation*POS.normalized.x));
                ShoulderSeperation = RoadSeperation + ShoulderWidth;
                OuterShoulderWidthR = ShoulderSeperation;
                OuterShoulderWidthL = ShoulderSeperation;
                RampOuterWidthR = (OuterShoulderWidthR / 4f) + OuterShoulderWidthR;
                RampOuterWidthL = (OuterShoulderWidthL / 4f) + OuterShoulderWidthL;
                ShoulderR_rVect = (tVect + new Vector3(ShoulderSeperation*POS.normalized.z,0,ShoulderSeperation*-POS.normalized.x));
                ShoulderL_lVect = (tVect + new Vector3(ShoulderSeperation*-POS.normalized.z,0,ShoulderSeperation*POS.normalized.x));
                RampR_R = (tVect + new Vector3(RampOuterWidthR*POS.normalized.z,0,RampOuterWidthR*-POS.normalized.x));
                SetVectorHeight2(ref RampR_R,ref i, ref tSpline.HeightHistory, ref tSpline);
                RampR_R.y -= 0.35f;
                RampL_L = (tVect + new Vector3(RampOuterWidthL*-POS.normalized.z,0,RampOuterWidthL*POS.normalized.x));
                SetVectorHeight2(ref RampL_L,ref i, ref tSpline.HeightHistory, ref tSpline);
                RampL_L.y -= 0.35f;

                //Right shoulder:
                tRoad.RCS.ShoulderR_Vectors.Add(rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(ShoulderR_rVect);
                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);
                tRoad.RCS.ShoulderR_Vectors.Add(RampR_R);

                //Left shoulder:
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Add(RampL_L);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);
                tRoad.RCS.ShoulderL_Vectors.Add(ShoulderL_lVect);

                RoadConn_verts[2] = lVect;
                RoadConn_verts[3] = rVect;
                //Tris:
                int[] RoadConn_tris = new int[6];
                RoadConn_tris[0] = 0;
                RoadConn_tris[1] = 2;
                RoadConn_tris[2] = 1;
                RoadConn_tris[3] = 2;
                RoadConn_tris[4] = 3;
                RoadConn_tris[5] = 1;

                Vector3[] RoadConn_normals = new Vector3[4];
                RoadConn_normals[0] = -Vector3.forward;
                RoadConn_normals[1] = -Vector3.forward;
                RoadConn_normals[2] = -Vector3.forward;
                RoadConn_normals[3] = -Vector3.forward;
                Vector2[] RoadConn_uv = new Vector2[4];
                float tMod = (RoadWidth / tSpline.SpecialEndNodeDelay_End_Result)/2f;
                RoadConn_uv[0] = new Vector2(tMod,0f);
                RoadConn_uv[1] = new Vector2(tMod*3f,0f);
                RoadConn_uv[2] = new Vector2(0f,1f);
                RoadConn_uv[3] = new Vector2(1f,1f);
                tRoad.RCS.RoadConnections_verts.Add(RoadConn_verts);
                tRoad.RCS.RoadConnections_tris.Add(RoadConn_tris);
                tRoad.RCS.RoadConnections_normals.Add(RoadConn_normals);
                tRoad.RCS.RoadConnections_uv.Add(RoadConn_uv);
            }
            if(tRoad.bProfiling){ Profiler.EndSample(); }
        }
        private static void RoadJob_Prelim_Inter(ref GSDRoad tRoad)
        {
            GSDSplineC tSpline = tRoad.GSDSpline;
            float RoadWidth = tRoad.RoadWidth();
            float ShoulderWidth = tRoad.opt_ShoulderWidth;
            float RoadSeperation = RoadWidth / 2f;
            float RoadSeperation_NoTurn = RoadWidth / 2f;
            float ShoulderSeperation = RoadSeperation + ShoulderWidth;	if(ShoulderSeperation < 0f){ }
            float LaneWidth = tRoad.opt_LaneWidth;
            float RoadSep1Lane = (RoadSeperation + (LaneWidth*0.5f));
            float RoadSep2Lane = (RoadSeperation + (LaneWidth*1.5f));
            Vector3 POS = default(Vector3);
            bool bIsPastInter = false;
            bool bOldMethod = false;
            //bool bCancel = false; if (bTempCancel) { }
            bool bTempCancel = false; if (bTempCancel) { }

            //If left collides with left, etc

            //This will speed up later calculations for intersection 4 corner construction:
            int mCount = tSpline.GetNodeCount();
            float PreInter_RoadWidthMod = 4.5f;
            if(!bOldMethod){
                PreInter_RoadWidthMod = 5.5f;
            }
            float preInterDistance = (tSpline.RoadWidth*PreInter_RoadWidthMod) / tSpline.distance;
            GSDSplineN iNode = null;
            for(int j=0;j<mCount;j++){
                bTempCancel = false;
                if(tSpline.mNodes[j].bIsIntersection){
                    iNode = tSpline.mNodes[j];
                    //First node set min / max float:
                    if(iNode.iConstruction == null){ iNode.iConstruction = new GSD.Roads.GSDIntersections.iConstructionMaker(); }
                    if(!iNode.iConstruction.tempconstruction_HasProcessed_Inter1){
                        preInterDistance = (iNode.GSDSpline.RoadWidth*PreInter_RoadWidthMod) / iNode.GSDSpline.distance;
                        iNode.iConstruction.tempconstruction_InterStart = iNode.tTime - preInterDistance;
                     	iNode.iConstruction.tempconstruction_InterEnd = iNode.tTime + preInterDistance;
                        if(iNode.iConstruction.tempconstruction_InterStart > 1f){ iNode.iConstruction.tempconstruction_InterStart = 1f; }
                        if(iNode.iConstruction.tempconstruction_InterStart < 0f){ iNode.iConstruction.tempconstruction_InterStart = 0f; }
                        if(iNode.iConstruction.tempconstruction_InterEnd > 1f){ iNode.iConstruction.tempconstruction_InterEnd = 1f; }
                        if(iNode.iConstruction.tempconstruction_InterEnd < 0f){ iNode.iConstruction.tempconstruction_InterEnd = 0f; }
                        iNode.iConstruction.tempconstruction_HasProcessed_Inter1 = true;
                    }

                    if(string.Compare(iNode.UID,iNode.GSDRI.Node1.UID) == 0){
                        iNode = iNode.GSDRI.Node2;
                    }else{
                        iNode = iNode.GSDRI.Node1;
                    }

                    //Grab other intersection node and set min / max float
                    try{
                        if(!iNode.iConstruction.tempconstruction_HasProcessed_Inter1){
                            preInterDistance = (iNode.GSDSpline.RoadWidth*PreInter_RoadWidthMod) / iNode.GSDSpline.distance;
                            iNode.iConstruction.tempconstruction_InterStart = iNode.tTime - preInterDistance;
                         	iNode.iConstruction.tempconstruction_InterEnd = iNode.tTime + preInterDistance;
                            if(iNode.iConstruction.tempconstruction_InterStart > 1f){ iNode.iConstruction.tempconstruction_InterStart = 1f; }
                            if(iNode.iConstruction.tempconstruction_InterStart < 0f){ iNode.iConstruction.tempconstruction_InterStart = 0f; }
                            if(iNode.iConstruction.tempconstruction_InterEnd > 1f){ iNode.iConstruction.tempconstruction_InterEnd = 1f; }
                            if(iNode.iConstruction.tempconstruction_InterEnd < 0f){ iNode.iConstruction.tempconstruction_InterEnd = 0f; }
                            iNode.iConstruction.tempconstruction_HasProcessed_Inter1 = true;
                        }
                    }catch{
                        //Do nothing
                    }
                }
            }

            //Now get the four points per intersection:
            GSDSplineN oNode1 = null;
            GSDSplineN oNode2 = null;
            float PreInterPrecision1 = -1f;
            float PreInterPrecision2 = -1f;
            Vector3 PreInterVect = default(Vector3);
            Vector3 PreInterVectR = default(Vector3);
            Vector3 PreInterVectR_RightTurn = default(Vector3);
            Vector3 PreInterVectL = default(Vector3);
            Vector3 PreInterVectL_RightTurn = default(Vector3);
            GSDRoadIntersection GSDRI = null;

            for(int j=0;j<mCount;j++){
                oNode1 = tSpline.mNodes[j];
                if(oNode1.bIsIntersection){
                    oNode1 = oNode1.GSDRI.Node1;
                    oNode2 = oNode1.GSDRI.Node2;
                    if(bOldMethod){
                        PreInterPrecision1 = 0.1f / oNode1.GSDSpline.distance;
                        PreInterPrecision2 = 0.1f / oNode2.GSDSpline.distance;
                    }else{
                        PreInterPrecision1 = 4f / oNode1.GSDSpline.distance;
                        PreInterPrecision2 = 4f / oNode2.GSDSpline.distance;
                    }
                    GSDRI = oNode1.GSDRI;
                    try{
                        if(oNode1.iConstruction.tempconstruction_HasProcessed_Inter2 && oNode2.iConstruction.tempconstruction_HasProcessed_Inter2){
                            continue;
                        }
                    }catch{
                        continue;
                    }
                    GSDRI = oNode1.GSDRI;
                    GSDRI.CornerRR1 = false;
                    GSDRI.CornerRR2 = false;
                    GSDRI.CornerRL1 = false;
                    GSDRI.CornerRL2 = false;
                    GSDRI.CornerLR1 = false;
                    GSDRI.CornerLR2 = false;
                    GSDRI.CornerLL1 = false;
                    GSDRI.CornerLL2 = false;

                    if(!oNode1.iConstruction.tempconstruction_HasProcessed_Inter2){
                        oNode1.iConstruction.tempconstruction_R = new List<Vector2>();
                        oNode1.iConstruction.tempconstruction_L = new List<Vector2>();
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            oNode1.iConstruction.tempconstruction_R_RightTurn = new List<Vector2>();
                            oNode1.iConstruction.tempconstruction_L_RightTurn = new List<Vector2>();
                        }

                        for(float i=oNode1.iConstruction.tempconstruction_InterStart;i<oNode1.iConstruction.tempconstruction_InterEnd;i+=PreInterPrecision1){
                            oNode1.GSDSpline.GetSplineValue_Both(i,out PreInterVect,out POS);

                            bIsPastInter = oNode1.GSDSpline.IntersectionIsPast(ref i,ref oNode1);
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                if(bIsPastInter){
                                    PreInterVectR = (PreInterVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                                    PreInterVectL = (PreInterVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));
                                }else{
                                    PreInterVectR = (PreInterVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                                    PreInterVectL = (PreInterVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                                }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                PreInterVectR = (PreInterVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                                PreInterVectL = (PreInterVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                            }else{
                                PreInterVectR = (PreInterVect + new Vector3(RoadSeperation_NoTurn*POS.normalized.z,0,RoadSeperation_NoTurn*-POS.normalized.x));
                                PreInterVectL = (PreInterVect + new Vector3(RoadSeperation_NoTurn*-POS.normalized.z,0,RoadSeperation_NoTurn*POS.normalized.x));
                            }

                            oNode1.iConstruction.tempconstruction_R.Add(new Vector2(PreInterVectR.x,PreInterVectR.z));
                            oNode1.iConstruction.tempconstruction_L.Add(new Vector2(PreInterVectL.x,PreInterVectL.z));

                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                PreInterVectR_RightTurn = (PreInterVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                                oNode1.iConstruction.tempconstruction_R_RightTurn.Add(ConvertVect3_To_Vect2(PreInterVectR_RightTurn));

                                PreInterVectL_RightTurn = (PreInterVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));
                                oNode1.iConstruction.tempconstruction_L_RightTurn.Add(ConvertVect3_To_Vect2(PreInterVectL_RightTurn));
                            }
                        }
                    }

                    //Process second node:
                    if(oNode2.iConstruction == null){ oNode2.iConstruction = new GSD.Roads.GSDIntersections.iConstructionMaker(); }
                    if(!oNode2.iConstruction.tempconstruction_HasProcessed_Inter2){
                        oNode2.iConstruction.tempconstruction_R = new List<Vector2>();
                        oNode2.iConstruction.tempconstruction_L = new List<Vector2>();
                        if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                            oNode2.iConstruction.tempconstruction_R_RightTurn = new List<Vector2>();
                            oNode2.iConstruction.tempconstruction_L_RightTurn = new List<Vector2>();
                        }

                        for(float i=oNode2.iConstruction.tempconstruction_InterStart;i<oNode2.iConstruction.tempconstruction_InterEnd;i+=PreInterPrecision2){
                            oNode2.GSDSpline.GetSplineValue_Both(i,out PreInterVect,out POS);

                            bIsPastInter = oNode2.GSDSpline.IntersectionIsPast(ref i,ref oNode2);
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                if(bIsPastInter){
                                    PreInterVectR = (PreInterVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                                    PreInterVectL = (PreInterVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));
                                }else{
                                    PreInterVectR = (PreInterVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                                    PreInterVectL = (PreInterVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                                }
                            }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                                PreInterVectR = (PreInterVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                                PreInterVectL = (PreInterVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                            }else{
                                PreInterVectR = (PreInterVect + new Vector3(RoadSeperation_NoTurn*POS.normalized.z,0,RoadSeperation_NoTurn*-POS.normalized.x));
                                PreInterVectL = (PreInterVect + new Vector3(RoadSeperation_NoTurn*-POS.normalized.z,0,RoadSeperation_NoTurn*POS.normalized.x));
                            }

                            oNode2.iConstruction.tempconstruction_R.Add(new Vector2(PreInterVectR.x,PreInterVectR.z));
                            oNode2.iConstruction.tempconstruction_L.Add(new Vector2(PreInterVectL.x,PreInterVectL.z));
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                PreInterVectR_RightTurn = (PreInterVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                                oNode2.iConstruction.tempconstruction_R_RightTurn.Add(ConvertVect3_To_Vect2(PreInterVectR_RightTurn));

                                PreInterVectL_RightTurn = (PreInterVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));
                                oNode2.iConstruction.tempconstruction_L_RightTurn.Add(ConvertVect3_To_Vect2(PreInterVectL_RightTurn));
                            }
                        }
                    }

                    bool bFlipped = false;
                    bool bFlippedSet = false;
                    int hCount1 = oNode1.iConstruction.tempconstruction_R.Count;
                    int hCount2 = oNode2.iConstruction.tempconstruction_R.Count;
                    int N1RCount = oNode1.iConstruction.tempconstruction_R.Count;
                    int N1LCount = oNode1.iConstruction.tempconstruction_L.Count;
                    int N2RCount = oNode2.iConstruction.tempconstruction_R.Count;
                    int N2LCount = oNode2.iConstruction.tempconstruction_L.Count;

                    int[] tCounts = new int[4];
                    tCounts[0] = N1RCount;
                    tCounts[1] = N1LCount;
                    tCounts[2] = N2RCount;
                    tCounts[3] = N2LCount;

                    //RR:
                    int MaxCount = -1;
                    MaxCount = Mathf.Max(N2RCount,N2LCount);
                    for(int h=0;h<hCount1;h++){
                        for(int k=0;k<MaxCount;k++){
                            if(k < N2RCount){
                                if(Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_R[k]) < tRoad.opt_RoadDefinition){
                                    bFlipped = false;
                                    bFlippedSet = true;
                                    break;
                                }
                            }
                            if(k < N2LCount){
                                if(Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_L[k]) < tRoad.opt_RoadDefinition){
                                    bFlipped = true;
                                    bFlippedSet = true;
                                    break;
                                }
                            }
                        }
                        if(bFlippedSet){ break; }
                    }
                    oNode1.GSDRI.bFlipped = bFlipped;

                    //Three-way intersections lane specifics:
                    GSDRI.bNode2B_LeftTurnLane = true;
                    GSDRI.bNode2B_RightTurnLane = true;
                    GSDRI.bNode2F_LeftTurnLane = true;
                    GSDRI.bNode2F_RightTurnLane = true;

                    //Three-way intersections:
                    GSDRI.IgnoreSide = -1;
                    GSDRI.IgnoreCorner = -1;
                    GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.FourWay;
                    if(GSDRI.bFirstSpecial_First){
                        GSDRI.IgnoreSide = 3;
                        GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                        if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                            GSDRI.IgnoreCorner = 0;
                        }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                            GSDRI.IgnoreCorner = 1;
                        }

                        if(!oNode1.GSDRI.bFlipped){
                            GSDRI.bNode2F_LeftTurnLane = false;
                            GSDRI.bNode2B_RightTurnLane = false;
                        }else{
                            GSDRI.bNode2B_LeftTurnLane = false;
                            GSDRI.bNode2F_RightTurnLane = false;
                        }

                    }else if(GSDRI.bFirstSpecial_Last){
                        GSDRI.IgnoreSide = 1;
                        GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                        if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                            GSDRI.IgnoreCorner = 2;
                        }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                            GSDRI.IgnoreCorner = 3;
                        }

                        if(!oNode1.GSDRI.bFlipped){
                            GSDRI.bNode2B_LeftTurnLane = false;
                            GSDRI.bNode2F_RightTurnLane = false;
                        }else{
                            GSDRI.bNode2F_LeftTurnLane = false;
                            GSDRI.bNode2B_RightTurnLane = false;
                        }

                    }
                    if(!bFlipped){
                        if(GSDRI.bSecondSpecial_First){
                            GSDRI.IgnoreSide = 2;
                            GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                            if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                                GSDRI.IgnoreCorner = 3;
                            }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                                GSDRI.IgnoreCorner = 0;
                            }

                            if(!oNode1.GSDRI.bFlipped){
                                GSDRI.bNode2B_LeftTurnLane = false;
                                GSDRI.bNode2F_RightTurnLane = false;
                            }else{
                                GSDRI.bNode2F_LeftTurnLane = false;
                                GSDRI.bNode2B_RightTurnLane = false;
                            }

                        }else if(GSDRI.bSecondSpecial_Last){
                            GSDRI.IgnoreSide = 0;
                            GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                            if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                                GSDRI.IgnoreCorner = 1;
                            }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                                GSDRI.IgnoreCorner = 2;
                            }

                            if(!oNode1.GSDRI.bFlipped){
                                GSDRI.bNode2B_LeftTurnLane = false;
                                GSDRI.bNode2F_RightTurnLane = false;
                            }else{
                                GSDRI.bNode2F_LeftTurnLane = false;
                                GSDRI.bNode2B_RightTurnLane = false;
                            }

                        }
                    }else{
                        if(GSDRI.bSecondSpecial_First){
                            GSDRI.IgnoreSide = 0;
                            GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                            if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                                GSDRI.IgnoreCorner = 1;
                            }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                                GSDRI.IgnoreCorner = 2;
                            }

                            if(!oNode1.GSDRI.bFlipped){
                                GSDRI.bNode2B_LeftTurnLane = false;
                                GSDRI.bNode2F_RightTurnLane = false;
                            }else{
                                GSDRI.bNode2F_LeftTurnLane = false;
                                GSDRI.bNode2B_RightTurnLane = false;
                            }

                        }else if(GSDRI.bSecondSpecial_Last){
                            GSDRI.IgnoreSide = 2;
                            GSDRI.iType = GSDRoadIntersection.IntersectionTypeEnum.ThreeWay;
                            if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.StopSign_AllWay){
                                GSDRI.IgnoreCorner = 3;
                            }else if(GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight1 || GSDRI.iStopType == GSDRoadIntersection.iStopTypeEnum.TrafficLight2){
                                GSDRI.IgnoreCorner = 0;
                            }

                            if(!oNode1.GSDRI.bFlipped){
                                GSDRI.bNode2B_LeftTurnLane = false;
                                GSDRI.bNode2F_RightTurnLane = false;
                            }else{
                                GSDRI.bNode2F_LeftTurnLane = false;
                                GSDRI.bNode2B_RightTurnLane = false;
                            }
                        }
                    }

                    //Find corners:
                    Vector2 tFoundVectRR = default(Vector2);
                    Vector2 tFoundVectRL = default(Vector2);
                    Vector2 tFoundVectLR = default(Vector2);
                    Vector2 tFoundVectLL = default(Vector2);
                    if(!bOldMethod){
                        //RR:
                        if(!bFlipped){
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectRR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R_RightTurn, ref oNode2.iConstruction.tempconstruction_R);
                            }else{
                                tFoundVectRR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_R);
                            }
                        }else{
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectRR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R_RightTurn, ref oNode2.iConstruction.tempconstruction_L);
                            }else{
                                tFoundVectRR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_L);
                            }
                        }

                        //RL:
                        if(!bFlipped){
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectRL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_L_RightTurn);
                            }else{
                                tFoundVectRL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_L);
                            }
                        }else{
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectRL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_R_RightTurn);
                            }else{
                                tFoundVectRL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_R, ref oNode2.iConstruction.tempconstruction_R);
                            }
                        }

                        //LL:
                        if(!bFlipped){
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectLL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L_RightTurn, ref oNode2.iConstruction.tempconstruction_L);
                            }else{
                                tFoundVectLL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_L);
                            }
                        }else{
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectLL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L_RightTurn, ref oNode2.iConstruction.tempconstruction_R);
                            }else{
                                tFoundVectLL = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_R);
                            }
                        }

                        //LR:
                        if(!bFlipped){
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectLR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_R_RightTurn);
                            }else{
                                tFoundVectLR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_R);
                            }
                        }else{
                            if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                                tFoundVectLR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_L_RightTurn);
                            }else{
                                tFoundVectLR = IntersectionCornerCalc(ref oNode1.iConstruction.tempconstruction_L, ref oNode2.iConstruction.tempconstruction_L);
                            }
                        }
                    }else{
                        //Now two lists of R and L on each intersection node, now match:
                        float eDistanceRR = 5000f;
                        float oDistanceRR = 0f;
                        float eDistanceRL = 5000f;
                        float oDistanceRL = 0f;
                        float eDistanceLR = 5000f;
                        float oDistanceLR = 0f;
                        float eDistanceLL = 5000f;
                        float oDistanceLL = 0f;
                        bool bHasBeen1mRR = false;
                        bool bHasBeen1mRL = false;
                        bool bHasBeen1mLR = false;
                        bool bHasBeen1mLL = false;
                        bool bHasBeen1mRR_ignore = false;
                        bool bHasBeen1mRL_ignore = false;
                        bool bHasBeen1mLR_ignore = false;
                        bool bHasBeen1mLL_ignore = false;
                        bool bHasBeen1mRR_ignore_Max = false;
                        bool bHasBeen1mRL_ignore_Max = false;
                        bool bHasBeen1mLR_ignore_Max = false;
                        bool bHasBeen1mLL_ignore_Max = false;
                        float mMin = 0.2f;
                        float mMax = 0.5f;

                        MaxCount = Mathf.Max(tCounts);
                        int MaxHCount = Mathf.Max(hCount1,hCount2);
                        for(int h=0;h<MaxHCount;h++){
                            bHasBeen1mRR = false;
                            bHasBeen1mRL = false;
                            bHasBeen1mLR = false;
                            bHasBeen1mLL = false;
                            bHasBeen1mRR_ignore = false;
                            bHasBeen1mRL_ignore = false;
                            bHasBeen1mLR_ignore = false;
                            bHasBeen1mLL_ignore = false;
                            for(int k=0;k<MaxCount;k++){
                                if(!bFlipped){
                                    //RR:
                                    if(!bHasBeen1mRR_ignore_Max && !bHasBeen1mRR_ignore && (h < N1RCount && k < N2RCount)){
                                        oDistanceRR = Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_R[k]);
                                        if(oDistanceRR < eDistanceRR){
                                            eDistanceRR = oDistanceRR;
                                            tFoundVectRR = oNode1.iConstruction.tempconstruction_R[h]; //RR
                                            if(eDistanceRR < 0.07f){ bHasBeen1mRR_ignore_Max = true; }
                                        }
                                        if(oDistanceRR > mMax && bHasBeen1mRR){ bHasBeen1mRR_ignore = true; }
                                        if(oDistanceRR < mMin){ bHasBeen1mRR = true; }
                                    }
                                    //RL:
                                    if(!bHasBeen1mRL_ignore_Max && !bHasBeen1mRL_ignore && (h < N1RCount && k < N2LCount)){
                                        oDistanceRL = Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_L[k]);
                                        if(oDistanceRL < eDistanceRL){
                                            eDistanceRL = oDistanceRL;
                                            tFoundVectRL = oNode1.iConstruction.tempconstruction_R[h]; //RL
                                            if(eDistanceRL < 0.07f){ bHasBeen1mRL_ignore_Max = true; }
                                        }
                                        if(oDistanceRL > mMax && bHasBeen1mRL){ bHasBeen1mRL_ignore = true; }
                                        if(oDistanceRL < mMin){ bHasBeen1mRL = true; }
                                    }
                                    //LR:
                                    if(!bHasBeen1mLR_ignore_Max && !bHasBeen1mLR_ignore && (h < N1LCount && k < N2RCount)){
                                        oDistanceLR = Vector2.Distance(oNode1.iConstruction.tempconstruction_L[h],oNode2.iConstruction.tempconstruction_R[k]);
                                        if(oDistanceLR < eDistanceLR){
                                            eDistanceLR = oDistanceLR;
                                            tFoundVectLR = oNode1.iConstruction.tempconstruction_L[h]; //LR
                                            if(eDistanceLR < 0.07f){ bHasBeen1mLR_ignore_Max = true; }
                                        }
                                        if(oDistanceLR > mMax && bHasBeen1mLR){ bHasBeen1mLR_ignore = true; }
                                        if(oDistanceLR < mMin){ bHasBeen1mLR = true; }
                                    }
                                    //LL:
                                    if(!bHasBeen1mLL_ignore_Max && !bHasBeen1mLL_ignore && (h < N1LCount && k < N2LCount)){
                                        oDistanceLL = Vector2.Distance(oNode1.iConstruction.tempconstruction_L[h],oNode2.iConstruction.tempconstruction_L[k]);
                                        if(oDistanceLL < eDistanceLL){
                                            eDistanceLL = oDistanceLL;
                                            tFoundVectLL = oNode1.iConstruction.tempconstruction_L[h]; //LL
                                            if(eDistanceLL < 0.07f){ bHasBeen1mLL_ignore_Max = true; }
                                        }
                                        if(oDistanceLL > mMax && bHasBeen1mLL){ bHasBeen1mLL_ignore = true; }
                                        if(oDistanceLL < mMin){ bHasBeen1mLL = true; }
                                    }
                                }else{
                                    //RR:
                                    if(!bHasBeen1mRR_ignore_Max && !bHasBeen1mRR_ignore && (h < N1RCount && k < N2LCount)){
                                        oDistanceRR = Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_L[k]);
                                        if(oDistanceRR < eDistanceRR){
                                            eDistanceRR = oDistanceRR;
                                            tFoundVectRR = oNode1.iConstruction.tempconstruction_R[h]; //RR
                                            if(eDistanceRR < 0.07f){ bHasBeen1mRR_ignore_Max = true; }
                                        }
                                        if(oDistanceRR > mMax && bHasBeen1mRR){ bHasBeen1mRR_ignore = true; }
                                        if(oDistanceRR < mMin){ bHasBeen1mRR = true; }
                                    }
                                    //RL:
                                    if(!bHasBeen1mRL_ignore_Max && !bHasBeen1mRL_ignore && (h < N1RCount && k < N2RCount)){
                                        oDistanceRL = Vector2.Distance(oNode1.iConstruction.tempconstruction_R[h],oNode2.iConstruction.tempconstruction_R[k]);
                                        if(oDistanceRL < eDistanceRL){
                                            eDistanceRL = oDistanceRL;
                                            tFoundVectRL = oNode1.iConstruction.tempconstruction_R[h]; //RL
                                            if(eDistanceRL < 0.07f){ bHasBeen1mRL_ignore_Max = true; }
                                        }
                                        if(oDistanceRL > mMax && bHasBeen1mRL){ bHasBeen1mRL_ignore = true; }
                                        if(oDistanceRL < mMin){ bHasBeen1mRL = true; }
                                    }
                                    //LR:
                                    if(!bHasBeen1mLR_ignore_Max && !bHasBeen1mLR_ignore && (h < N1LCount && k < N2LCount)){
                                        oDistanceLR = Vector2.Distance(oNode1.iConstruction.tempconstruction_L[h],oNode2.iConstruction.tempconstruction_L[k]);
                                        if(oDistanceLR < eDistanceLR){
                                            eDistanceLR = oDistanceLR;
                                            tFoundVectLR = oNode1.iConstruction.tempconstruction_L[h]; //LR
                                            if(eDistanceLR < 0.07f){ bHasBeen1mLR_ignore_Max = true; }
                                        }
                                        if(oDistanceLR > mMax && bHasBeen1mLR){ bHasBeen1mLR_ignore = true; }
                                        if(oDistanceLR < mMin){ bHasBeen1mLR = true; }
                                    }
                                    //LL:
                                    if(!bHasBeen1mLL_ignore_Max && !bHasBeen1mLL_ignore && (h < N1LCount && k < N2RCount)){
                                        oDistanceLL = Vector2.Distance(oNode1.iConstruction.tempconstruction_L[h],oNode2.iConstruction.tempconstruction_R[k]);
                                        if(oDistanceLL < eDistanceLL){
                                            eDistanceLL = oDistanceLL;
                                            tFoundVectLL = oNode1.iConstruction.tempconstruction_L[h]; //LL
                                            if(eDistanceLL < 0.07f){ bHasBeen1mLL_ignore_Max = true; }
                                        }
                                        if(oDistanceLL > mMax && bHasBeen1mLL){ bHasBeen1mLL_ignore = true; }
                                        if(oDistanceLL < mMin){ bHasBeen1mLL = true; }
                                    }
                                }
                            }
                        }
                    }

                    oNode1.iConstruction.tempconstruction_HasProcessed_Inter2 = true;
                    oNode2.iConstruction.tempconstruction_HasProcessed_Inter2 = true;

                    Vector3 tVectRR = new Vector3(tFoundVectRR.x,0f,tFoundVectRR.y);
                    Vector3 tVectRL = new Vector3(tFoundVectRL.x,0f,tFoundVectRL.y);
                    Vector3 tVectLR = new Vector3(tFoundVectLR.x,0f,tFoundVectLR.y);
                    Vector3 tVectLL = new Vector3(tFoundVectLL.x,0f,tFoundVectLL.y);

                    oNode1.GSDRI.CornerRR = tVectRR;
                    oNode1.GSDRI.CornerRL = tVectRL;
                    oNode1.GSDRI.CornerLR = tVectLR;
                    oNode1.GSDRI.CornerLL = tVectLL;

                    float[] tMaxFloats = new float[4];
                    tMaxFloats[0] = Vector3.Distance(((tVectRR-tVectRL)*0.5f)+tVectRL,oNode1.pos) * 1.25f;
                    tMaxFloats[1] = Vector3.Distance(((tVectRR-tVectLR)*0.5f)+tVectLR,oNode1.pos) * 1.25f;
                    tMaxFloats[2] = Vector3.Distance(((tVectRL-tVectLL)*0.5f)+tVectLL,oNode1.pos) * 1.25f;
                    tMaxFloats[3] = Vector3.Distance(((tVectLR-tVectLL)*0.5f)+tVectLL,oNode1.pos) * 1.25f;
                    GSDRI.MaxInterDistance = Mathf.Max(tMaxFloats);

                    float[] tMaxFloatsSQ = new float[4];
                    tMaxFloatsSQ[0] = Vector3.SqrMagnitude((((tVectRR-tVectRL)*0.5f)+tVectRL)-oNode1.pos) * 1.25f;
                    tMaxFloatsSQ[1] = Vector3.SqrMagnitude((((tVectRR-tVectLR)*0.5f)+tVectLR)-oNode1.pos) * 1.25f;
                    tMaxFloatsSQ[2] = Vector3.SqrMagnitude((((tVectRL-tVectLL)*0.5f)+tVectLL)-oNode1.pos) * 1.25f;
                    tMaxFloatsSQ[3] = Vector3.SqrMagnitude((((tVectLR-tVectLL)*0.5f)+tVectLL)-oNode1.pos) * 1.25f;
                    GSDRI.MaxInterDistanceSQ = Mathf.Max(tMaxFloatsSQ);

                    float TotalLanes = (int)(RoadWidth/LaneWidth);
                    float TotalLanesI = TotalLanes;
                    float LanesPerSide = TotalLanes/2f;

                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                        TotalLanesI = TotalLanes + 2f;
                        //Lower left to lower right:
                        GSDRI.fCornerLR_CornerRR = new Vector3[5];
                        GSDRI.fCornerLR_CornerRR[0] = tVectLR;
                        GSDRI.fCornerLR_CornerRR[1] = ((tVectRR - tVectLR)*(LanesPerSide/TotalLanesI))+tVectLR;
                        GSDRI.fCornerLR_CornerRR[2] = ((tVectRR - tVectLR)*((LanesPerSide+1)/TotalLanesI))+tVectLR;
                        GSDRI.fCornerLR_CornerRR[3] = ((tVectRR - tVectLR)*((LanesPerSide+1+LanesPerSide)/TotalLanesI))+tVectLR;
                        GSDRI.fCornerLR_CornerRR[4] = tVectRR;
                        //Upper right to lower right:
                        GSDRI.fCornerRL_CornerRR = new Vector3[5];
                        GSDRI.fCornerRL_CornerRR[0] = tVectRL;
                        GSDRI.fCornerRL_CornerRR[1] = ((tVectRR - tVectRL)*(1/TotalLanesI))+tVectRL;
                        GSDRI.fCornerRL_CornerRR[2] = ((tVectRR - tVectRL)*((LanesPerSide+1)/TotalLanesI))+tVectRL;
                        GSDRI.fCornerRL_CornerRR[3] = ((tVectRR - tVectRL)*((LanesPerSide+2)/TotalLanesI))+tVectRL;
                        GSDRI.fCornerRL_CornerRR[4] = tVectRR;
                        //Upper left to upper right:
                        GSDRI.fCornerLL_CornerRL = new Vector3[5];
                        GSDRI.fCornerLL_CornerRL[0] = tVectLL;
                        GSDRI.fCornerLL_CornerRL[1] = ((tVectRL - tVectLL)*(1/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerRL[2] = ((tVectRL - tVectLL)*((LanesPerSide+1)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerRL[3] = ((tVectRL - tVectLL)*((LanesPerSide+2)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerRL[4] = tVectRL;
                        //Upper left to lower left:
                        GSDRI.fCornerLL_CornerLR = new Vector3[5];
                        GSDRI.fCornerLL_CornerLR[0] = tVectLL;
                        GSDRI.fCornerLL_CornerLR[1] = ((tVectLR - tVectLL)*(LanesPerSide/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerLR[2] = ((tVectLR - tVectLL)*((LanesPerSide+1)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerLR[3] = ((tVectLR - tVectLL)*((LanesPerSide+1+LanesPerSide)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerLR[4] = tVectLR;
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                        TotalLanesI = TotalLanes + 1;
                        //Lower left to lower right:
                        GSDRI.fCornerLR_CornerRR = new Vector3[4];
                        GSDRI.fCornerLR_CornerRR[0] = tVectLR;
                        GSDRI.fCornerLR_CornerRR[1] = ((tVectRR - tVectLR)*(LanesPerSide/TotalLanesI))+tVectLR;
                        GSDRI.fCornerLR_CornerRR[2] = ((tVectRR - tVectLR)*((LanesPerSide+1)/TotalLanesI))+tVectLR;
                        GSDRI.fCornerLR_CornerRR[3] = tVectRR;
                        //Upper right to lower right:
                        GSDRI.fCornerRL_CornerRR = new Vector3[4];
                        GSDRI.fCornerRL_CornerRR[0] = tVectRL;
                        GSDRI.fCornerRL_CornerRR[1] = ((tVectRR - tVectRL)*(LanesPerSide/TotalLanesI))+tVectRL;
                        GSDRI.fCornerRL_CornerRR[2] = ((tVectRR - tVectRL)*((LanesPerSide+1)/TotalLanesI))+tVectRL;
                        GSDRI.fCornerRL_CornerRR[3] = tVectRR;
                        //Upper left to upper right:
                        GSDRI.fCornerLL_CornerRL = new Vector3[4];
                        GSDRI.fCornerLL_CornerRL[0] = tVectLL;
                        GSDRI.fCornerLL_CornerRL[1] = ((tVectRL - tVectLL)*(LanesPerSide/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerRL[2] = ((tVectRL - tVectLL)*((LanesPerSide+1)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerRL[3] = tVectRL;
                        //Upper left to lower left:
                        GSDRI.fCornerLL_CornerLR = new Vector3[4];
                        GSDRI.fCornerLL_CornerLR[0] = tVectLL;
                        GSDRI.fCornerLL_CornerLR[1] = ((tVectLR - tVectLL)*(LanesPerSide/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerLR[2] = ((tVectLR - tVectLL)*((LanesPerSide+1)/TotalLanesI))+tVectLL;
                        GSDRI.fCornerLL_CornerLR[3] = tVectLR;
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                        TotalLanesI = TotalLanes + 0;
                        //Lower left to lower right:
                        GSDRI.fCornerLR_CornerRR = new Vector3[3];
                        GSDRI.fCornerLR_CornerRR[0] = tVectLR;
                        GSDRI.fCornerLR_CornerRR[1] = ((tVectRR - tVectLR)*0.5f)+tVectLR;
                        GSDRI.fCornerLR_CornerRR[2] = tVectRR;
                        //Upper right to lower right:
                        GSDRI.fCornerRL_CornerRR = new Vector3[3];
                        GSDRI.fCornerRL_CornerRR[0] = tVectRL;
                        GSDRI.fCornerRL_CornerRR[1] = ((tVectRR - tVectRL)*0.5f)+tVectRL;
                        GSDRI.fCornerRL_CornerRR[2] = tVectRR;
                        //Upper left to upper right:
                        GSDRI.fCornerLL_CornerRL = new Vector3[3];
                        GSDRI.fCornerLL_CornerRL[0] = tVectLL;
                        GSDRI.fCornerLL_CornerRL[1] = ((tVectRL - tVectLL)*0.5f)+tVectLL;
                        GSDRI.fCornerLL_CornerRL[2] = tVectRL;
                        //Upper left to lower left:
                        GSDRI.fCornerLL_CornerLR = new Vector3[3];
                        GSDRI.fCornerLL_CornerLR[0] = tVectLL;
                        GSDRI.fCornerLL_CornerLR[1] = ((tVectLR - tVectLL)*0.5f)+tVectLL;
                        GSDRI.fCornerLL_CornerLR[2] = tVectLR;
                    }

                    //Use node1/node2 for angles instead
                    float tShoulderWidth = ShoulderWidth * 1.75f;
                    float tRampWidth = ShoulderWidth * 2f;

                    oNode1.GSDRI.OddAngle = Vector3.Angle(GSDRI.Node2.tangent,GSDRI.Node1.tangent);
                    oNode1.GSDRI.EvenAngle = 180f - Vector3.Angle(GSDRI.Node2.tangent,GSDRI.Node1.tangent);

                 	GSD.Roads.GSDIntersectionObjects.GetFourPoints(GSDRI,out GSDRI.CornerRR_Outer, out GSDRI.CornerRL_Outer, out GSDRI.CornerLL_Outer, out GSDRI.CornerLR_Outer, tShoulderWidth);
                    GSD.Roads.GSDIntersectionObjects.GetFourPoints(GSDRI,out GSDRI.CornerRR_RampOuter, out GSDRI.CornerRL_RampOuter, out GSDRI.CornerLL_RampOuter, out GSDRI.CornerLR_RampOuter, tRampWidth);

                    GSDRI.ConstructBoundsRect();
                    GSDRI.CornerRR_2D = new Vector2(tVectRR.x,tVectRR.z);
                    GSDRI.CornerRL_2D = new Vector2(tVectRL.x,tVectRL.z);
                    GSDRI.CornerLL_2D = new Vector2(tVectLL.x,tVectLL.z);
                    GSDRI.CornerLR_2D = new Vector2(tVectLR.x,tVectLR.z);

                    if(!oNode1.GSDRI.bSameSpline){
                        if(string.Compare(tRoad.GSDSpline.UID,oNode1.GSDSpline.tRoad.GSDSpline.UID) != 0){
                            AddIntersectionBounds(ref oNode1.GSDSpline.tRoad, ref tRoad.RCS);
                        }else if(string.Compare(tRoad.GSDSpline.UID,oNode2.GSDSpline.tRoad.GSDSpline.UID) != 0){
                            AddIntersectionBounds(ref oNode2.GSDSpline.tRoad, ref tRoad.RCS);
                        }
                    }
                }
            }
        }
        private static void AddIntersectionBounds(ref GSDRoad tRoad, ref GSD.Roads.RoadConstructorBufferMaker RCS)
        {
            bool bIsBridge = false;
            bool bBridgeInitial = false; if(bBridgeInitial == false){ }
            bool bTempbridge = false;
            bool bBridgeLast = false; if(bBridgeLast == false){ }

            bool bIsTunnel = false;
            bool bTunnelInitial = false; if(bTunnelInitial == false){ }
            bool bTempTunnel = false;
            bool bTunnelLast = false; if(bTunnelLast == false){ }

            GSDRoadIntersection GSDRI = null;
            bool bIsPastInter = false;
            bool bMaxIntersection = false;
            bool bWasPrevMaxInter = false;
            Vector3 tVect = default(Vector3);
            Vector3 POS = default(Vector3);
            float tIntHeight = 0f;
            float tIntStrength = 0f;
            float tIntStrength_temp = 0f;
            //			float tIntDistCheck = 75f;
            bool bFirstInterNode = false;
            Vector3 tVect_Prev = default(Vector3); 		if(tVect_Prev == default(Vector3)){ }
            Vector3 rVect_Prev = default(Vector3); 		if(rVect_Prev == default(Vector3)){ }
            Vector3 lVect_Prev = default(Vector3); 		if(lVect_Prev == default(Vector3)){ }
            Vector3 rVect = default(Vector3);			if(rVect == default(Vector3)){ }
            Vector3 lVect = default(Vector3);			if(lVect == default(Vector3)){ }
            Vector3 ShoulderR_rVect = default(Vector3);	if(ShoulderR_rVect == default(Vector3)){ }
            Vector3 ShoulderR_lVect = default(Vector3);	if(ShoulderR_lVect == default(Vector3)){ }
            Vector3 ShoulderL_rVect = default(Vector3);	if(ShoulderL_rVect == default(Vector3)){ }
            Vector3 ShoulderL_lVect = default(Vector3);	if(ShoulderL_lVect == default(Vector3)){ }

            Vector3 RampR_R = default(Vector3);
            Vector3 RampR_L = default(Vector3);
            Vector3 RampL_R = default(Vector3);
            Vector3 RampL_L = default(Vector3);
            float ShoulderR_OuterAngle = 0f;	if(ShoulderR_OuterAngle < 0f){ }
            float ShoulderL_OuterAngle = 0f;	if(ShoulderL_OuterAngle < 0f){ }
            Vector3 ShoulderR_PrevLVect = default(Vector3); if(ShoulderR_PrevLVect == default(Vector3)){ }
            Vector3 ShoulderL_PrevRVect = default(Vector3); if(ShoulderL_PrevRVect == default(Vector3)){ }
            Vector3 ShoulderR_PrevRVect = default(Vector3); if(ShoulderR_PrevRVect == default(Vector3)){ }
            Vector3 ShoulderL_PrevLVect = default(Vector3); if(ShoulderL_PrevLVect == default(Vector3)){ }
            //			Vector3 ShoulderR_PrevRVect2 = default(Vector3);
            //			Vector3 ShoulderL_PrevLVect2 = default(Vector3);
            //			Vector3 ShoulderR_PrevRVect3 = default(Vector3);
            //			Vector3 ShoulderL_PrevLVect3 = default(Vector3);
            Vector3 RampR_PrevR = default(Vector3); if(RampR_PrevR == default(Vector3)){ }
            Vector3 RampR_PrevL = default(Vector3); if(RampR_PrevL == default(Vector3)){ }
            Vector3 RampL_PrevR = default(Vector3); if(RampL_PrevR == default(Vector3)){ }
            Vector3 RampL_PrevL = default(Vector3); if(RampL_PrevL == default(Vector3)){ }
            GSDSplineC tSpline = tRoad.GSDSpline;
            //Road width:
            float RoadWidth = tRoad.RoadWidth();
            float ShoulderWidth = tRoad.opt_ShoulderWidth;
            float RoadSeperation = RoadWidth / 2f;
            float RoadSeperation_NoTurn = RoadWidth / 2f;
            float ShoulderSeperation = RoadSeperation + ShoulderWidth;
            float LaneWidth = tRoad.opt_LaneWidth;
            float RoadSep1Lane = (RoadSeperation + (LaneWidth*0.5f));
            float RoadSep2Lane = (RoadSeperation + (LaneWidth*1.5f));
            float ShoulderSep1Lane = (ShoulderSeperation + (LaneWidth*0.5f));		if(ShoulderSep1Lane < 0f){ }
            float ShoulderSep2Lane = (ShoulderSeperation + (LaneWidth*1.5f));		if(ShoulderSep2Lane < 0f){ }

            //			float tAngle = 0f;
            //			float OrigStep = 0.06f;
            float Step = tRoad.opt_RoadDefinition / tSpline.distance;

            GSDSplineN xNode = null;
            float tInterSubtract = 4f;
            float tLastInterHeight = -4f;

            //			GameObject xObj = null;
            //			xObj = GameObject.Find("temp22");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp22");
            //			}
            //			xObj = GameObject.Find("temp23");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp23");
            //			}
            //			xObj = GameObject.Find("temp22_RR");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp22_RR");
            //			}
            //			xObj = GameObject.Find("temp22_RL");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp22_RL");
            //			}
            //			xObj = GameObject.Find("temp22_LR");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp22_LR");
            //			}
            //			xObj = GameObject.Find("temp22_LL");
            //			while(xObj != null){
            //				Object.DestroyImmediate(xObj);
            //				xObj = GameObject.Find("temp22_LL");
            //			}

            bool bFinalEnd = false;
            float i = 0f;

            float FinalMax = 1f;
            float StartMin = 0f;
            if(tSpline.bSpecialEndControlNode){
                FinalMax = tSpline.mNodes[tSpline.GetNodeCount()-2].tTime;
            }
            if(tSpline.bSpecialStartControlNode){
                StartMin = tSpline.mNodes[1].tTime;
            }

            //			int StartIndex = tSpline.GetClosestRoadDefIndex(StartMin,true,false);
            //			int EndIndex = tSpline.GetClosestRoadDefIndex(FinalMax,false,true);
            //			float cDist = 0f;
            bool kSkip = true;
            bool kSkipFinal = false;
            int kCount = 0;
            int kFinalCount = tSpline.RoadDefKeysArray.Length;
            int spamcheckmax1 = 18000;
            int spamcheck1 = 0;

            if(IsApproximately(StartMin,0f,0.0001f)){
                kSkip = false;
            }
            if(IsApproximately(FinalMax,1f,0.0001f)){
                kSkipFinal = true;
            }

            while(!bFinalEnd && spamcheck1 < spamcheckmax1){
                spamcheck1++;

                if(kSkip){
                    i = StartMin;
                    kSkip = false;
                }else{
                    if(kCount >= kFinalCount){
                        i = FinalMax;
                        if(kSkipFinal){ break; }
                    }else{
                        i = tSpline.TranslateInverseParamToFloat(tSpline.RoadDefKeysArray[kCount]);
                        kCount+=1;
                    }
                }

                if(i > 1f){ break; }
                if(i < 0f){ i = 0f; }

                if(IsApproximately(i,FinalMax,0.00001f)){
                    bFinalEnd = true;
                }else if(i > FinalMax){
                    if(tSpline.bSpecialEndControlNode){
                        i = FinalMax;
                        bFinalEnd = true;
                    }else{
                        bFinalEnd = true;
                        break;
                    }
                }

                tSpline.GetSplineValue_Both(i,out tVect,out POS);
                bIsPastInter = false;
                tIntStrength = tSpline.IntersectionStrength(ref tVect,ref tIntHeight, ref GSDRI, ref bIsPastInter, ref i, ref xNode);
                if(IsApproximately(tIntStrength,1f,0.001f) || tIntStrength > 1f){
                    bMaxIntersection = true;
                }else{
                    bMaxIntersection = false;
                }

                if(bMaxIntersection){
                    if(string.Compare(xNode.UID,GSDRI.Node1.UID) == 0){
                        bFirstInterNode = true;
                    }else{
                        bFirstInterNode = false;
                    }

                    //Convoluted for initial trigger:
                    bBridgeInitial = false;
                    bBridgeLast = false;
                    bTempbridge = tSpline.IsInBridge(i);
                    if(!bIsBridge && bTempbridge){
                        bIsBridge = true;
                        bBridgeInitial = true;
                    }else if(bIsBridge && !bTempbridge){
                        bIsBridge = false;
                    }
                    //Check if this is the last bridge run for this bridge:
                    if(bIsBridge){
                        bTempbridge = tSpline.IsInBridge(i+Step);
                        if(!bTempbridge){
                            bBridgeLast = true;
                        }
                    }

                    //Convoluted for initial trigger:
                    bTunnelInitial = false;
                    bTunnelLast = false;
                    bTempTunnel = tSpline.IsInTunnel(i);
                    if(!bIsTunnel && bTempTunnel){
                        bIsTunnel = true;
                        bTunnelInitial = true;
                    }else if(bIsTunnel && !bTempTunnel){
                        bIsTunnel = false;
                    }
                    //Check if this is the last Tunnel run for this Tunnel:
                    if(bIsTunnel){
                        bTempTunnel = tSpline.IsInTunnel(i+Step);
                        if(!bTempTunnel){
                            bTunnelLast = true;
                        }
                    }

                    if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.NoTurnLane){
                        rVect = (tVect + new Vector3(RoadSeperation_NoTurn*POS.normalized.z,0,RoadSeperation_NoTurn*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSeperation_NoTurn*-POS.normalized.z,0,RoadSeperation_NoTurn*POS.normalized.x));
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.TurnLane){
                        rVect = (tVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                    }else if(GSDRI.rType == GSDRoadIntersection.RoadTypeEnum.BothTurnLanes){
                        if(bIsPastInter){
                            rVect = (tVect + new Vector3(RoadSep1Lane*POS.normalized.z,0,RoadSep1Lane*-POS.normalized.x));
                            lVect = (tVect + new Vector3(RoadSep2Lane*-POS.normalized.z,0,RoadSep2Lane*POS.normalized.x));;
                        }else{
                            rVect = (tVect + new Vector3(RoadSep2Lane*POS.normalized.z,0,RoadSep2Lane*-POS.normalized.x));
                            lVect = (tVect + new Vector3(RoadSep1Lane*-POS.normalized.z,0,RoadSep1Lane*POS.normalized.x));
                        }
                    }else{
                        rVect = (tVect + new Vector3(RoadSeperation*POS.normalized.z,0,RoadSeperation*-POS.normalized.x));
                        lVect = (tVect + new Vector3(RoadSeperation*-POS.normalized.z,0,RoadSeperation*POS.normalized.x));
                    }

                    if(tIntStrength >= 1f){
                        tVect.y -= tInterSubtract;
                        tLastInterHeight = tVect.y;
                        rVect.y -= tInterSubtract;
                        lVect.y -= tInterSubtract;
                    }else{
                        if(!IsApproximately(tIntStrength,0f,0.001f)){ tVect.y = (tIntStrength*tIntHeight) + ((1-tIntStrength)*tVect.y); }
                        tIntStrength_temp = tRoad.GSDSpline.IntersectionStrength(ref rVect,ref tIntHeight, ref GSDRI,ref bIsPastInter,ref i, ref xNode);
                        if(!IsApproximately(tIntStrength_temp,0f,0.001f)){ rVect.y = (tIntStrength_temp*tIntHeight) + ((1-tIntStrength_temp)*rVect.y); ShoulderR_lVect = rVect; }
                    }

                    //Add bounds for later removal:
                    GSD.Roads.GSDRoadUtil.Construction2DRect vRect = null;
                    if(!bIsBridge && !bIsTunnel && bMaxIntersection && bWasPrevMaxInter){
                        bool bGoAhead = true;
                        if(xNode.bIsEndPoint){
                            if(xNode.idOnSpline == 1){
                                if(i < xNode.tTime){
                                    bGoAhead = false;
                                }
                            }else{
                                if(i > xNode.tTime){
                                    bGoAhead = false;
                                }
                            }
                        }
                        //Get this and prev lvect rvect rects:
                        if(Vector3.Distance(xNode.pos,tVect) < (3f * RoadWidth) && bGoAhead){
                            if(GSDRI.bFlipped && !bFirstInterNode){
                                vRect = new GSD.Roads.GSDRoadUtil.Construction2DRect(
                                    new Vector2(rVect.x,rVect.z),
                                    new Vector2(lVect.x,lVect.z),
                                    new Vector2(rVect_Prev.x,rVect_Prev.z),
                                    new Vector2(lVect_Prev.x,lVect_Prev.z),
                                    tLastInterHeight
                                    );
                            }else{
                                 vRect = new GSD.Roads.GSDRoadUtil.Construction2DRect(
                                    new Vector2(lVect.x,lVect.z),
                                    new Vector2(rVect.x,rVect.z),
                                    new Vector2(lVect_Prev.x,lVect_Prev.z),
                                    new Vector2(rVect_Prev.x,rVect_Prev.z),
                                    tLastInterHeight
                                    );
                            }
            //							GameObject tObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
            //							tObj.transform.position = lVect;
            //							tObj.transform.localScale = new Vector3(0.2f,20f,0.2f);
            //							tObj.transform.name = "temp22";
            //
            //							tObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
            //							tObj.transform.position = rVect;
            //							tObj.transform.localScale = new Vector3(0.2f,20f,0.2f);
            //							tObj.transform.name = "temp22";

                            RCS.tIntersectionBounds.Add(vRect);
                        }
                    }
                }

                bWasPrevMaxInter = bMaxIntersection;
                tVect_Prev = tVect;
                rVect_Prev = rVect;
                lVect_Prev = lVect;
                ShoulderR_PrevLVect = ShoulderR_lVect;
                ShoulderL_PrevRVect = ShoulderL_rVect;
            //				ShoulderR_PrevRVect3 = ShoulderR_PrevRVect2;
            //				ShoulderL_PrevLVect3 = ShoulderL_PrevLVect2;
            //				ShoulderR_PrevRVect2 = ShoulderR_PrevRVect;
            //				ShoulderL_PrevLVect2 = ShoulderL_PrevLVect;
                ShoulderR_PrevRVect = ShoulderR_rVect;
                ShoulderL_PrevLVect = ShoulderL_lVect;
                RampR_PrevR = RampR_R;
                RampR_PrevL = RampR_L;
                RampL_PrevR = RampL_R;
                RampL_PrevL = RampL_L;
            //				i+=Step;
            }
        }