threejs-worldgen
    Preparing search index...

    Class DistrictMap

    Answers "which district is this?" and "how dense is it here?" for one settlement.

    Index
    • District layout around (cx, cz) for a settlement of radius metres. With mainStreet > 0, downtown is a strip that wide either side of a street through the centre along axis (a town's high street) instead of a disc.

      Parameters

      Returns DistrictMap

    axis: number

    Direction of the main street, radians from +x.

    cx: number

    Settlement centre.

    cz: number

    Settlement centre.

    mainStreet: number

    Half-width of the main-street downtown strip, metres (0 = downtown is a disc).

    Rules in use.

    radius: number

    Settlement radius, metres.

    District shares in use.

    • Building density 0..1: peaks downtown and falls off towards the edge (with a little noise).

      Parameters

      • x: number
      • z: number

      Returns number