API Reference

Class List

pc.ContainerHandler

Loads files that contain multiple resources. For example glTF files can contain textures, models and animations. The asset options object can be used for passing in load time callbacks to handle the various resources at different stages of loading as follows:

|---------------------------------------------------------------------|
|  resource   |  preprocess |   process   |processAsync | postprocess |
|-------------+-------------+-------------+-------------+-------------|
| global      |      x      |             |             |      x      |
| node        |      x      |      x      |             |      x      |
| animation   |      x      |             |             |      x      |
| material    |      x      |      x      |             |      x      |
| texture     |      x      |             |      x      |      x      |
| buffer      |      x      |             |      x      |      x      |
|---------------------------------------------------------------------|

For example, to receive a texture preprocess callback:

var containerAsset = new pc.Asset(filename, 'container', { url: url, filename: filename }, null, {
    texture: {
        preprocess: function (gltfTexture) { console.log("texture preprocess"); }
    },
});

Summary

Details

Constructor

ContainerHandler(device, defaultMaterial)

Parameters

devicepc.GraphicsDevice

The graphics device that will be rendering.

defaultMaterialpc.StandardMaterial

The shared default material that is used in any place that a material is not specified.