/// <summary> /// Build section of geometry between the two nodes /// </summary> /// <param name="n0"></param> /// <param name="n1"></param> public bool Connect(Road road, WayPoint.Edge edge) { this.road = road; this.edge = edge; return(true); }
/// <summary> /// Connect all the sections of this road that meet at this node. /// </summary> /// <param name="inRoad"></param> /// <param name="inNode"></param> /// <returns></returns> public bool Connect(Road road, WayPoint.Node node) { this.road = road; this.node = node; // Make a list of all edges hitting this node. This should // probably already be stored on the node. sections.Clear(); foreach (Section section in Road.Sections) { WayPoint.Edge edge = section.Edge; if ((edge.Node0 == node) || (edge.Node1 == node)) { sections.Add(section); section.AddIntersection(this); } } // Sort them by angle sections.Sort(new EdgeCompare(node)); BuildNormal(); BuildSectionStrengths(); return(true); }