feat(SDK): 添加对带有 KHR_animation_pointer 动画的 glTF 文件的支持
This commit is contained in:
parent
eb7e2a4229
commit
fb97114207
@ -923,12 +923,18 @@ class Loader {
|
|||||||
|
|
||||||
async createGLTFLoader(manager?:THREE.LoadingManager) {
|
async createGLTFLoader(manager?:THREE.LoadingManager) {
|
||||||
const { MeshoptDecoder } = await import( 'three/examples/jsm/libs/meshopt_decoder.module.js' );
|
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);
|
const loader = new GLTFLoader(manager);
|
||||||
loader.setDRACOLoader(this.dracoLoader);
|
loader.setDRACOLoader(this.dracoLoader);
|
||||||
loader.setKTX2Loader(this.ktx2Loader);
|
loader.setKTX2Loader(this.ktx2Loader);
|
||||||
loader.setMeshoptDecoder(MeshoptDecoder);
|
loader.setMeshoptDecoder(MeshoptDecoder);
|
||||||
|
|
||||||
|
// 20251105:添加对带有 KHR_animation_pointer 动画的 glTF 文件的支持
|
||||||
|
loader.register(p => {
|
||||||
|
return new GLTFAnimationPointerExtension(p);
|
||||||
|
});
|
||||||
|
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
"3d-tiles-renderer": "^0.4.16",
|
"3d-tiles-renderer": "^0.4.16",
|
||||||
"@babel/runtime": "7.27.0",
|
"@babel/runtime": "7.27.0",
|
||||||
"@dxfom/mtext": "^0.3.2",
|
"@dxfom/mtext": "^0.3.2",
|
||||||
|
"@needle-tools/three-animation-pointer": "^1.0.7",
|
||||||
"camera-controls": "^2.9.0",
|
"camera-controls": "^2.9.0",
|
||||||
"js-base64": "^3.7.7",
|
"js-base64": "^3.7.7",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
@ -38,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astral3d/build-vite-plugins": "workspace:^",
|
"@astral3d/build-vite-plugins": "workspace:^",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"@types/three": "catalog:",
|
"@types/three": "catalog:",
|
||||||
"rollup-plugin-visualizer": "catalog:",
|
"rollup-plugin-visualizer": "catalog:",
|
||||||
"typescript": "catalog:",
|
"typescript": "catalog:",
|
||||||
|
|||||||
@ -252,6 +252,9 @@ importers:
|
|||||||
'@dxfom/mtext':
|
'@dxfom/mtext':
|
||||||
specifier: ^0.3.2
|
specifier: ^0.3.2
|
||||||
version: 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:
|
camera-controls:
|
||||||
specifier: ^2.9.0
|
specifier: ^2.9.0
|
||||||
version: 2.10.1(three@0.176.0)
|
version: 2.10.1(three@0.176.0)
|
||||||
@ -1634,6 +1637,11 @@ packages:
|
|||||||
'@microsoft/tsdoc@0.15.1':
|
'@microsoft/tsdoc@0.15.1':
|
||||||
resolution: {integrity: sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==}
|
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':
|
'@nodelib/fs.scandir@2.1.5':
|
||||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
@ -4938,6 +4946,7 @@ packages:
|
|||||||
sitemap@8.0.0:
|
sitemap@8.0.0:
|
||||||
resolution: {integrity: sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==}
|
resolution: {integrity: sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==}
|
||||||
engines: {node: '>=14.0.0', npm: '>=6.0.0'}
|
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
|
hasBin: true
|
||||||
|
|
||||||
slash@5.1.0:
|
slash@5.1.0:
|
||||||
@ -7338,6 +7347,10 @@ snapshots:
|
|||||||
|
|
||||||
'@microsoft/tsdoc@0.15.1': {}
|
'@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':
|
'@nodelib/fs.scandir@2.1.5':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nodelib/fs.stat': 2.0.5
|
'@nodelib/fs.stat': 2.0.5
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user