@needle-tools/gltf-progressive 2.1.6 → 3.0.0-alpha.2
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/CHANGELOG.md +6 -0
- package/gltf-progressive.js +753 -668
- package/gltf-progressive.min.js +7 -7
- package/gltf-progressive.umd.cjs +8 -8
- package/lib/extension.d.ts +10 -6
- package/lib/extension.js +20 -94
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/lods.debug.d.ts +4 -0
- package/lib/lods.debug.js +41 -0
- package/lib/{lods_manager.d.ts → lods.manager.d.ts} +21 -4
- package/lib/{lods_manager.js → lods.manager.js} +66 -21
- package/lib/lods.promise.d.ts +50 -0
- package/lib/lods.promise.js +82 -0
- package/lib/plugins/modelviewer.js +1 -1
- package/lib/plugins/plugin.d.ts +2 -2
- package/lib/utils.internal.d.ts +1 -0
- package/lib/utils.internal.js +8 -0
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/plugins/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebGLRenderer, Scene, Camera, Mesh } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { NEEDLE_ext_progressive_mesh } from '../extension.js';
|
|
3
3
|
/**
|
|
4
4
|
* This interface is used to define a plugin for the progressive extension. It can be registered using the `registerPlugin` function.
|
|
5
5
|
*/
|
|
@@ -12,7 +12,7 @@ export interface NEEDLE_progressive_plugin {
|
|
|
12
12
|
texture_lod: number;
|
|
13
13
|
}): void;
|
|
14
14
|
/** Called when a new mesh is registered */
|
|
15
|
-
onRegisteredNewMesh?(mesh: Mesh, ext:
|
|
15
|
+
onRegisteredNewMesh?(mesh: Mesh, ext: NEEDLE_ext_progressive_mesh): void;
|
|
16
16
|
/** Called before the LOD mesh is fetched */
|
|
17
17
|
onBeforeGetLODMesh?(mesh: Mesh, level: number): void;
|
|
18
18
|
}
|
package/lib/utils.internal.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare function getParam(name: string): boolean | string;
|
|
|
3
3
|
export declare function resolveUrl(source: string | undefined, uri: string): string;
|
|
4
4
|
/** @returns `true` if it's a phone or tablet */
|
|
5
5
|
export declare function isMobileDevice(): boolean;
|
|
6
|
+
export declare function isDevelopmentServer(): boolean;
|
package/lib/utils.internal.js
CHANGED
|
@@ -50,3 +50,11 @@ export function isMobileDevice() {
|
|
|
50
50
|
console.log("[glTF Progressive]: isMobileDevice", _ismobile);
|
|
51
51
|
return _ismobile;
|
|
52
52
|
}
|
|
53
|
+
export function isDevelopmentServer() {
|
|
54
|
+
if (typeof window === "undefined")
|
|
55
|
+
return false;
|
|
56
|
+
const url = new URL(window.location.href);
|
|
57
|
+
const isLocalhostOrIpAddress = url.hostname === "localhost" || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(url.hostname);
|
|
58
|
+
const isDevelopment = url.hostname === "127.0.0.1" || isLocalhostOrIpAddress;
|
|
59
|
+
return isDevelopment;
|
|
60
|
+
}
|
package/lib/version.js
CHANGED
package/package.json
CHANGED