@realsee/vreo 0.2.0-alpha.2 → 0.2.0-alpha.20
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.
- package/CHANGELOG.md +5 -0
- package/README.md +80 -5
- package/docs/assets/custom.css +2 -2
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +13 -13
- package/docs/classes/Player.Player-1.html +11 -11
- package/docs/classes/Player.VideoAgentMesh.html +53 -53
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.ec0a6e82.js +1 -0
- package/docs/demo/assets/default.55c3f308.css +1 -0
- package/docs/demo/assets/default.a5d6dd99.js +3952 -0
- package/docs/demo/assets/dynamic.8c30b7ae.js +1 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/examples.ddb41c97.js +25 -0
- package/docs/demo/assets/index.a7bafdff.css +1 -0
- package/docs/demo/assets/index.fc42be2b.js +1 -0
- package/docs/demo/assets/main.d119ebf7.js +1 -0
- package/docs/demo/assets/react.2d403aee.js +25 -0
- package/docs/demo/assets/react.855b3d23.css +1 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +17 -0
- package/docs/demo/index-react-dynamic.html +20 -0
- package/docs/demo/index-react.html +20 -0
- package/docs/demo/index.html +19 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -0
- package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
- package/docs/enums/Player.PanoEffectEnum.html +2 -2
- package/docs/enums/Player.PanoTagEnum.html +2 -2
- package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +37 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +3 -3
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
- package/docs/interfaces/Player.VreoKeyframe.html +2 -2
- package/docs/interfaces/Player.VreoUnit.html +2 -2
- package/docs/interfaces/Player.VreoVideo.html +2 -2
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +21 -15
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +5 -2
- package/docs/modules/react.html +1 -1
- package/docs/modules.html +1 -1
- package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.js +47 -0
- package/lib/PlayController/index.d.ts +38 -0
- package/lib/PlayController/index.js +300 -0
- package/lib/Player/App.js +5 -4
- package/lib/Player/Controller.d.ts +5 -1
- package/lib/Player/Controller.js +38 -5
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.js +98 -26
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.js +116 -24
- package/lib/Player/modules/Drawer/index.js +1 -1
- package/lib/Player/modules/PopUp/index.d.ts +2 -0
- package/lib/Player/modules/PopUp/index.js +43 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +17 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +113 -37
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +5 -1
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +9 -4
- package/lib/Player/modules/VideoAgent/index.d.ts +2 -0
- package/lib/Player/modules/VideoAgent/index.js +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
- package/lib/Player/modules/keyframes/CameraMovement/index.js +42 -6
- package/lib/Player/modules/keyframes/InfoPanel/index.js +74 -36
- package/lib/Player/modules/keyframes/ModelVideo/index.js +46 -9
- package/lib/Player/modules/keyframes/PanoEffect/index.js +1 -1
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -1
- package/lib/Player/modules/keyframes/PanoTag/index.js +20 -7
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -51
- package/lib/Player/modules/keyframes/Prompter/index.js +5 -19
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +31 -19
- package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
- package/lib/Player/typings.d.ts +6 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +104 -90
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
- package/lib/react/index.d.ts +7 -3
- package/lib/react/index.js +3 -3
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +165 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -3
- package/lib/shared-utils/animationFrame/tween.js +1 -1
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +43 -0
- package/lib/typings/VreoUnit.d.ts +42 -5
- package/lib/typings/VreoUnit.js +26 -6
- package/package.json +8 -8
- package/resources/PlayController/createHTMLAudioElement.ts +53 -0
- package/resources/PlayController/index.ts +167 -0
- package/resources/Player/App.tsx +2 -0
- package/resources/Player/Controller.ts +155 -121
- package/resources/Player/custom/SpatialScenePanel/index.tsx +148 -45
- package/resources/Player/index.tsx +186 -110
- package/resources/Player/modules/PopUp/index.tsx +26 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +66 -14
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +3 -3
- package/resources/Player/modules/VideoAgent/index.tsx +3 -2
- package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +31 -12
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +87 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +5 -15
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +25 -16
- package/resources/Player/typings.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +59 -48
- package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +108 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/typings/VreoUnit.ts +46 -5
- package/stylesheets/custom/SpatialScenePanel.css +14 -8
- 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
|
|
|
@@ -50,63 +50,73 @@ function progressNumber(from: number, to: number, pst: number) {
|
|
|
50
50
|
export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType> = (
|
|
51
51
|
five: Five,
|
|
52
52
|
) => {
|
|
53
|
-
const move =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const move = (args: Partial<MoveArgs>, duration: number, opts: MoveOpts = { preload: true }) => {
|
|
54
|
+
return new Promise<boolean>(async (resolve, reject) => {
|
|
55
|
+
|
|
56
|
+
if (opts.asyncStartCallback) {
|
|
57
|
+
opts.asyncStartCallback()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (five.panoIndex === undefined) {
|
|
61
|
+
return reject(false)
|
|
62
|
+
}
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
if (args.mode && args.mode !== five.currentMode) {
|
|
65
|
+
await new Promise((resolve) => {
|
|
66
|
+
if (!args.mode) return
|
|
67
|
+
five.once('modeChange', (mode) => {
|
|
68
|
+
five.once('initAnimationEnded', () => {
|
|
69
|
+
if (mode === args.mode) {
|
|
70
|
+
resolve(true)
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
five.changeMode(args.mode, {
|
|
75
|
+
fov: args.fov || undefined,
|
|
76
|
+
latitude: args.latitude || undefined,
|
|
77
|
+
longitude: args.longitude || undefined,
|
|
78
|
+
panoIndex: args.panoIndex || undefined,
|
|
66
79
|
})
|
|
67
80
|
})
|
|
68
|
-
|
|
69
|
-
fov: args.fov || undefined,
|
|
70
|
-
latitude: args.latitude || undefined,
|
|
71
|
-
longitude: args.longitude || undefined,
|
|
72
|
-
panoIndex: args.panoIndex || undefined,
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
}
|
|
81
|
+
}
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
if (args.mode === Five.Mode.Floorplan) {
|
|
84
|
+
return resolve(true)
|
|
85
|
+
}
|
|
80
86
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
|
|
88
|
+
await five.preloadPano(args.panoIndex)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (opts.asyncEndCallback) {
|
|
92
|
+
opts.asyncEndCallback()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (
|
|
96
|
+
args.panoIndex === undefined &&
|
|
97
|
+
args.fov === undefined &&
|
|
98
|
+
args.latitude === undefined &&
|
|
99
|
+
args.longitude === undefined
|
|
100
|
+
) {
|
|
101
|
+
return resolve(true)
|
|
102
|
+
}
|
|
84
103
|
|
|
85
|
-
if (opts.asyncEndCallback) {
|
|
86
|
-
opts.asyncEndCallback()
|
|
87
|
-
}
|
|
88
104
|
|
|
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
105
|
const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex
|
|
106
|
+
|
|
99
107
|
if (panoIndex !== undefined) {
|
|
100
|
-
|
|
108
|
+
const movePanoOptions: MovePanoOptions = Object.assign(args, {
|
|
109
|
+
duration, // 移动耗时
|
|
110
|
+
moveEndCallback: () => resolve(true), // 移动结束
|
|
111
|
+
moveCancelCallback: () => {
|
|
112
|
+
resolve(true)
|
|
113
|
+
}, // 移动开始
|
|
114
|
+
// effect: args.transEffect || 'fade',
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
await five.moveToPano(
|
|
101
118
|
panoIndex,
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
duration, // 移动耗时
|
|
105
|
-
moveEndCallback: () => resolve(true), // 移动结束
|
|
106
|
-
moveCancelCallback: () => reject(false), // 移动开始
|
|
107
|
-
},
|
|
108
|
-
args,
|
|
109
|
-
),
|
|
119
|
+
movePanoOptions,
|
|
110
120
|
)
|
|
111
121
|
} else {
|
|
112
122
|
reject(false)
|
|
@@ -154,6 +164,7 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
|
|
|
154
164
|
five.moveToPano(args.panoIndex, {
|
|
155
165
|
moveEndCallback: () => resolve(true), // 移动结束
|
|
156
166
|
moveCancelCallback: () => reject(false), // 移动开始
|
|
167
|
+
effect: 'fade',
|
|
157
168
|
})
|
|
158
169
|
})
|
|
159
170
|
}
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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: .
|
|
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:
|
|
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
|
|
307
|
+
animation: SpatialScenePanel-line-sprites-animation 500ms 100ms steps(23) 1 normal
|
|
302
308
|
}
|
|
303
309
|
|
package/stylesheets/default.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
5
|
-
width:
|
|
6
|
-
height:
|
|
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:
|
|
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.
|
|
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
|
-
|
|
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
|
+
}
|