public interface GltfLoader
| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
GltfLoader.ImportListener |
Listener for asynchronous import result.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
RESOURCE_IMPORT_BIT_ANIMATION |
Indicates the flag used to import animations.
|
static int |
RESOURCE_IMPORT_BIT_IMAGE |
Indicates the flag used to import images.
|
static int |
RESOURCE_IMPORT_BIT_MATERIAL |
Indicates the flag used to import materials.
|
static int |
RESOURCE_IMPORT_BIT_MESH |
Indicates the flag used to import meshes.
|
static int |
RESOURCE_IMPORT_BIT_SAMPLER |
Indicates the flag used to import samplers.
|
static int |
RESOURCE_IMPORT_BIT_SKIN |
Indicates the flag used to import skins.
|
static int |
RESOURCE_IMPORT_BIT_TEXTURE |
Indicates the flag used to import textures.
|
static int |
RESOURCE_IMPORT_FLAG_BITS_ALL |
Indicates the flag used to import all resources.
|
static int |
SCENE_IMPORT_BIT_CAMERA |
Indicates the flag used to import cameras.
|
static int |
SCENE_IMPORT_BIT_LIGHT |
Indicates the flag used to import lights.
|
static int |
SCENE_IMPORT_BIT_MESH |
Indicates the flag used to import meshes.
|
static int |
SCENE_IMPORT_BIT_MORPH |
Indicates the flag used to import morphing data.
|
static int |
SCENE_IMPORT_BIT_SCENE |
Indicates the flag used to import scenes.
|
static int |
SCENE_IMPORT_BIT_SKIN |
Indicates the flag used to import skins.
|
static int |
SCENE_IMPORT_FLAG_BITS_ALL |
Indicates the flag used to import all data.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getDefaultResourceImportFlags() |
Obtains the default flag for importing resources.
|
int |
getDefaultSceneImportFlags() |
Obtains the default flag for importing scenes.
|
GltfImportData |
importGltf(GltfData gltfData,
int flags) |
Imports the glTF data to the engine synchronously.
|
Task |
importGltfAsync(GltfData gltfData,
int flags,
GltfLoader.ImportListener listener) |
Creates a task for asynchronously importing glTF data.
|
Entity |
importScene(int sceneIndex,
GltfData data,
GltfImportData importData,
Entity rootEntity,
int flags) |
Imports a glTF scene from specified glTF data and resources.
|
GltfData |
loadGltf(String gltfUri) |
Loads a glTF file with a specified URI.
|
GltfData |
loadGltf(ByteBuffer gltfBytes) |
Loads a glTF data buffer of bytes.
|
static final int RESOURCE_IMPORT_BIT_ANIMATION
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_IMAGE
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_MATERIAL
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_MESH
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_SAMPLER
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_SKIN
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_BIT_TEXTURE
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int RESOURCE_IMPORT_FLAG_BITS_ALL
importGltf(ohos.agp.render.render3d.gltf.GltfData,int).static final int SCENE_IMPORT_BIT_CAMERA
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_BIT_LIGHT
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_BIT_MESH
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_BIT_MORPH
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_BIT_SCENE
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_BIT_SKIN
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).static final int SCENE_IMPORT_FLAG_BITS_ALL
importScene(int,ohos.agp.render.render3d.gltf.GltfData,ohos.agp.render.render3d.gltf.GltfImportData,ohos.agp.render.render3d.Entity,int).int getDefaultResourceImportFlags()
int getDefaultSceneImportFlags()
GltfData loadGltf(String gltfUri)
gltfUri - Indicates the URI of the glTF file to be loaded.GltfData containing the load result.GltfData loadGltf(ByteBuffer gltfBytes)
gltfBytes - Indicates the glTF data to be loaded.GltfData containing the load result.IllegalArgumentException - Throws this exception if the glTF data buffer is not a direct buffer.GltfImportData importGltf(GltfData gltfData, int flags)
gltfData - Indicates the glTF data in a parsed glTF file.flags - Indicates the flag that specifies the resources to be imported, which can be set using
getDefaultResourceImportFlags().Task importGltfAsync(GltfData gltfData, int flags, GltfLoader.ImportListener listener)
This method does not import any data. Instead, it creates a task for importing data.
gltfData - Indicates the glTF data in a parsed glTF file.flags - Indicates the flag that specifies the resources to be imported, which can be set using
getDefaultResourceImportFlags().listener - Indicates the listener that monitors the import.Entity importScene(int sceneIndex, GltfData data, GltfImportData importData, Entity rootEntity, int flags)
sceneIndex - Indicates the index of the glTF scene to be imported.data - Indicates the glTF data that contains structure information of the glTF scene to be created.importData - Indicates the glTF resources that have been loaded, such as meshes and skins.rootEntity - Indicates the root entity of the glTF scene to be imported. This parameter can be null.flags - Indicates the flag that specifies the resources to be imported, which can be set using
getDefaultResourceImportFlags().