@needle-tools/gltf-progressive 2.1.6-next.c9b2e8b → 2.1.6-next.fa4044e

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.
Files changed (47) hide show
  1. package/examples/react-three-fiber/src/App.tsx +38 -0
  2. package/examples/react-three-fiber/src/index.tsx +12 -0
  3. package/examples/react-three-fiber/src/styles.css +16 -0
  4. package/examples/react-three-fiber/tsconfig.json +22 -0
  5. package/gltf-progressive.js +1098 -0
  6. package/gltf-progressive.min.js +8 -0
  7. package/gltf-progressive.umd.cjs +8 -0
  8. package/{dist/lib → lib}/extension.d.ts +10 -6
  9. package/{dist/lib → lib}/extension.js +20 -94
  10. package/lib/lods.debug.d.ts +4 -0
  11. package/lib/lods.debug.js +41 -0
  12. package/{dist/lib → lib}/lods_manager.d.ts +6 -1
  13. package/{dist/lib → lib}/lods_manager.js +26 -10
  14. package/{dist/lib → lib}/plugins/plugin.d.ts +2 -2
  15. package/{dist/lib → lib}/version.js +1 -1
  16. package/package.json +14 -17
  17. package/.github/workflows/publish.yml +0 -47
  18. package/dist/CHANGELOG.md +0 -211
  19. package/dist/README.md +0 -129
  20. package/dist/examples/modelviewer-multiple.html +0 -126
  21. package/dist/examples/modelviewer.html +0 -34
  22. package/dist/examples/react-three-fiber/.prettierrc +0 -10
  23. package/dist/examples/react-three-fiber/favicon.png +0 -0
  24. package/dist/examples/react-three-fiber/index.html +0 -24
  25. package/dist/examples/react-three-fiber/package-lock.json +0 -4023
  26. package/dist/examples/react-three-fiber/package.json +0 -34
  27. package/dist/examples/react-three-fiber/vite.config.js +0 -39
  28. package/dist/examples/threejs/index.html +0 -52
  29. package/dist/examples/threejs/main.js +0 -181
  30. package/dist/gltf-progressive.js +0 -1107
  31. package/dist/gltf-progressive.min.js +0 -8
  32. package/dist/gltf-progressive.umd.cjs +0 -8
  33. package/dist/package.json +0 -65
  34. /package/{dist/lib → lib}/index.d.ts +0 -0
  35. /package/{dist/lib → lib}/index.js +0 -0
  36. /package/{dist/lib → lib}/loaders.d.ts +0 -0
  37. /package/{dist/lib → lib}/loaders.js +0 -0
  38. /package/{dist/lib → lib}/plugins/index.d.ts +0 -0
  39. /package/{dist/lib → lib}/plugins/index.js +0 -0
  40. /package/{dist/lib → lib}/plugins/modelviewer.d.ts +0 -0
  41. /package/{dist/lib → lib}/plugins/modelviewer.js +0 -0
  42. /package/{dist/lib → lib}/plugins/plugin.js +0 -0
  43. /package/{dist/lib → lib}/utils.d.ts +0 -0
  44. /package/{dist/lib → lib}/utils.internal.d.ts +0 -0
  45. /package/{dist/lib → lib}/utils.internal.js +0 -0
  46. /package/{dist/lib → lib}/utils.js +0 -0
  47. /package/{dist/lib → lib}/version.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+
3
+ /* eslint-disable */
4
+ import * as React from 'react'
5
+ import { Canvas, useThree } from '@react-three/fiber'
6
+
7
+ import { useNeedleProgressive } from '@needle-tools/gltf-progressive'
8
+ import { Environment, OrbitControls, useGLTF } from '@react-three/drei'
9
+
10
+ function MyModel() {
11
+ const { gl } = useThree()
12
+ const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
13
+ const { scene } = useGLTF(url, false, false, (loader) => {
14
+ useNeedleProgressive(url, gl, loader as any)
15
+ })
16
+ return <primitive object={scene} />
17
+ }
18
+
19
+
20
+ export default function App() {
21
+ return (
22
+ <Canvas
23
+ frameloop="demand"
24
+ camera={{ position: [25, 15, 25] }}>
25
+ <OrbitControls target={[0 , 10, 0]} />
26
+ <ambientLight intensity={1} />
27
+ <spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} />
28
+ <pointLight position={[-10, -10, -10]} />
29
+ <Environment
30
+ files="https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/2k/evening_road_01_2k.hdr"
31
+ // ground={{ height: 5, radius: 40, scale: 10 }}
32
+ />
33
+ <MyModel />
34
+ </Canvas>
35
+ )
36
+ }
37
+
38
+
@@ -0,0 +1,12 @@
1
+ //@ts-ignore
2
+ import { createRoot } from 'react-dom/client'
3
+ import * as React from 'react'
4
+ import './styles.css'
5
+ import App from './App'
6
+
7
+
8
+ createRoot(document.getElementById('root')).render(
9
+ <>
10
+ <App />
11
+ </>
12
+ )
@@ -0,0 +1,16 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ html,
6
+ body,
7
+ #root {
8
+ width: 100%;
9
+ height: 100%;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
14
+ body {
15
+ background: #f0f0f0;
16
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react",
4
+ "target": "ESNext",
5
+ "useDefineForClassFields": true,
6
+ "module": "ESNext",
7
+ "lib": ["ESNext", "DOM"],
8
+ "moduleResolution": "Node",
9
+ "strict": true,
10
+ "sourceMap": true,
11
+ "resolveJsonModule": true,
12
+ "esModuleInterop": true,
13
+ "noEmit": true,
14
+ "noUnusedLocals": false,
15
+ "noUnusedParameters": true,
16
+ "noImplicitReturns": true,
17
+ "noImplicitAny": false,
18
+ "experimentalDecorators": true,
19
+ "skipLibCheck": true
20
+ },
21
+ "include": ["./src"]
22
+ }