1. getExternalObjectByComponentKey
加载构件数据,并组织成THREE.Mesh对象
名称 | 说明 | 类型 | 是否必须 | 示例 |
---|---|---|---|---|
componentKey | 构件key | 字符串 String | 是 | "M123_456" |
返回值说明 | 类型 | 示例 |
---|---|---|
返回Promise对象,成功回调参数为THREE.Group对象,失败参数表示失败原因 | Promise | 无 |
调用方式:
/**
* 加载构件数据,并组织成THREE.Mesh对象
* @function getExternalObjectByComponentKey
* @param { string } componentKey 构件key
* @return { Promise } 返回Promise对象,成功回调参数为THREE.Mesh对象,失败参数表示失败原因
*/
var promise = eoc.getExternalObjectByComponentKey("M123_456");
promise.then((mesh) => {
console.log(mesh)
})