ArrayLoader

ArrayLoader

Class for loading voxel data stored as a 3D array.

Constructor

new ArrayLoader(manager)

Create an ArrayLoader.
Mixes In:
Source:
Parameters:
Name Type Description
manager LoadingManager

Extends

  • Loader

Methods

getLOD()

Get the Level Of Detail (LOD) value.
Mixes In:
Source:

load(url, onLoadopt, onProgressopt, onErroropt)

Loads and parses a 3D array stored in a JS file from a URL.
Source:
Parameters:
Name Type Attributes Description
url String URL to the JS file with array.
onLoad function <optional>
Callback invoked with the loaded object.
onProgress function <optional>
Callback for download progress.
onError function <optional>
Callback for download errors.

parse(data) → {Promise.<PointOctree>}

Parses a 3D array.
Source:
Parameters:
Name Type Default Description
data Object null The volume data to parse.
Name Type Attributes Default Description
voxels Array.<Array.<Array.<number>>> The voxel data.
colors Array.<Array.<Array.<Array.<number>>>> <optional>
null The color data.
Returns:
Type:
Promise.<PointOctree>
Promise with an octree filled with voxel data.

setLOD(maxPointsopt, maxDepthopt)

Set the vanted level of detail (LOD).
Mixes In:
Source:
Parameters:
Name Type Attributes Default Description
maxPoints number <optional>
1 Number of distinct points per octant in octree before it splits up.
maxDepth number <optional>
8 The maximum octree depth level, starting at 0.