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

This commit is contained in:
ErSan 2025-11-05 20:34:45 +08:00
parent eb7e2a4229
commit fb97114207
3 changed files with 21 additions and 1 deletions

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;
}

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",

View File

@ -252,6 +252,9 @@ importers:
'@dxfom/mtext':
specifier: ^0.3.2
version: 0.3.2
'@needle-tools/three-animation-pointer':
specifier: ^1.0.7
version: 1.0.7(three@0.176.0)
camera-controls:
specifier: ^2.9.0
version: 2.10.1(three@0.176.0)
@ -1634,6 +1637,11 @@ packages:
'@microsoft/tsdoc@0.15.1':
resolution: {integrity: sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==}
'@needle-tools/three-animation-pointer@1.0.7':
resolution: {integrity: sha512-lvNeW8+Dy3iqndaIdsswskQl35p4zL7jUOIhmQVsSSrj3CXZMpMvtLlXClf+Qnrf5v09Fyvf8Oe4Qgtp+yRSLQ==}
peerDependencies:
three: '>=0.165.0'
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@ -4938,6 +4946,7 @@ packages:
sitemap@8.0.0:
resolution: {integrity: sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==}
engines: {node: '>=14.0.0', npm: '>=6.0.0'}
deprecated: 'SECURITY: Multiple vulnerabilities fixed in 8.0.1 (XML injection, path traversal, command injection, protocol injection). Upgrade immediately: npm install sitemap@8.0.1'
hasBin: true
slash@5.1.0:
@ -7338,6 +7347,10 @@ snapshots:
'@microsoft/tsdoc@0.15.1': {}
'@needle-tools/three-animation-pointer@1.0.7(three@0.176.0)':
dependencies:
three: 0.176.0
'@nodelib/fs.scandir@2.1.5':
dependencies:
'@nodelib/fs.stat': 2.0.5