# World

#### # new World(options)

Class World defines the coordinate system for the model. It has transforms for multiple coordinate systems.

The world is defined by an object with 6 properties:

         WorldOptions = {
             minX: integer,
             maxX: integer,
             minY: integer,
             maxY: integer,
             minZ: integer,
             maxZ: integer,
         }

Parameters:

Name | Type | Description
--- | --- | ---
`options` | World | WorldOptions | Object | Object with overrides for class properties

Source:
  - World.js, line 36

### Methods

#### # (static) defaultOptions(maxXopt, maxYopt, maxZopt) → {WorldOptions}

Return a default options object, origin at center.

Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`maxX` | number | <optional> | 16 | Integer max X value
`maxY` | number | <optional> | maxX | Integer max Y value
`maxZ` | number | <optional> | Math.max(maxX, maxY) | Integer max Z value

Source:
  - World.js, line 72

Returns:

Type
  WorldOptions

#### # (static) defaultWorld(maxXopt, maxYopt, maxZopt) → {World}

Factory to create a default World instance.

Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`maxX` | number | <optional> | 16 | Integer max X value
`maxY` | number | <optional> | maxX | Integer max Y value
`maxZ` | number | <optional> | Math.max(maxX, maxY) | Integer max Z value

Source:
  - World.js, line 90

Returns:

Type
  World

#### # bboxTransform(minX, minY, maxX, maxY) → {BBoxTransform}

Return an instance of a bounding box 2D transform. It linearly interpolates between the given minX, minY, maxX, maxY, and the world's values of the same properties.

The parameters are in the popular geojson order: west, south, east, north

Useful for Canvas top-left transforms and geojson transforms.

Parameters:

Name | Type | Description
--- | --- | ---
`minX` | number | min bounding box x value
`minY` | number | min bounding box y value
`maxX` | number | max bounding box x value
`maxY` | number | max bounding box y value

Source:
  - World.js, line 196

Returns:

Instance of the BBoxTransform

Type
  BBoxTransform

#### # isOnWorld(x, y, zopt) → {boolean}

Given x,y,z values return true if within the world

Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`x` | number |  |  | x value
`y` | number |  |  | y value
`z` | number | <optional> | this.centerZ | z value

Source:
  - World.js, line 166

Returns:

Whether or not on-world

Type
  boolean

#### # random3DPoint() → {Array}

Return a random 3D point within the World

Source:
  - World.js, line 138

Returns:

A random x,y,z float array

Type
  Array

#### # randomPatchPoint() → {Array}

Return a random Patch 2D integer point

Source:
  - World.js, line 151

Returns:

A random x,y integer array

Type
  Array

#### # randomPoint() → {Array}

Return a random 2D point within the World

Source:
  - World.js, line 126

Returns:

A random x,y float array

Type
  Array