ObjectLoader Class

Module: Loaders

Objectloader can be used to load external objects from files.

Also loads all resources attached to the objects being loaded.

Can parse be used to load on runtime resources and objects from external project files.

Methods

bindSkeletons

(
  • object
)

Auxiliar method to bind skeletons to loaded objects.

Look for skeletonUUID property, wich is a placeholder with the skeleton UUID and replace it with the skeleton object.

Parameters:

  • object Object3D

    Object3D that contains objects

load

(
  • url
  • onLoad
  • onProgress
  • onError
)

Load object file from URL.

Parameters:

  • url String
  • onLoad Function
  • onProgress Function
  • onError Function

parse

(
  • json
  • onLoad
)
Object

Parse JSON object and create the correct Object structure.

Data can be loaded from a file and should be parsed into Object.

Parameters:

  • json Object

    JSON data to be loaded.

  • onLoad Function

    onLoad callback.

Returns:

Object:

Program loaded from json data.

parseAudio

(
  • json
)
Array

Parse audio on json.

Parameters:

  • json Object

Returns:

Array:

audio

parseFonts

(
  • json
)
Array

Parse fonts on json.

Parameters:

  • json Object

Returns:

Array:

fonts

parseGeometries

(
  • array
)
Array

Parse geometries on JSON.

Parameters:

  • array Object

Returns:

Array:

geometries

parseImages

(
  • json
)
Array

Parse images on json.

Parameters:

  • json Object

Returns:

Array:

images

parseMaterials

(
  • json
)
Array

Parse materials on json.

Parameters:

  • json Object

Returns:

Array:

materials

parseObjects

()

Parse objects from json data,

parseResources

(
  • json
)
Array

Parse resources on JSON.

Parameters:

  • json Object

Returns:

Array:

resources

parseShape

(
  • json
)
Array

Parse geometries on JSON.

Parameters:

  • json Object

Returns:

Array:

geometries

parseSkeletons

(
  • json
  • object
)

Parse array of skeletons from JSON object.

Parameters:

  • json Object
  • object Object

parseTextures

(
  • json
)
Array

Parse textures on json.

Parameters:

  • json Object

Returns:

Array:

textures

parseVideos

(
  • json
)
Array

Parse videos on json.

Parameters:

  • json Object

Returns:

Array:

videos

setCrossOrigin

(
  • origin
)

Set cross origin.

Parameters:

  • origin String

setTexturePath

(
  • path
)

Define base path for external texture loading.

Parameters:

  • path String