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 isp project files.

Constructor

ObjectLoader

(
  • manager
)

Parameters:

  • manager Object

Methods

bindSkeletons

(
  • object
  • skeletons
)

Auxiliar method to bind skeletons to loaded objects.

Parameters:

  • object Object3D

    Object3D that contains objects

  • skeletons Array

    Array of skeletons to be binded.

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.

Data can be loaded from a file using the FileSystem methods and parsed to an Object using JSON.parse() method.

Parameters:

  • json Object

    JSON data to be loaded.

  • onLoad Function

    onLoad callback.

Returns:

Object:

Program loaded from json data.

parseAnimations

(
  • json
)
Array

Parse animations on json.

Parameters:

  • json Object

Returns:

Array:

animations

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

(
  • json
)
Array

Parse geometries on JSON.

Parameters:

  • json 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

(
  • json
  • geometries
  • materials
  • textures
  • audio
  • fonts
)
Array

Parse objects from json.

Parameters:

  • json Object
  • geometries Array
  • materials Array
  • textures Array
  • audio Array
  • fonts Array

Returns:

Array:

objects

parseSkeletons

(
  • json
  • object
)

Parse skeletons from json.

Parameters:

  • json Object
  • object Object

parseTextures

(
  • json
  • images
  • videos
)
Array

Parse textures on json.

Parameters:

  • json Object
  • images Array
  • videos Array

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