deeptwins-engine-3d 0.1.67 → 0.1.69

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.
@@ -1,12 +1,37 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import * as Cesium from 'deeptwins-cesium';
3
+ type RoamStatus = 'initializing' | 'ready' | 'running' | 'pause' | 'stop' | 'destroy' | 'error';
4
+ interface CameraSettings {
5
+ distance: number;
6
+ pitch: number;
7
+ }
8
+ interface RunningPayload {
9
+ lng: number;
10
+ lat: number;
11
+ alt: number;
12
+ time: Date;
13
+ }
14
+ interface ModelRoamHistoryOptions {
15
+ polyline?: any;
16
+ model?: any;
17
+ multiplier?: number;
18
+ clockRange?: any;
19
+ flyTo?: boolean;
20
+ clampToGround?: boolean;
21
+ splitNum?: number;
22
+ complete?: () => void;
23
+ cancel?: () => void;
24
+ onRunning?: (payload: RunningPayload) => void;
25
+ }
1
26
  export default class ModelRoamHistory {
2
27
  private readonly _mapContext;
3
28
  polylineLayer: any;
4
29
  polylineEntity: any;
5
30
  modelLayer: any;
6
31
  modelEntity: any;
7
- positionProperty: any;
32
+ positionProperty: Cesium.SampledPositionProperty | null;
8
33
  private follow;
9
- status: string;
34
+ status: RoamStatus;
10
35
  private readonly _eventRunning;
11
36
  private readonly _eventComplete;
12
37
  private readonly _eventCancel;
@@ -15,23 +40,45 @@ export default class ModelRoamHistory {
15
40
  private _currentPosition;
16
41
  private _heading;
17
42
  private _listenRunning;
43
+ private _clockRange;
44
+ private _initPromise;
45
+ private _isReady;
46
+ private _pendingStart;
47
+ private _hasReachedStopTime;
48
+ private _modelSourceId;
49
+ private _samples;
18
50
  private firstCameraSettings;
19
51
  private thirdPersonSettings;
20
- constructor(map: any, positions: any, options?: any);
52
+ constructor(map: any, positions: any, options?: ModelRoamHistoryOptions);
21
53
  getMap(): any;
54
+ isReady(): boolean;
55
+ getStatus(): RoamStatus;
22
56
  private _init;
23
- private _getHeading;
57
+ private _normalizePositions;
58
+ private _createPolylineLayer;
59
+ private _configureClock;
60
+ private _bindSceneListener;
61
+ private _buildPositionSamples;
62
+ private _buildRawSegmentSamples;
63
+ private _buildTerrainSegmentSamples;
64
+ private _appendSamples;
65
+ private _shouldSkipSample;
66
+ private _getPreviousPosition;
67
+ private _updateHeading;
68
+ private _applyFollowView;
24
69
  start(): void;
25
70
  pause(): void;
26
71
  proceed(): void;
27
72
  stop(): void;
28
- setFollowFirst(options: any): void;
29
- setFollowThird(options: any): void;
73
+ setFollowFirst(options?: Partial<CameraSettings>): void;
74
+ setFollowThird(options?: Partial<CameraSettings>): void;
30
75
  cancelFollow(): void;
31
76
  private updateFirstPersonView;
32
77
  private updateThirdPersonView;
33
78
  on(type: any, event: any): any;
34
79
  updatePolyline(style: any): void;
35
80
  updateModel(style: any): void;
81
+ waitUntilReady(): Promise<void>;
36
82
  destroy(): void;
37
83
  }
84
+ export {};