C# Class RoadNetwork, City-Generator

Datei anzeigen Open project: cybercritic/City-Generator Class Usage Examples

Public Methods

Method Description
AddCityCentreO ( Vector2 center, float angle ) : void

starting city blueprint O-type

AddCityCentreX ( Vector2 center, float angle ) : void

Adds the city centre x.

AddCityCentreY ( Vector2 center, float angle ) : void

starting city blueprint Y-type

RoadNetwork ( float scale ) : System.Collections
SplitSegments ( int level ) : void

Private Methods

Method Description
MinPointDistance ( RoadSegment, a, RoadSegment, b, float min ) : bool
PointWithin ( RoadPoint, point, float distance ) : bool
SegmentWithin ( RoadSegment, segment, float max ) : bool
distPointSegment ( RoadPoint, P, RoadSegment, S ) : float

http://geomalgorithms.com/a02-_lines.html#Distance-to-Ray-or-Segment

inSegment ( RoadPoint, P, RoadSegment, S ) : int
inter2Segments ( RoadSegment, S1, RoadSegment, S2, Vector2 &I0, Vector2 &I1 ) : int
patchSegment ( RoadSegment, segment, RoadPoint, newPoint ) : RoadSegment[],
perp ( Vector2 u, Vector2 v ) : float
segmentIntersection ( RoadSegment, segment, Vector2 &intersection, RoadSegment, &other, RoadSegment, skip ) : int
splitSegment ( RoadSegment, segment ) : void

Method Details

AddCityCentreO() public method

starting city blueprint O-type
public AddCityCentreO ( Vector2 center, float angle ) : void
center Vector2
angle float
return void

AddCityCentreX() public method

Adds the city centre x.
public AddCityCentreX ( Vector2 center, float angle ) : void
center Vector2 Center.
angle float Angle.
return void

AddCityCentreY() public method

starting city blueprint Y-type
public AddCityCentreY ( Vector2 center, float angle ) : void
center Vector2
angle float
return void

RoadNetwork() public method

public RoadNetwork ( float scale ) : System.Collections
scale float
return System.Collections

SplitSegments() public method

public SplitSegments ( int level ) : void
level int
return void