@realsee/vreo 0.2.0-alpha.2 → 0.2.0-alpha.21-beta

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 (147) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +80 -5
  3. package/docs/assets/custom.css +2 -2
  4. package/docs/assets/highlight.css +1 -1
  5. package/docs/assets/main.js +2 -2
  6. package/docs/assets/search.js +1 -1
  7. package/docs/assets/style.css +28 -2
  8. package/docs/classes/Player.AudioLike.html +52 -0
  9. package/docs/classes/Player.Controller.html +13 -13
  10. package/docs/classes/Player.Player-1.html +11 -11
  11. package/docs/classes/Player.VideoAgentMesh.html +53 -53
  12. package/docs/classes/Player.VideoAgentScene.html +1 -1
  13. package/docs/demo/assets/AppReact.043b1cd2.js +1 -0
  14. package/docs/demo/assets/default.55c3f308.css +1 -0
  15. package/docs/demo/assets/default.9a6a32fc.js +3952 -0
  16. package/docs/demo/assets/dynamic.bdbbbafa.js +1 -0
  17. package/docs/demo/assets/examples.2aaa85e1.js +25 -0
  18. package/docs/demo/assets/examples.dac4a6fe.css +1 -0
  19. package/docs/demo/assets/index.9b5c1a3f.js +1 -0
  20. package/docs/demo/assets/index.a7bafdff.css +1 -0
  21. package/docs/demo/assets/main.0895bebe.js +1 -0
  22. package/docs/demo/assets/react.855b3d23.css +1 -0
  23. package/docs/demo/assets/react.959cff42.js +25 -0
  24. package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
  25. package/docs/demo/examples.html +17 -0
  26. package/docs/demo/index-react-dynamic.html +20 -0
  27. package/docs/demo/index-react.html +20 -0
  28. package/docs/demo/index.html +19 -0
  29. package/docs/enums/Player.InfoPanelStyleEnum.html +1 -0
  30. package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
  31. package/docs/enums/Player.PanoEffectEnum.html +2 -2
  32. package/docs/enums/Player.PanoTagEnum.html +2 -2
  33. package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
  34. package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
  35. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  36. package/docs/enums/fivePlugins.Rotation.html +1 -1
  37. package/docs/index.html +37 -6
  38. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
  39. package/docs/interfaces/Player.PlayerConfigs.html +3 -3
  40. package/docs/interfaces/Player.Vertex.html +2 -2
  41. package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
  42. package/docs/interfaces/Player.VreoKeyframe.html +2 -2
  43. package/docs/interfaces/Player.VreoUnit.html +2 -2
  44. package/docs/interfaces/Player.VreoVideo.html +2 -2
  45. package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
  46. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  47. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
  48. package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
  49. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  50. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  51. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  52. package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
  53. package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
  54. package/docs/interfaces/react.VreoProviderProps.html +1 -1
  55. package/docs/modules/Player.html +21 -15
  56. package/docs/modules/custom.html +1 -1
  57. package/docs/modules/fivePlugins.html +5 -2
  58. package/docs/modules/react.html +1 -1
  59. package/docs/modules.html +1 -1
  60. package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
  61. package/lib/PlayController/createHTMLAudioElement.js +47 -0
  62. package/lib/PlayController/index.d.ts +38 -0
  63. package/lib/PlayController/index.js +300 -0
  64. package/lib/Player/App.js +5 -4
  65. package/lib/Player/Controller.d.ts +5 -1
  66. package/lib/Player/Controller.js +38 -5
  67. package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
  68. package/lib/Player/custom/SpatialScenePanel/index.js +98 -26
  69. package/lib/Player/index.d.ts +3 -2
  70. package/lib/Player/index.js +116 -24
  71. package/lib/Player/modules/Drawer/index.js +1 -1
  72. package/lib/Player/modules/PopUp/index.d.ts +2 -0
  73. package/lib/Player/modules/PopUp/index.js +43 -0
  74. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +17 -2
  75. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +113 -37
  76. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +5 -1
  77. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +9 -4
  78. package/lib/Player/modules/VideoAgent/index.d.ts +2 -0
  79. package/lib/Player/modules/VideoAgent/index.js +2 -2
  80. package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
  81. package/lib/Player/modules/keyframes/CameraMovement/index.js +42 -6
  82. package/lib/Player/modules/keyframes/InfoPanel/index.js +74 -36
  83. package/lib/Player/modules/keyframes/ModelVideo/index.js +46 -9
  84. package/lib/Player/modules/keyframes/PanoEffect/index.js +1 -1
  85. package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -1
  86. package/lib/Player/modules/keyframes/PanoTag/index.js +20 -7
  87. package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
  88. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -51
  89. package/lib/Player/modules/keyframes/Prompter/index.js +5 -19
  90. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +31 -19
  91. package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
  92. package/lib/Player/typings.d.ts +6 -0
  93. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
  94. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
  95. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
  96. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
  97. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
  98. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
  99. package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
  100. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
  101. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
  102. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
  103. package/lib/fivePlugins/CameraMovementPlugin/index.js +109 -94
  104. package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
  105. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
  106. package/lib/react/index.d.ts +7 -3
  107. package/lib/react/index.js +3 -3
  108. package/lib/shared-utils/AduioLike.d.ts +37 -0
  109. package/lib/shared-utils/AduioLike.js +165 -0
  110. package/lib/shared-utils/animationFrame/BetterTween.js +7 -3
  111. package/lib/shared-utils/animationFrame/tween.js +1 -1
  112. package/lib/shared-utils/createTransMatrix.d.ts +1 -0
  113. package/lib/shared-utils/createTransMatrix.js +43 -0
  114. package/lib/typings/VreoUnit.d.ts +42 -5
  115. package/lib/typings/VreoUnit.js +26 -6
  116. package/package.json +8 -8
  117. package/resources/PlayController/createHTMLAudioElement.ts +53 -0
  118. package/resources/PlayController/index.ts +167 -0
  119. package/resources/Player/App.tsx +2 -0
  120. package/resources/Player/Controller.ts +155 -121
  121. package/resources/Player/custom/SpatialScenePanel/index.tsx +148 -45
  122. package/resources/Player/index.tsx +186 -110
  123. package/resources/Player/modules/PopUp/index.tsx +26 -0
  124. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +67 -14
  125. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +3 -3
  126. package/resources/Player/modules/VideoAgent/index.tsx +3 -2
  127. package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
  128. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
  129. package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
  130. package/resources/Player/modules/keyframes/PanoTag/index.tsx +31 -12
  131. package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +87 -34
  132. package/resources/Player/modules/keyframes/Prompter/index.tsx +5 -15
  133. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +25 -16
  134. package/resources/Player/typings.ts +5 -0
  135. package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
  136. package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
  137. package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
  138. package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
  139. package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
  140. package/resources/fivePlugins/CameraMovementPlugin/index.ts +66 -52
  141. package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
  142. package/resources/react/index.tsx +7 -3
  143. package/resources/shared-utils/AduioLike.ts +108 -0
  144. package/resources/shared-utils/createTransMatrix.ts +12 -0
  145. package/resources/typings/VreoUnit.ts +46 -5
  146. package/stylesheets/custom/SpatialScenePanel.css +14 -8
  147. package/stylesheets/default.css +116 -12
@@ -1,4 +1,4 @@
1
- import { Five } from '@realsee/five'
1
+ import { Five, MovePanoOptions } from '@realsee/five'
2
2
  import type { FivePlugin } from '@realsee/five'
3
3
  import * as TWEEN from '@tweenjs/tween.js'
4
4
 
@@ -20,7 +20,8 @@ function formatLatitude(rad: number) {
20
20
  return rad % PI_2
21
21
  }
22
22
  function formatLongitude(rad: number) {
23
- return ((rad % PI_2) + PI_2) % PI_2
23
+ // return ((rad % PI_2) + PI_2) % PI_2
24
+ return rad % PI_2
24
25
  }
25
26
 
26
27
  const getLongitudeParams = (from: number, to: number, rotation: Rotation): { from: number; to: number } => {
@@ -29,9 +30,11 @@ const getLongitudeParams = (from: number, to: number, rotation: Rotation): { fro
29
30
  from = formatLongitude(from)
30
31
  to = formatLongitude(to)
31
32
  // 逆时针旋转,初始值必须是较大的值
32
- if (rotation === Rotation.Anticlockwise && from < to) from += PI_2
33
+ if (rotation === Rotation.Anticlockwise && from > to) from += PI_2
34
+
33
35
  // 顺时针旋转,结束值必须是较大值
34
- if (rotation === Rotation.Clockwise && to < from) to += PI_2
36
+ if (rotation === Rotation.Clockwise && to > from) to += PI_2
37
+
35
38
  // Loop 旋转,找锐角旋转
36
39
  // 如果 to 比 from 大 180°,逆时针转
37
40
  // 如果 from 比 to 大 180°,顺时针转
@@ -50,63 +53,73 @@ function progressNumber(from: number, to: number, pst: number) {
50
53
  export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType> = (
51
54
  five: Five,
52
55
  ) => {
53
- const move = async (args: Partial<MoveArgs>, duration: number, opts: MoveOpts = { preload: true }) => {
54
- if (opts.asyncStartCallback) {
55
- opts.asyncStartCallback()
56
- }
56
+ const move = (args: Partial<MoveArgs>, duration: number, opts: MoveOpts = { preload: true }) => {
57
+ return new Promise<boolean>(async (resolve, reject) => {
58
+
59
+ if (opts.asyncStartCallback) {
60
+ opts.asyncStartCallback()
61
+ }
57
62
 
58
- if (args.mode && args.mode !== five.currentMode) {
59
- await new Promise((resolve) => {
60
- if (!args.mode) return
61
- five.once('modeChange', (mode) => {
62
- five.once('initAnimationEnded', () => {
63
- if (mode === args.mode) {
64
- resolve(true)
65
- }
63
+ if (five.panoIndex === undefined) {
64
+ return reject(false)
65
+ }
66
+
67
+ if (args.mode && args.mode !== five.currentMode) {
68
+ await new Promise((resolve) => {
69
+ if (!args.mode) return
70
+ five.once('modeChange', (mode) => {
71
+ five.once('initAnimationEnded', () => {
72
+ if (mode === args.mode) {
73
+ resolve(true)
74
+ }
75
+ })
76
+ })
77
+ five.changeMode(args.mode, {
78
+ fov: args.fov || undefined,
79
+ latitude: args.latitude || undefined,
80
+ longitude: args.longitude || undefined,
81
+ panoIndex: args.panoIndex || undefined,
66
82
  })
67
83
  })
68
- five.changeMode(args.mode, {
69
- fov: args.fov || undefined,
70
- latitude: args.latitude || undefined,
71
- longitude: args.longitude || undefined,
72
- panoIndex: args.panoIndex || undefined,
73
- })
74
- })
75
- }
84
+ }
76
85
 
77
- if (args.mode === Five.Mode.Floorplan) {
78
- return true
79
- }
86
+ if (args.mode === Five.Mode.Floorplan) {
87
+ return resolve(true)
88
+ }
80
89
 
81
- if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
82
- await five.preloadPano(args.panoIndex)
83
- }
90
+ if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
91
+ await five.preloadPano(args.panoIndex)
92
+ }
93
+
94
+ if (opts.asyncEndCallback) {
95
+ opts.asyncEndCallback()
96
+ }
97
+
98
+ if (
99
+ args.panoIndex === undefined &&
100
+ args.fov === undefined &&
101
+ args.latitude === undefined &&
102
+ args.longitude === undefined
103
+ ) {
104
+ return resolve(true)
105
+ }
84
106
 
85
- if (opts.asyncEndCallback) {
86
- opts.asyncEndCallback()
87
- }
88
107
 
89
- if (
90
- args.panoIndex === undefined &&
91
- args.fov === undefined &&
92
- args.latitude === undefined &&
93
- args.longitude === undefined
94
- ) {
95
- return true
96
- }
97
- return await new Promise<boolean>((resolve, reject) => {
98
108
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex
109
+
99
110
  if (panoIndex !== undefined) {
100
- five.moveToPano(
111
+ const movePanoOptions: MovePanoOptions = Object.assign(args, {
112
+ duration, // 移动耗时
113
+ moveEndCallback: () => resolve(true), // 移动结束
114
+ moveCancelCallback: () => {
115
+ resolve(true)
116
+ }, // 移动开始
117
+ // effect: args.transEffect || 'fade',
118
+ })
119
+
120
+ await five.moveToPano(
101
121
  panoIndex,
102
- Object.assign(
103
- {
104
- duration, // 移动耗时
105
- moveEndCallback: () => resolve(true), // 移动结束
106
- moveCancelCallback: () => reject(false), // 移动开始
107
- },
108
- args,
109
- ),
122
+ movePanoOptions,
110
123
  )
111
124
  } else {
112
125
  reject(false)
@@ -154,6 +167,7 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
154
167
  five.moveToPano(args.panoIndex, {
155
168
  moveEndCallback: () => resolve(true), // 移动结束
156
169
  moveCancelCallback: () => reject(false), // 移动开始
170
+ effect: 'fade',
157
171
  })
158
172
  })
159
173
  }
@@ -166,7 +180,7 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
166
180
  return await new Promise<boolean>((resolve, reject) => {
167
181
  const onUpdate = ({ progress }: { progress: number }) => {
168
182
  const state: Record<string, number> = {}
169
- state.longitude = progressNumber(from.longitude, to.longitude, progress)
183
+ state.longitude = progressNumber(from.longitude, to.longitude, progress) % PI_2
170
184
  state.latitude = progressNumber(from.latitude, to.latitude, progress)
171
185
  state.fov = progressNumber(from.fov, to.fov, progress)
172
186
  five.setState(state, true)
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable prettier/prettier */
2
- import { Mode, Pose } from '@realsee/five'
2
+ import { Mode, MovePanoOptions, Pose } from '@realsee/five'
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
5
5
  export interface CameraMovementPluginParameterType { }
@@ -39,6 +39,7 @@ export interface CameraMovementOptsCallback {
39
39
  export type MoveArgs = {
40
40
  mode: Mode
41
41
  panoIndex: number
42
+ transEffect?: "fly" | "fade" | "instant"
42
43
  } & Pose
43
44
 
44
45
  export type MoveOpts = {
@@ -45,12 +45,16 @@ function useVreoInstance() {
45
45
  export interface VreoActionCallbacks {
46
46
  /**
47
47
  * 载入剧本数据。
48
+ * @param vreoUnit 剧本数据
49
+ * @param currentTime 开始时间戳
50
+ * @param preload 是否开启预载
51
+ * @param force 是否强制载入
48
52
  */
49
- load: (vreoUnit: VreoUnit, currentTime?: number) => Promise<boolean>
53
+ load: (vreoUnit: VreoUnit, currentTime?: number, preload?: boolean, force?: boolean) => Promise<boolean>
50
54
  /**
51
55
  * 播放。
52
56
  */
53
- play: () => void
57
+ play: (currentTime?: number) => void
54
58
  /**
55
59
  * 暂停。
56
60
  */
@@ -77,7 +81,7 @@ export function useVreoAction() {
77
81
  [player]
78
82
  )
79
83
 
80
- const play = React.useCallback(() => player.play(), [player])
84
+ const play = React.useCallback((currentTime?: number) => player.play(currentTime || 0), [player])
81
85
  const pause = React.useCallback(() => player.pause(), [player])
82
86
  const show = React.useCallback(() => player.show(), [player])
83
87
  const hide = React.useCallback(() => player.hide(), [player])
@@ -0,0 +1,108 @@
1
+ import { Subscribe } from '@realsee/five'
2
+ import { requestAnimationFrameInterval } from './animationFrame'
3
+
4
+ /**
5
+ * 模拟 `<Audio>` 事件。
6
+ */
7
+ export type AudioLikeEvent = {
8
+ // 播放
9
+ play: () => void
10
+ // 语音状态 播放 -> 暂停
11
+ pause: () => void
12
+ // 语音时间刷新
13
+ timeupdate: () => void
14
+ // 播放
15
+ ended: () => void
16
+ }
17
+
18
+
19
+ /**
20
+ * 模拟 `<Audio>` 功能:没有音频,但执行逻辑跟 `<Audio>` 相似。
21
+ */
22
+ export class AudioLike extends Subscribe<AudioLikeEvent> {
23
+ private $timestamp = 0
24
+ private $currentTime = 0
25
+ private $duration = 0
26
+ private stopInterval?: () => void
27
+ muted = false
28
+ src = ''
29
+
30
+ setAttribute(name: string, value: string) {
31
+ // nothing todo
32
+ }
33
+
34
+ constructor({ duration }: { duration?: number } = {}) {
35
+ super()
36
+ if (duration) {
37
+ this.$duration = duration
38
+ }
39
+ }
40
+
41
+ play() {
42
+ if (this.$timestamp === 0) {
43
+ this.$timestamp = performance.now()
44
+ }
45
+ if (this.$currentTime === this.$duration) {
46
+ this.$currentTime = 0
47
+ }
48
+ this.stopInterval = requestAnimationFrameInterval(() => this.requestAnimationFrameLoop())
49
+ this.emit('play')
50
+ }
51
+
52
+ pause() {
53
+ if (this.stopInterval) {
54
+ this.stopInterval()
55
+ this.emit('pause')
56
+ this.stopInterval = undefined
57
+ }
58
+ this.$timestamp = 0
59
+ }
60
+
61
+ requestAnimationFrameLoop() {
62
+ const now = performance.now()
63
+ this.$currentTime = now - this.$timestamp
64
+ this.emit('timeupdate')
65
+ if (this.$currentTime >= this.$duration - 10) {
66
+ this.$currentTime = this.$duration
67
+ this.pause()
68
+ this.emit('ended')
69
+ }
70
+ }
71
+
72
+ get currentTime() {
73
+ return this.$currentTime / 1000
74
+ }
75
+
76
+ set currentTime(time: number) {
77
+ this.$currentTime = time
78
+ }
79
+
80
+ get duration() {
81
+ return this.$duration
82
+ }
83
+
84
+ set duration(duration: number) {
85
+ this.pause()
86
+ this.$duration = duration
87
+ this.$timestamp = 0
88
+ this.$currentTime = 0
89
+ }
90
+
91
+ get ended() {
92
+ return this.$currentTime === this.$duration
93
+ }
94
+
95
+ get paused() {
96
+ return !this.stopInterval
97
+ }
98
+
99
+ addEventListener(evtName: keyof AudioLikeEvent, callback: () => void, useCapture = false) {
100
+ this.on(evtName, callback)
101
+ }
102
+
103
+ removeEventListener(evtName: keyof AudioLikeEvent, callback: () => void, useCapture = false) {
104
+ this.off(evtName, callback)
105
+ }
106
+ }
107
+
108
+ export default AudioLike
@@ -0,0 +1,12 @@
1
+ import * as THREE from 'three'
2
+
3
+ export function createTransMatrix(arr1: number[]) {
4
+ const matrix4 = new THREE.Matrix4()
5
+ matrix4.fromArray(arr1)
6
+
7
+ return (arr2: number[]) => {
8
+ const vector3 = new THREE.Vector3(...arr2)
9
+ vector3.applyMatrix4(matrix4)
10
+ return vector3.toArray()
11
+ }
12
+ }
@@ -65,7 +65,7 @@ export type VreoKeyframeConfigMap = {
65
65
  * 剧本关键帧
66
66
  */
67
67
  export interface VreoKeyframe {
68
- uuid: string
68
+ uuid?: string
69
69
  type: VreoKeyframeEnum
70
70
  start: number
71
71
  end: number
@@ -104,18 +104,21 @@ export type VreoKeyframeEvent = { [key in VreoKeyframeEnum]: (keyframe: VreoKeyf
104
104
  // 新数据载入完成
105
105
  loaded: (vreoUnit: VreoUnit) => void
106
106
  // 语音状态 播放 -> 暂停
107
- paused: () => void
107
+ paused: (ended?: boolean) => void
108
108
  // 语音状态 暂停 -> 播放
109
109
  playing: () => void
110
110
  // 未知的 剧本帧类型
111
111
  unknownKeyframeType: (keyframe: Record<string, any>) => void
112
+ // 一次播放完成(试用,只抛事件不做任何额外的逻辑处理)
113
+ ended: () => void
112
114
  }
113
115
 
114
116
  /**
115
117
  * 相机运动
116
118
  */
117
119
  export type CameraMovementData = {
118
- effect: CameraMovementEffect
120
+ effect?: CameraMovementEffect
121
+ transEffect?: "fly" | "fade" | "instant"
119
122
  mode: Mode
120
123
  panoIndex: number
121
124
  loop?: boolean
@@ -163,9 +166,13 @@ export interface Vertex {
163
166
  }
164
167
 
165
168
  /**
166
- * 四个顶点元组
169
+ * 矩形顶点
167
170
  */
168
171
  export type QuadrangleVertexs = [Vertex, Vertex, Vertex, Vertex]
172
+ /**
173
+ * 顶点数组
174
+ */
175
+ export type Vertexs = Vertex[]
169
176
 
170
177
  /**
171
178
  * 视频广告
@@ -182,7 +189,18 @@ export type ModelVideoData = {
182
189
  /**
183
190
  * 视频映射在模型中的顶点
184
191
  */
185
- vertexs: QuadrangleVertexs
192
+ vertexs: QuadrangleVertexs | Vertexs
193
+ matrixWorld?: number[]
194
+ }
195
+
196
+ /**
197
+ * 四元数
198
+ */
199
+ export type Quaternion = {
200
+ x: number,
201
+ y: number,
202
+ z: number,
203
+ w: number
186
204
  }
187
205
 
188
206
  /**
@@ -191,6 +209,8 @@ export type ModelVideoData = {
191
209
  export type PanoTextLabelData = {
192
210
  text: string
193
211
  vertex: Vertex
212
+ normal?: Vertex
213
+ quaternion?: Quaternion
194
214
  fontSize?: number
195
215
  }
196
216
 
@@ -202,8 +222,23 @@ export enum PanoTagEnum {
202
222
  Image = 'Image',
203
223
  }
204
224
 
225
+ /**
226
+ * 标签样式种类
227
+ */
228
+ export enum PanoTagStyleEnum {
229
+ /**
230
+ * 生长动画:默认值
231
+ */
232
+ Growth = 'Growth',
233
+ /**
234
+ * 展开动画
235
+ */
236
+ Expand = 'Expand',
237
+ }
238
+
205
239
  export type PanoTagData = {
206
240
  type: PanoTagEnum
241
+ style: PanoTagStyleEnum
207
242
  text: string
208
243
  vertex: Vertex
209
244
  imgUrl?: string
@@ -235,11 +270,17 @@ export enum InfoPanelTypeEnum {
235
270
  Video = 'Video',
236
271
  }
237
272
 
273
+ export enum InfoPanelStyleEnum {
274
+ Drawer = 'Drawer',
275
+ PopUp = 'PopUp',
276
+ }
277
+
238
278
  /**
239
279
  * 信息面板
240
280
  */
241
281
  export type InfoPanelData = {
242
282
  type: InfoPanelTypeEnum
283
+ style?: InfoPanelStyleEnum
243
284
  url: string
244
285
  // 标题
245
286
  title?: string
@@ -77,9 +77,15 @@
77
77
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/panel-min.7d9ba2b7.png");
78
78
  background-size: 340rem 13.4375rem;
79
79
  background-repeat: no-repeat;
80
- animation: SpatialScenePanel-panel-sprites-animation 1.375s 0s steps(33) infinite normal
80
+ z-index: -1;
81
81
  }
82
82
 
83
+ .SpatialScenePanel-bg--animation {
84
+ /* animation: SpatialScenePanel-panel-sprites-animation 1.375s 0s steps(33) infinite normal; */
85
+ animation: SpatialScenePanel-panel-sprites-animation 1.375s 0.5s steps(33) normal;
86
+ }
87
+
88
+
83
89
  .SpatialScenePanel-show-area .SpatialScenePanel-header {
84
90
  width: 7.5rem;
85
91
  height: 1.375rem;
@@ -89,7 +95,9 @@
89
95
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/title-bg.377af865.png");
90
96
  background-size: 100%;
91
97
  margin: 1.875rem auto 1.25rem auto;
92
- padding-bottom: .25rem
98
+ background-image: linear-gradient(to left, rgba(234, 208, 154, 0), rgb(255 229 176 / 21%) 47%, rgba(234, 208, 154, 0));
99
+ border-bottom: 1px solid rgb(255 255 255 / 10%);
100
+ border-radius: 2px;
93
101
  }
94
102
 
95
103
  .SpatialScenePanel-show-area .SpatialScenePanel-header .SpatialScenePanel-title {
@@ -97,7 +105,7 @@
97
105
  font-size: 1.0625rem;
98
106
  color: #ffe5b0;
99
107
  letter-spacing: 0;
100
- line-height: 1.0625rem;
108
+ line-height: 1.125;
101
109
  text-shadow: 0 0 1.25rem rgba(0,0,0,0.15)
102
110
  }
103
111
 
@@ -106,7 +114,7 @@
106
114
  font-size: .625rem;
107
115
  color: rgba(255,229,176,0.6);
108
116
  letter-spacing: 0;
109
- line-height: .625rem;
117
+ line-height: 1.25rem;
110
118
  text-shadow: 0 0 .625rem rgba(255,255,255,0.03);
111
119
  align-self: flex-end
112
120
  }
@@ -270,9 +278,7 @@
270
278
 
271
279
  .SpatialScenePanel.hide .SpatialScenePanel-show-area {
272
280
  transform: scale3d(0,1,1);
273
- transition: -webkit-transform 500ms linear;
274
- transition: transform 500ms linear;
275
- transition: transform 500ms linear, -webkit-transform 500ms linear
281
+ transition: transform 150ms linear;
276
282
  }
277
283
 
278
284
  .SpatialScenePanel.hide .SpatialScenePanel-disappear-area {
@@ -298,6 +304,6 @@
298
304
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/line.4ac1c0bb.png");
299
305
  background-size: 10rem 11.666666666666666rem;
300
306
  background-repeat: no-repeat;
301
- animation: SpatialScenePanel-line-sprites-animation 500ms 500ms steps(23) 1 normal
307
+ animation: SpatialScenePanel-line-sprites-animation 500ms 100ms steps(23) 1 normal
302
308
  }
303
309
 
@@ -2,8 +2,8 @@
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
5
- width: 100vw;
6
- height: 100vh;
5
+ width: 100%;
6
+ height: 100%;
7
7
  pointer-events: none;
8
8
  }
9
9
 
@@ -31,7 +31,7 @@
31
31
  position: fixed;
32
32
  bottom: 0;
33
33
  left: 0;
34
- width: 100vw;
34
+ width: 100%;
35
35
  height: 150px;
36
36
  color: white;
37
37
  transition: transform 0.5s;
@@ -131,36 +131,44 @@
131
131
  width: 250px;
132
132
  font-size: 14px;
133
133
  opacity: 1;
134
- transition: opacity 0.5s;
134
+ transition: opacity 0.1s;
135
135
  }
136
+
136
137
  .vreo-prompter--audio {
137
138
  top: 72px;
138
139
  left: 64px;
139
140
  }
141
+
140
142
  .vreo-prompter-innerText {
141
143
  position: absolute;
142
144
  left: 0;
143
145
  top: 0;
144
146
  padding-right: 10px;
145
147
  }
148
+
149
+ .vreo-prompter--audio .vreo-prompter-innerText {
150
+ padding-right: 0;
151
+ text-align: center;
152
+ width: 100%;
153
+ }
146
154
  .vreo-prompter--hidden {
147
155
  opacity: 0;
148
156
  }
149
157
 
150
- .vreo-prompter-text-transition-enter-active {
158
+ /* .vreo-prompter-text-transition-enter-active {
151
159
  opacity: 0;
152
- }
160
+ } */
153
161
 
154
- .vreo-prompter-text-transition-enter-done {
162
+ /* .vreo-prompter-text-transition-enter-done {
155
163
  opacity: 1;
156
164
  transition: opacity 1000ms;
157
- }
158
-
165
+ } */
166
+ /*
159
167
  .vreo-prompter-text-transition-exit-active,
160
168
  .vreo-prompter-text-transition-exit-done {
161
169
  opacity: 0;
162
170
  transition: opacity 500ms;
163
- }
171
+ } */
164
172
 
165
173
  .VideoEffect {
166
174
  position: absolute;
@@ -187,6 +195,27 @@
187
195
  opacity: 0;
188
196
  }
189
197
 
198
+ .PanoTag--expand {
199
+ transform: translate(-50%, -50%);
200
+ color: white;
201
+ min-width: 150px;
202
+ max-width: 200px;
203
+ margin-top: 4px;
204
+ }
205
+
206
+ .PanoTag--expand .PanoTag-box.PanoTag-box--Text {
207
+ display: flex;
208
+ justify-content: center;
209
+ align-items: center;
210
+ padding-bottom: 4px;
211
+ }
212
+
213
+ .PanoTag-guideline {
214
+ width: 100%;
215
+ background: linear-gradient(45deg, transparent 20% ,white, transparent 80%);
216
+ height: 3px;
217
+ }
218
+
190
219
  .PanoTag--notHidden {
191
220
  opacity: 1;
192
221
  }
@@ -401,7 +430,11 @@
401
430
  transform-style: preserve-3d;
402
431
  pointer-events: none;
403
432
  z-index: 999999;
404
- transform: translate(-50%, -50%);
433
+ }
434
+ .__Dnalogel-plugin--CSS3DRenderPlugin {
435
+ display: flex;
436
+ align-items: center;
437
+ justify-content: center;
405
438
  }
406
439
 
407
440
  @keyframes straightPopPTL {
@@ -541,9 +574,80 @@
541
574
 
542
575
  .vreo-infoPanelVideo {
543
576
  max-width: 412px;
544
- }
577
+ }
545
578
 
546
579
  .vreo-panel--hidden .vreo-panel-inner {
547
580
  opacity: 0;
548
581
  transition: opacity 0.45s;
549
582
  }
583
+
584
+ .vreo-PopUp {
585
+ position: absolute;
586
+ left: 0;
587
+ top: 0;
588
+ width: 100%;
589
+ height: 100%;
590
+ pointer-events: none;
591
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7) 65%);
592
+ opacity: 0;
593
+ transition: opacity .45s;
594
+ display: flex;
595
+ justify-content: center;
596
+ align-items: center;
597
+ }
598
+
599
+ .vreo-PopUp.vreo-PopUp-visible {
600
+ opacity: 1;
601
+ pointer-events: all;
602
+ }
603
+
604
+ .vreo-PopUp-inner {
605
+ max-width: 100%;
606
+ max-height: 100%;
607
+ width: 339px;
608
+ height: 425px;
609
+ position: relative;
610
+ }
611
+
612
+ @media only screen and (min-width: 1080px) {
613
+ .vreo-PopUp-inner {
614
+ width: 678px;
615
+ height: 620px;
616
+ position: relative;
617
+ }
618
+ .vreo-infoPanelVideo {
619
+ max-width: 100%;
620
+ }
621
+ .vreo-infoPanelImg {
622
+ max-width: 100%;
623
+ }
624
+ }
625
+
626
+ .vreo-PopUp-inner .vreo-infoPanel {
627
+ background-color: initial;
628
+ justify-content: center;
629
+ }
630
+
631
+ .vreo-PopUp-inner .vreo-infoPanel-title {
632
+ position: absolute;
633
+ bottom: 32px;
634
+ left: 0;
635
+ z-index: 1;
636
+ flex-direction: column;
637
+ justify-content: end;
638
+ height: 200px;
639
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
640
+ }
641
+
642
+ .vreo-PopUp-inner .vreo-infoPanel-title .vreo-infoPanel-t1 {
643
+ padding-left: 0;
644
+ font-size: 20px;
645
+ font-weight: 600;
646
+ padding-bottom: 14px;
647
+ }
648
+
649
+ .vreo-PopUp-inner .vreo-infoPanel-title .vreo-infoPanel-t2 {
650
+ padding: 0 0 24px 0;
651
+ font-size: 14px;
652
+ opacity: 0.85;
653
+ }