viral-viewer-2 6.8.3 → 6.8.4
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/dist/components/batcher/viral-batcher.d.ts +15 -0
- package/dist/components/custom-objects/index.d.ts +2 -2
- package/dist/components/custom-objects/{viral-merged-mesh.d.ts → viral-batched-mesh.d.ts} +5 -4
- package/dist/components/custom-objects/viral-merged-model.d.ts +7 -11
- package/dist/components/custom-objects/viral-spatial-merged-mesh.d.ts +2 -2
- package/dist/components/material/viral-material-manager.d.ts +3 -2
- package/dist/components/post-processing/post-processing-renderer.d.ts +2 -0
- package/dist/components/renderer/viral-optimized-renderer.d.ts +96 -0
- package/dist/components/worker/load-element-patch.worker.d.ts +0 -1
- package/dist/index.mjs +14452 -14270
- package/dist/utils/device.d.ts +29 -1
- package/dist/viral-viewer-api.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/custom-objects/viral-merged-edge.d.ts +0 -32
package/dist/utils/device.d.ts
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
1
|
export declare class DeviceDetector {
|
|
2
|
-
static getDeviceType():
|
|
2
|
+
static getDeviceType(): "mobile" | "tablet" | "pc";
|
|
3
3
|
}
|
|
4
|
+
interface DeviceSpecs {
|
|
5
|
+
gpuTier: "low" | "medium" | "high";
|
|
6
|
+
cpuCores: number;
|
|
7
|
+
totalMemory: number;
|
|
8
|
+
isMobile: boolean;
|
|
9
|
+
renderer: string;
|
|
10
|
+
maxTextureSize: number;
|
|
11
|
+
supportsFloat32: boolean;
|
|
12
|
+
webglVersion: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class DevicePerformanceChecker {
|
|
15
|
+
private gl;
|
|
16
|
+
private specs;
|
|
17
|
+
constructor();
|
|
18
|
+
private initWebGL;
|
|
19
|
+
private detectSpecs;
|
|
20
|
+
private classifyGPU;
|
|
21
|
+
private estimateMemory;
|
|
22
|
+
private getFallbackSpecs;
|
|
23
|
+
canHandleExpensiveEffects(): boolean;
|
|
24
|
+
canHandleMediumEffects(): boolean;
|
|
25
|
+
canHandleBasicEffects(): boolean;
|
|
26
|
+
private calculatePerformanceScore;
|
|
27
|
+
getSpecs(): DeviceSpecs | null;
|
|
28
|
+
getPerformanceProfile(): "potato" | "low" | "medium" | "high" | "ultra";
|
|
29
|
+
runBenchmark(): Promise<number>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -3,7 +3,6 @@ import { ViralCompressProcessor } from "./components/compress/viral-compress.pro
|
|
|
3
3
|
import { ViralCamera } from "./components/camera/viral-camera";
|
|
4
4
|
import { ViralMouse } from "./components/event-handler/mouse/viral-mouse";
|
|
5
5
|
import { ViralScene } from "./components/scene/viral-scene";
|
|
6
|
-
import { ViralRenderer } from "./components/renderer/viral-renderer";
|
|
7
6
|
import { ViralAnimation } from "./components/animation/viral-animation";
|
|
8
7
|
import { LocalStorageService } from "./services/local-storage.service";
|
|
9
8
|
import { ViralKeyboard } from "./components/event-handler/keyboard/viral-keyboard";
|
|
@@ -25,6 +24,7 @@ import { ViralAvatarManager } from "./components/avatar-manager/viral-avatar-man
|
|
|
25
24
|
import { ViralGeometryHandler } from "./components/handler/geometry.handler";
|
|
26
25
|
import { ViralSectionBox } from "./components/section-box/viral-section-box";
|
|
27
26
|
import { ViralPivotPoint } from "./gui/pivot-point/viral-pivot-point";
|
|
27
|
+
import { OptimizedViralRenderer } from "./components/renderer/viral-optimized-renderer";
|
|
28
28
|
/**
|
|
29
29
|
* Root of library
|
|
30
30
|
*/
|
|
@@ -40,7 +40,7 @@ export declare class ViralViewerApi extends EventDispatcher {
|
|
|
40
40
|
viralPivotPoint: ViralPivotPoint;
|
|
41
41
|
viralScene: ViralScene;
|
|
42
42
|
viralMaterialManager: ViralMaterialManager;
|
|
43
|
-
viralRenderer:
|
|
43
|
+
viralRenderer: OptimizedViralRenderer;
|
|
44
44
|
viralCamera: ViralCamera;
|
|
45
45
|
viralMouse: ViralMouse;
|
|
46
46
|
viralKeyboard: ViralKeyboard;
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js";
|
|
2
|
-
type ElemKey = {
|
|
3
|
-
modelId: string;
|
|
4
|
-
elementId: string;
|
|
5
|
-
};
|
|
6
|
-
type BufferElement = {
|
|
7
|
-
buffer: Float32Array | null;
|
|
8
|
-
elementId: string;
|
|
9
|
-
modelId: number;
|
|
10
|
-
};
|
|
11
|
-
export declare class ViralMergedEdges extends LineSegments2 {
|
|
12
|
-
globalMaterialIndex: number;
|
|
13
|
-
private _positions;
|
|
14
|
-
private _elementMap;
|
|
15
|
-
private _totalSegments;
|
|
16
|
-
constructor(color?: number, linewidth?: number);
|
|
17
|
-
/** Phải gọi khi resize để line dày đúng theo px */
|
|
18
|
-
setResolution(width: number, height: number): void;
|
|
19
|
-
/** Thêm edges cho 1 batch BufferElement[] */
|
|
20
|
-
addBufferElements(bufferElements: BufferElement[], boundaryOnly?: boolean): void;
|
|
21
|
-
/** Bật/tắt theo danh sách element: rebuild nhanh mảng positions hiển thị */
|
|
22
|
-
setVisibleElements(els: ElemKey[]): void;
|
|
23
|
-
/** Hiện tất cả edges */
|
|
24
|
-
showAll(): void;
|
|
25
|
-
/** Ẩn tất cả edges */
|
|
26
|
-
hideAll(): void;
|
|
27
|
-
/** Vẽ tất cả cạnh của từng tam giác: (0,1,2), (3,4,5), ... */
|
|
28
|
-
private _buildAllTriangleEdges;
|
|
29
|
-
/** Chỉ cạnh biên: weld đỉnh ~ gộp vertex gần nhau, đếm cạnh xuất hiện 1 lần */
|
|
30
|
-
private _buildBoundarySegments;
|
|
31
|
-
}
|
|
32
|
-
export {};
|