@realsee/dnalogel 0.1.5 → 0.1.7-alpha.1

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 (34) hide show
  1. package/components/GLTFView/index.d.ts +94 -0
  2. package/components/GLTFView/index.js +172 -0
  3. package/libs/gltf-viewer/Subscribe.d.ts +76 -0
  4. package/libs/gltf-viewer/Subscribe.js +231 -0
  5. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
  6. package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
  7. package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
  8. package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +14 -18
  9. package/libs/gltf-viewer/formatRad.d.ts +1 -0
  10. package/libs/gltf-viewer/formatRad.js +13 -0
  11. package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
  12. package/libs/gltf-viewer/getFrameTime.js +28 -0
  13. package/libs/gltf-viewer/index.d.ts +57 -0
  14. package/libs/gltf-viewer/index.js +648 -0
  15. package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
  16. package/libs/gltf-viewer/mouseWheel.js +59 -0
  17. package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
  18. package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
  19. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
  20. package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
  21. package/libs/gltf-viewer/uuid.d.ts +4 -0
  22. package/libs/gltf-viewer/uuid.js +28 -0
  23. package/package.json +3 -2
  24. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +2 -2
  25. package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -13
  26. package/plugins/PanoMaskSelectorPlugin/createBox.js +3 -0
  27. package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +1 -1
  28. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +1 -1
  29. package/plugins/PanoMaskSelectorPlugin/index.js +3 -1
  30. package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
  31. package/plugins/PanoTVVideoPlugin/index.js +20 -14
  32. package/typedoc/libs.d.ts +1 -0
  33. package/typedoc/libs.js +7 -0
  34. package/components/PBRView/index.d.ts +0 -14
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getFrameTime = getFrameTime;
9
+
10
+ require("core-js/modules/es.date.now.js");
11
+
12
+ require("core-js/modules/es.date.to-string.js");
13
+
14
+ var _requestAnimationFrame = require("./requestAnimationFrame");
15
+
16
+ var cache = {
17
+ duration: 0
18
+ };
19
+
20
+ function getFrameTime(callback) {
21
+ if (cache.duration) callback(cache.duration);
22
+ var start = Date.now();
23
+ (0, _requestAnimationFrame.requestAnimationFrame)(function () {
24
+ callback(cache.duration = Date.now() - start);
25
+ });
26
+ }
27
+
28
+ getFrameTime(function () {});
@@ -0,0 +1,57 @@
1
+ import * as THREE from 'three';
2
+ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
3
+ import { Subscribe } from './Subscribe';
4
+ export interface GLTFViewerSize {
5
+ width?: number;
6
+ height?: number;
7
+ }
8
+ export interface GLTFViewerConfig {
9
+ antialias?: boolean;
10
+ backgroundColor?: THREE.Color;
11
+ backgroundHDR?: string;
12
+ pixelRatio?: number;
13
+ initial?: Partial<GLTFViewerState>;
14
+ pointLight?: THREE.PointLight;
15
+ directionalLight?: THREE.DirectionalLight;
16
+ }
17
+ export interface GLTFViewerState {
18
+ fov: number;
19
+ longitude: number;
20
+ latitude: number;
21
+ }
22
+ export declare type GLTFViewerEventMap = {
23
+ 'stateChange'(state: GLTFViewerState): void;
24
+ 'progressing'(progressing: number): void;
25
+ 'willLoad'(): void;
26
+ 'loaded'(gltf: GLTF): void;
27
+ 'loadError'(error: ErrorEvent): void;
28
+ };
29
+ export declare class GLTFViewer extends Subscribe<GLTFViewerEventMap> {
30
+ uuid: string;
31
+ constructor(config: GLTFViewerConfig);
32
+ get state(): {
33
+ fov?: number;
34
+ latitude?: number;
35
+ longitude?: number;
36
+ };
37
+ set state({ fov, latitude, longitude }: {
38
+ fov?: number;
39
+ latitude?: number;
40
+ longitude?: number;
41
+ });
42
+ /**
43
+ *
44
+ * @param url glTF 模型CDN地址
45
+ */
46
+ load(url: string): void;
47
+ /**
48
+ * 挂载
49
+ * @param container
50
+ * @param size
51
+ */
52
+ appendTo(container: HTMLDivElement, size?: GLTFViewerSize): void;
53
+ /**
54
+ * 销毁
55
+ */
56
+ dispose(): void;
57
+ }