feat(SDK): 添加对带有 KHR_animation_pointer 动画的 glTF 文件的支持

This commit is contained in:
2025-11-05 20:34:45 +08:00
parent eb7e2a4229
commit fb97114207
3 changed files with 21 additions and 1 deletions
+6
View File
@@ -923,12 +923,18 @@ class Loader {
async createGLTFLoader(manager?:THREE.LoadingManager) {
const { MeshoptDecoder } = await import( 'three/examples/jsm/libs/meshopt_decoder.module.js' );
const { GLTFAnimationPointerExtension } = await import( '@needle-tools/three-animation-pointer' );
const loader = new GLTFLoader(manager);
loader.setDRACOLoader(this.dracoLoader);
loader.setKTX2Loader(this.ktx2Loader);
loader.setMeshoptDecoder(MeshoptDecoder);
// 20251105:添加对带有 KHR_animation_pointer 动画的 glTF 文件的支持
loader.register(p => {
return new GLTFAnimationPointerExtension(p);
});
return loader;
}
+2 -1
View File
@@ -24,6 +24,7 @@
"3d-tiles-renderer": "^0.4.16",
"@babel/runtime": "7.27.0",
"@dxfom/mtext": "^0.3.2",
"@needle-tools/three-animation-pointer": "^1.0.7",
"camera-controls": "^2.9.0",
"js-base64": "^3.7.7",
"jszip": "^3.10.1",
@@ -38,7 +39,7 @@
},
"devDependencies": {
"@astral3d/build-vite-plugins": "workspace:^",
"@types/node": "catalog:",
"@types/node": "catalog:",
"@types/three": "catalog:",
"rollup-plugin-visualizer": "catalog:",
"typescript": "catalog:",