@realsee/vreo 0.2.0-alpha.3 → 0.2.0-alpha.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.
@@ -39,8 +39,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
39
 
40
40
  var searchV1 = function searchV1(_ref) {
41
41
  var five = _ref.five,
42
- position = _ref.position,
43
- rotation = _ref.rotation,
44
42
  dom = _ref.dom;
45
43
  var cameraDirection = new _three.Vector3();
46
44
  five.camera.getWorldDirection(cameraDirection);
@@ -98,19 +96,15 @@ function SpatialScenePanel(props) {
98
96
  return;
99
97
  }
100
98
 
101
- var data = keyframe.data; // const data = mockData as SpatialScenePanelData
99
+ var data = keyframe.data;
102
100
 
103
101
  var _searchV = searchV1({
104
102
  five: props.five,
105
- position: new _three.Vector3(data.position.x, data.position.y, data.position.z),
106
- quaternion: data.quaternion,
107
103
  dom: ref.current
108
104
  }),
109
105
  points = _searchV.points,
110
106
  ratio = _searchV.ratio;
111
107
 
112
- console.log(points, ratio);
113
-
114
108
  var _ref2 = rendererRef.current.create3DDomContainer(points, {
115
109
  ratio: ratio,
116
110
  autoRender: false
@@ -157,9 +151,6 @@ function SpatialScenePanel(props) {
157
151
  }, end - start);
158
152
  };
159
153
 
160
- Object.assign(window, {
161
- $SpatialScenePanelCallback: callback
162
- });
163
154
  props.subscribe.on(_VreoUnit.VreoKeyframeEnum.Custom, callback);
164
155
  return function () {
165
156
  props.subscribe.off(_VreoUnit.VreoKeyframeEnum.Custom, callback);
@@ -63,12 +63,8 @@ function PanoTextLabel() {
63
63
  var res = project2d(new _three.Vector3(x, y, z));
64
64
  if (!res) return;
65
65
  var left = res.x,
66
- top = res.y;
67
- Object.assign(window, {
68
- $PanoTextLabel: {
69
- setState: setState
70
- }
71
- });
66
+ top = res.y; // Object.assign(window, { $PanoTextLabel: { setState } })
67
+
72
68
  setState({
73
69
  left: left,
74
70
  top: top,
@@ -80,12 +76,8 @@ function PanoTextLabel() {
80
76
  }, end - start);
81
77
  };
82
78
 
83
- controller.on(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
84
- Object.assign(window, {
85
- $panoTextLabel: {
86
- setState: setState
87
- }
88
- });
79
+ controller.on(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback); // Object.assign(window, { $panoTextLabel: { setState } })
80
+
89
81
  return function () {
90
82
  controller.off(_VreoUnit.VreoKeyframeEnum.PanoTextLabel, callback);
91
83
 
@@ -241,8 +241,9 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
241
241
  // 移动结束
242
242
  moveCancelCallback: function moveCancelCallback() {
243
243
  return reject(false);
244
- } // 移动开始
245
-
244
+ },
245
+ // 移动开始
246
+ effect: 'fade'
246
247
  });
247
248
  });
248
249
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "0.2.0-alpha.3",
3
+ "version": "0.2.0-alpha.4",
4
4
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
5
  "keywords": [
6
6
  "realsee",
@@ -22,13 +22,13 @@ export interface SpatialScenePanelData {
22
22
 
23
23
  interface SearchParams {
24
24
  five: Five
25
- position: Vector3
26
- rotation?: Vector3
27
- quaternion: [number, number, number, number]
25
+ // position: Vector3
26
+ // rotation?: Vector3
27
+ // quaternion: [number, number, number, number]
28
28
  dom: HTMLDivElement
29
29
  }
30
30
 
31
- const searchV1 = ({ five, position, rotation, dom }: SearchParams) => {
31
+ const searchV1 = ({ five, dom }: SearchParams) => {
32
32
  const cameraDirection = new Vector3()
33
33
  five.camera.getWorldDirection(cameraDirection)
34
34
  const cameraPosition = five.camera.position
@@ -82,17 +82,12 @@ export function SpatialScenePanel(props: CustomVreoKeyframeProps) {
82
82
  }
83
83
 
84
84
  const data = keyframe.data as SpatialScenePanelData
85
- // const data = mockData as SpatialScenePanelData
86
85
 
87
86
  const { points, ratio } = searchV1({
88
87
  five: props.five,
89
- position: new Vector3(data.position.x, data.position.y, data.position.z),
90
- quaternion: data.quaternion,
91
88
  dom: ref.current!
92
89
  })
93
90
 
94
- console.log(points, ratio)
95
-
96
91
  const { container, dispose, css3DObject, render } =
97
92
  rendererRef.current.create3DDomContainer(points, { ratio, autoRender: false }) || {}
98
93
 
@@ -124,7 +119,6 @@ export function SpatialScenePanel(props: CustomVreoKeyframeProps) {
124
119
  }, end - start)
125
120
  }
126
121
 
127
- Object.assign(window, {$SpatialScenePanelCallback: callback})
128
122
  props.subscribe.on(VreoKeyframeEnum.Custom, callback)
129
123
 
130
124
  return () => {
@@ -30,13 +30,13 @@ export function PanoTextLabel() {
30
30
  if (!res) return
31
31
  const { x: left, y: top } = res
32
32
 
33
- Object.assign(window, { $PanoTextLabel: { setState } })
33
+ // Object.assign(window, { $PanoTextLabel: { setState } })
34
34
  setState({ left, top, text: data.text || '', fontSize: data.fontSize || 16 })
35
35
  timeoutRef.current = setTimeout(() => setState(null), end - start)
36
36
  }
37
37
  controller.on(VreoKeyframeEnum.PanoTextLabel, callback)
38
38
 
39
- Object.assign(window, { $panoTextLabel: { setState } })
39
+ // Object.assign(window, { $panoTextLabel: { setState } })
40
40
  return () => {
41
41
  controller.off(VreoKeyframeEnum.PanoTextLabel, callback)
42
42
  if (timeoutRef.current) {
@@ -156,6 +156,7 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
156
156
  five.moveToPano(args.panoIndex, {
157
157
  moveEndCallback: () => resolve(true), // 移动结束
158
158
  moveCancelCallback: () => reject(false), // 移动开始
159
+ effect: 'fade',
159
160
  })
160
161
  })
161
162
  }