@realsee/vreo 0.1.5 → 0.1.6-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.
@@ -29,6 +29,10 @@ function UpdateVRPanorama() {
29
29
  var _ref = keyframe.data,
30
30
  panoIndex = _ref.panoIndex,
31
31
  images = _ref.images;
32
+ Object.keys(images).forEach(function (_key) {
33
+ var key = _key;
34
+ images[key] = images[key].replace(/https*:\/\//, '//');
35
+ });
32
36
  var newWorkJSON = JSON.parse(JSON.stringify((_five$work = five.work) === null || _five$work === void 0 ? void 0 : _five$work.raw.work)); // // 原Work数据不能被修改
33
37
 
34
38
  if (newWorkJSON.panorama && newWorkJSON.panorama.list && newWorkJSON.panorama.list[panoIndex]) {
@@ -204,18 +204,19 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
204
204
 
205
205
  if (opts.asyncStartCallback) {
206
206
  opts.asyncStartCallback();
207
- }
207
+ } // 先切换模型再出旋转效果
208
+
208
209
 
209
- if (!(five.currentMode !== _five.Five.Mode.Panorama)) {
210
+ if (!(args.mode && five.currentMode !== args.mode)) {
210
211
  _context2.next = 5;
211
212
  break;
212
213
  }
213
214
 
214
215
  _context2.next = 5;
215
- return five.changeMode(_five.Five.Mode.Panorama);
216
+ return five.changeMode(args.mode);
216
217
 
217
218
  case 5:
218
- if (!(args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
219
+ if (!(args.mode === _five.Five.Mode.Panorama && five.currentMode === _five.Five.Mode.Panorama && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
219
220
  _context2.next = 11;
220
221
  break;
221
222
  }
@@ -38,6 +38,7 @@ export declare type MoveOpts = {
38
38
  preload?: boolean;
39
39
  } & CameraMovementOptsCallback;
40
40
  export declare type RotateArgs = {
41
+ mode?: Mode;
41
42
  panoIndex: number;
42
43
  loop: boolean;
43
44
  rotateSpeed: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "0.1.5",
3
+ "version": "0.1.6-alpha.1",
4
4
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
5
  "keywords": [
6
6
  "realsee",
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react'
2
- import { parseWork } from '@realsee/five'
2
+ import { parseWork, WorkCubeImage } from '@realsee/five'
3
3
  import { useController, useFiveInstance } from '../../../hooks'
4
4
  import { UpdateVRPanoramaData, VreoKeyframe, VreoKeyframeEnum } from '../../../../typings/VreoUnit'
5
5
 
@@ -11,6 +11,10 @@ export function UpdateVRPanorama() {
11
11
  const callback = (keyframe: VreoKeyframe) => {
12
12
  const { panoIndex, images } = keyframe.data as UpdateVRPanoramaData
13
13
 
14
+ Object.keys(images).forEach((_key) => {
15
+ const key = _key as keyof WorkCubeImage
16
+ images[key] = images[key].replace(/https*:\/\//, '//')
17
+ })
14
18
  const newWorkJSON = JSON.parse(JSON.stringify(five.work?.raw.work))
15
19
 
16
20
  // // 原Work数据不能被修改
@@ -139,11 +139,16 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
139
139
  opts.asyncStartCallback()
140
140
  }
141
141
 
142
- if (five.currentMode !== Five.Mode.Panorama) {
143
- await five.changeMode(Five.Mode.Panorama)
142
+ // 先切换模型再出旋转效果
143
+ if (args.mode && five.currentMode !== args.mode) {
144
+ await five.changeMode(args.mode)
144
145
  }
145
146
 
146
- if (args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
147
+ // 全景状态下,需要点位对齐
148
+ if (args.mode === Five.Mode.Panorama &&
149
+ five.currentMode === Five.Mode.Panorama &&
150
+ args.panoIndex !== undefined &&
151
+ args.panoIndex !== five.panoIndex) {
147
152
  if (opts.preload) await five.preloadPano(args.panoIndex)
148
153
  await new Promise((resolve, reject) => {
149
154
  five.moveToPano(args.panoIndex, {
@@ -46,6 +46,7 @@ export type MoveOpts = {
46
46
  } & CameraMovementOptsCallback
47
47
 
48
48
  export type RotateArgs = {
49
+ mode?: Mode
49
50
  panoIndex: number
50
51
  loop: boolean
51
52
  rotateSpeed: number