@needle-tools/gltf-progressive 3.1.1-next.45706e4 → 3.1.1-next.7384486
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ import { useNeedleProgressive } from "@needle-tools/gltf-progressive";
|
|
|
10
10
|
|
|
11
11
|
// Before loading with GLTFLoader
|
|
12
12
|
// call 'useNeedleProgressive' once to register the loader plugin
|
|
13
|
-
useNeedleProgressive(
|
|
13
|
+
useNeedleProgressive("<asset_url>", webgl_renderer, gltf_loader)
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Features
|
|
@@ -60,7 +60,7 @@ const gltfLoader = new GLTFLoader();
|
|
|
60
60
|
const url = "https://cloud.needle.tools/-/assets/Z23hmXBZN45qJ-ZN45qJ-world/file";
|
|
61
61
|
|
|
62
62
|
// register the progressive loader plugin
|
|
63
|
-
useNeedleProgressive(
|
|
63
|
+
useNeedleProgressive(url, renderer, gltfLoader)
|
|
64
64
|
|
|
65
65
|
// just call the load method as usual
|
|
66
66
|
gltfLoader.load(url, gltf => {
|
|
@@ -94,7 +94,7 @@ function MyModel() {
|
|
|
94
94
|
const { gl } = useThree()
|
|
95
95
|
const url = 'https://cloud.needle.tools/-/assets/Z23hmXBZN45qJ-ZN45qJ-world/file'
|
|
96
96
|
const { scene } = useGLTF(url, false, false, (loader) => {
|
|
97
|
-
useNeedleProgressive(
|
|
97
|
+
useNeedleProgressive(url, gl, loader as any)
|
|
98
98
|
})
|
|
99
99
|
return <primitive object={scene} />
|
|
100
100
|
}
|
|
@@ -11,7 +11,7 @@ function MyModel() {
|
|
|
11
11
|
const { gl } = useThree()
|
|
12
12
|
const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
|
|
13
13
|
const { scene } = useGLTF(url, false, false, (loader) => {
|
|
14
|
-
useNeedleProgressive(
|
|
14
|
+
useNeedleProgressive(url, gl, loader as any)
|
|
15
15
|
})
|
|
16
16
|
return <primitive object={scene} />
|
|
17
17
|
}
|
package/examples/threejs/main.js
CHANGED
|
@@ -89,7 +89,7 @@ function loadScene() {
|
|
|
89
89
|
// Create a new GLTFLoader instance
|
|
90
90
|
const gltfLoader = new GLTFLoader();
|
|
91
91
|
/** Call this method to register the progressive loader */
|
|
92
|
-
useNeedleProgressive(
|
|
92
|
+
useNeedleProgressive(url, renderer, gltfLoader)
|
|
93
93
|
|
|
94
94
|
// just call the load method as usual
|
|
95
95
|
gltfLoader.load(url, gltf => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-progressive",
|
|
3
|
-
"version": "3.1.1-next.
|
|
3
|
+
"version": "3.1.1-next.7384486",
|
|
4
4
|
"description": "three.js support for loading glTF or GLB files that contain progressive loading data",
|
|
5
5
|
"homepage": "https://needle.tools",
|
|
6
6
|
"author": {
|