easy-three-utils 0.0.32 → 0.0.331

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-three-utils",
3
- "version": "0.0.32",
3
+ "version": "0.0.331",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -29,7 +29,9 @@ const threeLoaders: IThreeLoaders = {
29
29
  TextureLoader: null
30
30
  }
31
31
 
32
- const useLoader = () => {
32
+ const useLoader = (config: {
33
+ decoderPath: string
34
+ }) => {
33
35
  const useTextureLoader = (url: string, callback?: (texture: THREE.Texture) => void) => {
34
36
  threeLoaders.TextureLoader = new THREE.TextureLoader()
35
37
  const texture = threeLoaders.TextureLoader.load(url, (texture) => {
@@ -68,7 +70,7 @@ const useLoader = () => {
68
70
 
69
71
  const setGLTFLoader = () => {
70
72
  threeLoaders.DRACOLoader = new DRACOLoader()
71
- threeLoaders.DRACOLoader.setDecoderPath('../assets/draco/gltf/');
73
+ threeLoaders.DRACOLoader.setDecoderPath(config.decoderPath)
72
74
  threeLoaders.DRACOLoader.preload()
73
75
 
74
76
  threeLoaders.GLTFLoader = new GLTFLoader()
@@ -47,7 +47,7 @@ const useZip = () => {
47
47
  const zip = new JSZip();
48
48
  const file = await zip.loadAsync(blob)
49
49
  for (let key in file.files) {
50
- zip.file(key)!.async('text').then(content => {
50
+ zip.file(key)!.async('text').then((content: string) => {
51
51
  const data = decryptByDES(content, id)
52
52
  const url = URL.createObjectURL(dataURLtoBlob(data))
53
53
  cb(url)
@@ -1,32 +0,0 @@
1
- # Draco 3D Data Compression
2
-
3
- Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
4
-
5
- [Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco)
6
-
7
- ## Contents
8
-
9
- This folder contains three utilities:
10
-
11
- * `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
12
- * `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
13
- * `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.
14
-
15
- Each file is provided in two variations:
16
-
17
- * **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
18
- * **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).
19
-
20
- Either variation may be used with `DRACOLoader`:
21
-
22
- ```js
23
- var dracoLoader = new DRACOLoader();
24
- dracoLoader.setDecoderPath('path/to/decoders/');
25
- dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
26
- ```
27
-
28
- Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
29
-
30
- ## License
31
-
32
- [Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE)