@gcorevideo/player 2.18.3 → 2.19.0
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/assets/audio-selector/style.scss +156 -0
- package/assets/audio-selector/track-selector.ejs +12 -0
- package/assets/big-mute-button/big-mute-button.ejs +3 -0
- package/assets/big-mute-button/big-mute-button.scss +57 -0
- package/assets/bottom-gear/bottomgear.ejs +12 -0
- package/assets/bottom-gear/gear-sub-menu.scss +95 -0
- package/assets/bottom-gear/gear.scss +79 -0
- package/assets/clappr-nerd-stats/button.ejs +4 -0
- package/assets/clappr-nerd-stats/clappr-nerd-stats.ejs +212 -0
- package/assets/clappr-nerd-stats/clappr-nerd-stats.scss +488 -0
- package/assets/clappr-nerd-stats/options-list.ejs +9 -0
- package/assets/clappr-nerd-stats/settings.ejs +12 -0
- package/assets/clappr-nerd-stats/speedtest/speedtest.worker.js +775 -0
- package/assets/clips/clips.scss +3 -0
- package/assets/context-menu/context_menu.ejs +8 -0
- package/assets/context-menu/context_menu.scss +31 -0
- package/assets/dvr-controls/dvr_controls.scss +136 -0
- package/assets/dvr-controls/index.ejs +2 -0
- package/assets/error-screen/error_screen.ejs +13 -0
- package/assets/error-screen/error_screen.scss +40 -0
- package/assets/icons/new/arrow-left.svg +5 -0
- package/assets/icons/new/arrow-right.svg +5 -0
- package/assets/icons/new/check.svg +5 -0
- package/assets/icons/new/close.svg +12 -0
- package/assets/icons/new/full.svg +8 -0
- package/assets/icons/new/fullscreen-off.svg +14 -0
- package/assets/icons/new/fullscreen-on.svg +14 -0
- package/assets/icons/new/gear-hd.svg +16 -0
- package/assets/icons/new/gear.svg +12 -0
- package/assets/icons/new/hd.svg +8 -0
- package/assets/icons/new/pause.svg +5 -0
- package/assets/icons/new/pip.svg +5 -0
- package/assets/icons/new/play.svg +10 -0
- package/assets/icons/new/replayleft.svg +5 -0
- package/assets/icons/new/replayright.svg +5 -0
- package/assets/icons/new/speed.svg +5 -0
- package/assets/icons/new/stats.svg +3 -0
- package/assets/icons/new/stop.svg +3 -0
- package/assets/icons/new/subtitles-off.svg +5 -0
- package/assets/icons/new/subtitles-on.svg +6 -0
- package/assets/icons/new/volume-max.svg +5 -0
- package/assets/icons/new/volume-min.svg +5 -0
- package/assets/icons/new/volume-off.svg +5 -0
- package/assets/icons/old/cardboard.svg +4 -0
- package/assets/icons/old/close-share.svg +13 -0
- package/assets/icons/old/close.svg +13 -0
- package/assets/icons/old/fb.svg +13 -0
- package/assets/icons/old/fullscreen.svg +12 -0
- package/assets/icons/old/language.svg +1 -0
- package/assets/icons/old/pause.svg +12 -0
- package/assets/icons/old/play.svg +12 -0
- package/assets/icons/old/quality-arrow.svg +13 -0
- package/assets/icons/old/reload.svg +4 -0
- package/assets/icons/old/share.svg +13 -0
- package/assets/icons/old/sound-off.svg +15 -0
- package/assets/icons/old/sound-on.svg +15 -0
- package/assets/icons/old/streams.svg +3 -0
- package/assets/icons/old/twitter.svg +13 -0
- package/assets/icons/old/wn.svg +15 -0
- package/assets/icons/standard/01-play.svg +3 -0
- package/assets/icons/standard/02-pause.svg +3 -0
- package/assets/icons/standard/03-stop.svg +3 -0
- package/assets/icons/standard/04-volume.svg +3 -0
- package/assets/icons/standard/05-mute.svg +3 -0
- package/assets/icons/standard/06-expand.svg +3 -0
- package/assets/icons/standard/07-shrink.svg +3 -0
- package/assets/icons/standard/08-hd.svg +3 -0
- package/assets/icons/standard/09-cc.svg +8 -0
- package/assets/icons/standard/10-reload.svg +4 -0
- package/assets/level-selector/button.ejs +8 -0
- package/assets/level-selector/list.ejs +22 -0
- package/assets/level-selector/style.scss +4 -0
- package/assets/logo/styles/logo.scss +10 -0
- package/assets/logo/templates/logo.ejs +3 -0
- package/assets/media-control/closed-hand.cur +0 -0
- package/assets/media-control/container.scss +57 -0
- package/assets/media-control/media-control.ejs +133 -0
- package/assets/media-control/media-control.scss +390 -0
- package/assets/media-control/plugins.scss +94 -0
- package/assets/media-control/width270.scss +50 -0
- package/assets/media-control/width370.scss +263 -0
- package/assets/multi-camera/multicamera.ejs +29 -0
- package/assets/multi-camera/style.scss +176 -0
- package/assets/picture-in-picture/button.ejs +3 -0
- package/assets/picture-in-picture/button.scss +11 -0
- package/assets/playback-rate/button.ejs +6 -0
- package/assets/playback-rate/list.ejs +14 -0
- package/assets/playback-rate/playback-rate-selector.ejs +9 -0
- package/assets/poster/poster.ejs +1 -0
- package/assets/poster/poster.scss +32 -0
- package/assets/seek-time/seek-time.html +2 -0
- package/assets/seek-time/seek-time.scss +38 -0
- package/assets/share/share.ejs +37 -0
- package/assets/share/style.scss +104 -0
- package/assets/skip-time/skip-time.ejs +8 -0
- package/assets/skip-time/style.scss +24 -0
- package/assets/spinner-three-bounce/spinner.ejs +3 -0
- package/assets/spinner-three-bounce/spinner.scss +44 -0
- package/assets/style/main.scss +50 -0
- package/assets/style/theme.scss +42 -0
- package/assets/style/variables.scss +7 -0
- package/assets/subtitles/combobox copy.ejs +16 -0
- package/assets/subtitles/combobox.ejs +16 -0
- package/assets/subtitles/string.ejs +3 -0
- package/assets/subtitles/style.scss +99 -0
- package/assets/thumbnails/scrub-thumbnails.ejs +10 -0
- package/assets/thumbnails/style.scss +75 -0
- package/assets/vast-ads/style.scss +112 -0
- package/assets/video360/button.ejs +1 -0
- package/assets/video360/style.scss +8 -0
- package/build/vite-raw-plugin.js +18 -0
- package/dist/index.js +1 -1
- package/dist/plugins/index.css +2164 -0
- package/dist/plugins/index.js/index.plugins.js +40837 -0
- package/dist/plugins/index.plugins.js +40837 -0
- package/lib/index.core.d.ts +15 -0
- package/lib/index.core.d.ts.map +1 -0
- package/lib/index.core.js +14 -0
- package/lib/index.d.ts +2 -14
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -14
- package/lib/index.plugins.d.ts +38 -0
- package/lib/index.plugins.d.ts.map +1 -0
- package/lib/index.plugins.js +40 -0
- package/lib/plugins/audio-selector/AudioSelector.d.ts +3 -3
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +6 -12
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +2 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +7 -12
- package/lib/plugins/bottom-gear/BottomGear.d.ts +4 -3
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +11 -16
- package/lib/plugins/build.d.ts +2 -0
- package/lib/plugins/build.d.ts.map +1 -0
- package/lib/plugins/build.js +1 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +44 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +294 -0
- package/lib/plugins/clappr-nerd-stats/formatter.d.ts +8 -0
- package/lib/plugins/clappr-nerd-stats/formatter.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/formatter.js +91 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts +54 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +335 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts +9 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.js +154 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts +6 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/types.js +1 -0
- package/lib/plugins/clappr-nerd-stats/types.d.ts +4 -0
- package/lib/plugins/clappr-nerd-stats/types.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/types.js +1 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +56 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/ClapprStats.js +332 -0
- package/lib/plugins/clappr-stats/types.d.ts +50 -0
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/types.js +5 -0
- package/lib/plugins/clappr-stats/utils.d.ts +3 -0
- package/lib/plugins/clappr-stats/utils.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/utils.js +40 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +2 -2
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +4 -6
- package/lib/plugins/clips/Clips.d.ts +23 -0
- package/lib/plugins/clips/Clips.d.ts.map +1 -0
- package/lib/plugins/clips/Clips.js +109 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts +36 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -0
- package/lib/plugins/context-menu/ContextMenu.js +102 -0
- package/lib/plugins/disable-controls/DisableControls.d.ts +1 -1
- package/lib/plugins/disable-controls/DisableControls.d.ts.map +1 -1
- package/lib/plugins/disable-controls/DisableControls.js +3 -5
- package/lib/plugins/dvr-controls/DVRControls.d.ts +4 -4
- package/lib/plugins/dvr-controls/DVRControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DVRControls.js +5 -4
- package/lib/plugins/error-screen/ErrorScreen.d.ts +44 -0
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -0
- package/lib/plugins/error-screen/ErrorScreen.js +179 -0
- package/lib/plugins/favicon/Favicon.d.ts +24 -0
- package/lib/plugins/favicon/Favicon.d.ts.map +1 -0
- package/lib/plugins/favicon/Favicon.js +106 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +30 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.js +114 -0
- package/lib/plugins/index.d.ts +38 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +40 -0
- package/lib/plugins/kibo/index.d.ts +23 -0
- package/lib/plugins/kibo/index.d.ts.map +1 -0
- package/lib/plugins/kibo/index.js +199 -0
- package/lib/plugins/level-selector/LevelSelector.d.ts +48 -17
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +169 -155
- package/lib/plugins/logo/Logo.d.ts +29 -0
- package/lib/plugins/logo/Logo.d.ts.map +1 -0
- package/lib/plugins/logo/Logo.js +181 -0
- package/lib/plugins/logo/utils/index.d.ts +22 -0
- package/lib/plugins/logo/utils/index.d.ts.map +1 -0
- package/lib/plugins/logo/utils/index.js +32 -0
- package/lib/plugins/media-control/MediaControl.d.ts +20 -25
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +136 -106
- package/lib/plugins/multi-camera/MultiCamera.d.ts +59 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -0
- package/lib/plugins/multi-camera/MultiCamera.js +353 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +20 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.js +68 -0
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +42 -0
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -0
- package/lib/plugins/playback-rate/PlaybackRate.js +205 -0
- package/lib/plugins/poster/Poster.d.ts +18 -17
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +83 -37
- package/lib/plugins/seek-time/SeekTime.d.ts +38 -0
- package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -0
- package/lib/plugins/seek-time/SeekTime.js +153 -0
- package/lib/plugins/share/Share.d.ts +38 -0
- package/lib/plugins/share/Share.d.ts.map +1 -0
- package/lib/plugins/share/Share.js +122 -0
- package/lib/plugins/skip-time/SkipTime.d.ts +28 -0
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -0
- package/lib/plugins/skip-time/SkipTime.js +86 -0
- package/lib/plugins/source-controller/SourceController.d.ts +41 -0
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -0
- package/lib/plugins/source-controller/SourceController.js +199 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +26 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +117 -0
- package/lib/plugins/statistics/Statistics.d.ts +52 -0
- package/lib/plugins/statistics/Statistics.d.ts.map +1 -0
- package/lib/plugins/statistics/Statistics.js +130 -0
- package/lib/plugins/subtitles/Subtitles.d.ts +61 -0
- package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -0
- package/lib/plugins/subtitles/Subtitles.js +354 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts +47 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -0
- package/lib/plugins/thumbnails/Thumbnails.js +414 -0
- package/lib/plugins/types.d.ts +8 -0
- package/lib/plugins/types.d.ts.map +1 -0
- package/lib/plugins/types.js +1 -0
- package/lib/plugins/utils.d.ts +5 -0
- package/lib/plugins/utils.d.ts.map +1 -0
- package/lib/plugins/utils.js +68 -0
- package/lib/plugins/vast-ads/VastAds.d.ts +72 -0
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -0
- package/lib/plugins/vast-ads/VastAds.js +686 -0
- package/lib/plugins/vast-ads/loaderxml.d.ts +32 -0
- package/lib/plugins/vast-ads/loaderxml.d.ts.map +1 -0
- package/lib/plugins/vast-ads/loaderxml.js +226 -0
- package/lib/plugins/vast-ads/roll.d.ts +60 -0
- package/lib/plugins/vast-ads/roll.d.ts.map +1 -0
- package/lib/plugins/vast-ads/roll.js +415 -0
- package/lib/plugins/vast-ads/rollmanager.d.ts +62 -0
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -0
- package/lib/plugins/vast-ads/rollmanager.js +347 -0
- package/lib/plugins/vast-ads/sctemanager.d.ts +18 -0
- package/lib/plugins/vast-ads/sctemanager.d.ts.map +1 -0
- package/lib/plugins/vast-ads/sctemanager.js +116 -0
- package/lib/plugins/vast-ads/types.d.ts +12 -0
- package/lib/plugins/vast-ads/types.d.ts.map +1 -0
- package/lib/plugins/vast-ads/types.js +1 -0
- package/lib/plugins/vast-ads/urlhandler.d.ts +4 -0
- package/lib/plugins/vast-ads/urlhandler.d.ts.map +1 -0
- package/lib/plugins/vast-ads/urlhandler.js +30 -0
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts +6 -0
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts.map +1 -0
- package/lib/plugins/vast-ads/xmlhttprequest.js +39 -0
- package/lib/plugins/vast-ads/xmlmerge.d.ts +12 -0
- package/lib/plugins/vast-ads/xmlmerge.d.ts.map +1 -0
- package/lib/plugins/vast-ads/xmlmerge.js +82 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts +21 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -0
- package/lib/plugins/volume-fade/VolumeFade.js +90 -0
- package/package.json +10 -2
- package/rollup.config.js +32 -2
- package/src/index.core.ts +15 -0
- package/src/index.plugins.ts +42 -0
- package/src/index.ts +2 -15
- package/src/plugins/audio-selector/AudioSelector.ts +370 -0
- package/src/plugins/big-mute-button/BigMuteButton.ts +187 -0
- package/src/plugins/bottom-gear/BottomGear.ts +122 -0
- package/src/plugins/build.ts +1 -0
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +369 -0
- package/src/plugins/clappr-nerd-stats/formatter.ts +109 -0
- package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +414 -0
- package/src/plugins/clappr-nerd-stats/speedtest/index.ts +183 -0
- package/src/plugins/clappr-nerd-stats/speedtest/types.ts +5 -0
- package/src/plugins/clappr-nerd-stats/types.ts +3 -0
- package/src/plugins/clappr-stats/ClapprStats.ts +441 -0
- package/src/plugins/clappr-stats/types.ts +52 -0
- package/src/plugins/clappr-stats/utils.ts +42 -0
- package/src/plugins/click-to-pause/ClickToPause.ts +93 -0
- package/src/plugins/clips/Clips.ts +152 -0
- package/src/plugins/context-menu/ContextMenu.ts +134 -0
- package/src/plugins/disable-controls/DisableControls.ts +81 -0
- package/src/plugins/dvr-controls/DvrControls.ts +131 -0
- package/src/plugins/error-screen/ErrorScreen.ts +241 -0
- package/src/plugins/favicon/Favicon.ts +137 -0
- package/src/plugins/ga-events/GaEvents.js +395 -0
- package/src/plugins/ga-events/ga-tracking.js +46 -0
- package/src/plugins/google-analytics/GoogleAnalytics.ts +147 -0
- package/src/plugins/index.ts +42 -0
- package/src/plugins/kibo/index.ts +244 -0
- package/src/plugins/level-selector/LevelSelector.ts +400 -0
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +72 -0
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +11 -0
- package/src/plugins/logo/Logo.ts +233 -0
- package/src/plugins/logo/utils/index.ts +46 -0
- package/src/plugins/media-control/MediaControl.ts +1383 -0
- package/src/plugins/multi-camera/MultiCamera copy.xts +414 -0
- package/src/plugins/multi-camera/MultiCamera.ts +426 -0
- package/src/plugins/picture-in-picture/PictureInPicture.ts +87 -0
- package/src/plugins/playback-rate/PlaybackRate.ts +269 -0
- package/src/plugins/poster/Poster.ts +298 -0
- package/src/plugins/seek-time/SeekTime.ts +191 -0
- package/src/plugins/share/Share.ts +148 -0
- package/src/plugins/skip-time/SkipTime.ts +109 -0
- package/src/plugins/source-controller/SourceController.ts +239 -0
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +230 -0
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +135 -0
- package/src/plugins/statistics/Statistics copy.xts +296 -0
- package/src/plugins/statistics/Statistics.ts +207 -0
- package/src/plugins/subtitles/Subtitles.ts +505 -0
- package/src/plugins/thumbnails/Thumbnails.ts +530 -0
- package/src/plugins/types.ts +7 -0
- package/src/plugins/typings/globals.d.ts +10 -0
- package/src/plugins/typings/parse-srt.d.ts +14 -0
- package/src/plugins/typings/workers.d.ts +3 -0
- package/src/plugins/utils.ts +77 -0
- package/src/plugins/vast-ads/VastAds.ts +915 -0
- package/src/plugins/vast-ads/loaderxml.ts +260 -0
- package/src/plugins/vast-ads/roll.ts +492 -0
- package/src/plugins/vast-ads/rollmanager.ts +403 -0
- package/src/plugins/vast-ads/sctemanager.ts +134 -0
- package/src/plugins/vast-ads/types.ts +14 -0
- package/src/plugins/vast-ads/urlhandler.ts +37 -0
- package/src/plugins/vast-ads/xmlhttprequest.ts +44 -0
- package/src/plugins/vast-ads/xmlmerge.ts +96 -0
- package/src/plugins/video360/VRControls.js +104 -0
- package/src/plugins/video360/VREffect.js +422 -0
- package/src/plugins/video360/Video360.js +979 -0
- package/src/plugins/video360/orbit-oriention-controls.js +1002 -0
- package/src/plugins/video360/utils.js +49 -0
- package/src/plugins/volume-fade/VolumeFade.ts +109 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a quaternion to an angle
|
|
3
|
+
*
|
|
4
|
+
* Taken from https://stackoverflow.com/a/35448946
|
|
5
|
+
* Thanks P. Ellul
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as THREE from 'three';
|
|
9
|
+
|
|
10
|
+
function Quat2Angle(x, y, z, w) {
|
|
11
|
+
const test = x * y + z * w;
|
|
12
|
+
|
|
13
|
+
// singularity at North Pole
|
|
14
|
+
if (test > 0.499) {
|
|
15
|
+
const yaw = 2 * Math.atan2(x, w);
|
|
16
|
+
const pitch = Math.PI / 2;
|
|
17
|
+
const roll = 0;
|
|
18
|
+
|
|
19
|
+
return new THREE.Vector3(pitch, roll, yaw);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// singularity at South Pole
|
|
23
|
+
if (test < -0.499) {
|
|
24
|
+
const yaw = -2 * Math.atan2(x, w);
|
|
25
|
+
const pitch = -Math.PI / 2;
|
|
26
|
+
const roll = 0;
|
|
27
|
+
|
|
28
|
+
return new THREE.Vector3(pitch, roll, yaw);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const sqx = x * x;
|
|
32
|
+
const sqy = y * y;
|
|
33
|
+
const sqz = z * z;
|
|
34
|
+
const yaw = Math.atan2(2 * y * w - 2 * x * z, 1 - 2 * sqy - 2 * sqz);
|
|
35
|
+
const pitch = Math.asin(2 * test);
|
|
36
|
+
const roll = Math.atan2(2 * x * w - 2 * y * z, 1 - 2 * sqx - 2 * sqz);
|
|
37
|
+
|
|
38
|
+
return new THREE.Vector3(pitch, roll, yaw);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
class OrbitOrientationControls {
|
|
42
|
+
constructor(options) {
|
|
43
|
+
//https://github.com/mrdoob/three.js/issues/9562
|
|
44
|
+
this.initLibraryCauseThreeJSDumbguys();
|
|
45
|
+
this.object = options.camera;
|
|
46
|
+
this.domElement = options.canvas;
|
|
47
|
+
this.orbit = new THREE.OrbitControls(this.object, this.domElement);
|
|
48
|
+
this.speed = 0.5;
|
|
49
|
+
this.orbit.target.set(0, 0, -1);
|
|
50
|
+
this.orbit.enableZoom = false;
|
|
51
|
+
this.orbit.enablePan = false;
|
|
52
|
+
this.orbit.rotateSpeed = -this.speed;
|
|
53
|
+
|
|
54
|
+
// if orientation is supported
|
|
55
|
+
if (options.orientation) {
|
|
56
|
+
this.orientation = new THREE.DeviceOrientationControls(this.object);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// if projection is not full view
|
|
60
|
+
// limit the rotation angle in order to not display back half view
|
|
61
|
+
if (options.halfView) {
|
|
62
|
+
this.orbit.minAzimuthAngle = -Math.PI / 4;
|
|
63
|
+
this.orbit.maxAzimuthAngle = Math.PI / 4;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
update() {
|
|
68
|
+
// orientation updates the camera using quaternions and
|
|
69
|
+
// orbit updates the camera using angles. They are incompatible
|
|
70
|
+
// and one update overrides the other. So before
|
|
71
|
+
// orbit overrides orientation we convert our quaternion changes to
|
|
72
|
+
// an angle change. Then save the angle into orbit so that
|
|
73
|
+
// it will take those into account when it updates the camera and overrides
|
|
74
|
+
// our changes
|
|
75
|
+
|
|
76
|
+
if (this.orientation) {
|
|
77
|
+
this.orientation.update();
|
|
78
|
+
|
|
79
|
+
const quat = this.orientation.object.quaternion;
|
|
80
|
+
const currentAngle = Quat2Angle(quat.x, quat.y, quat.z, quat.w);
|
|
81
|
+
|
|
82
|
+
// we also have to store the last angle since quaternions are b
|
|
83
|
+
if (typeof this.lastAngle_ === 'undefined') {
|
|
84
|
+
this.lastAngle_ = currentAngle;
|
|
85
|
+
}
|
|
86
|
+
this.orbit.rotateLeft((this.lastAngle_.z - currentAngle.z));
|
|
87
|
+
this.orbit.rotateUp((this.lastAngle_.y - currentAngle.y));
|
|
88
|
+
this.lastAngle_ = currentAngle;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.orbit.update();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
dispose() {
|
|
95
|
+
this.orbit.dispose();
|
|
96
|
+
|
|
97
|
+
if (this.orientation) {
|
|
98
|
+
this.orientation.dispose();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
initLibraryCauseThreeJSDumbguys() {
|
|
103
|
+
/**
|
|
104
|
+
* @author richt / http://richt.me
|
|
105
|
+
* @author WestLangley / http://github.com/WestLangley
|
|
106
|
+
*
|
|
107
|
+
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @author richt / http://richt.me
|
|
112
|
+
* @author WestLangley / http://github.com/WestLangley
|
|
113
|
+
*
|
|
114
|
+
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
// eslint-disable-next-line no-import-assign
|
|
118
|
+
THREE.DeviceOrientationControls = function (object) {
|
|
119
|
+
const scope = this;
|
|
120
|
+
|
|
121
|
+
this.object = object;
|
|
122
|
+
this.object.rotation.reorder('YXZ');
|
|
123
|
+
|
|
124
|
+
this.enabled = true;
|
|
125
|
+
|
|
126
|
+
this.deviceOrientation = {};
|
|
127
|
+
this.screenOrientation = 0;
|
|
128
|
+
|
|
129
|
+
this.alphaOffset = 0; // radians
|
|
130
|
+
|
|
131
|
+
const onDeviceOrientationChangeEvent = function (event) {
|
|
132
|
+
scope.deviceOrientation = event;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const onScreenOrientationChangeEvent = function () {
|
|
136
|
+
scope.screenOrientation = window.orientation || 0;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''
|
|
140
|
+
|
|
141
|
+
const setObjectQuaternion = function () {
|
|
142
|
+
const zee = new THREE.Vector3(0, 0, 1);
|
|
143
|
+
|
|
144
|
+
const euler = new THREE.Euler();
|
|
145
|
+
|
|
146
|
+
const q0 = new THREE.Quaternion();
|
|
147
|
+
|
|
148
|
+
const q1 = new THREE.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); // - PI/2 around the x-axis
|
|
149
|
+
|
|
150
|
+
return function (quaternion, alpha, beta, gamma, orient) {
|
|
151
|
+
euler.set(beta, alpha, -gamma, 'YXZ'); // 'ZXY' for the device, but 'YXZ' for us
|
|
152
|
+
|
|
153
|
+
quaternion.setFromEuler(euler); // orient the device
|
|
154
|
+
|
|
155
|
+
quaternion.multiply(q1); // camera looks out the back of the device, not the top
|
|
156
|
+
|
|
157
|
+
quaternion.multiply(q0.setFromAxisAngle(zee, -orient)); // adjust for screen orientation
|
|
158
|
+
};
|
|
159
|
+
}();
|
|
160
|
+
|
|
161
|
+
this.connect = function () {
|
|
162
|
+
onScreenOrientationChangeEvent(); // run once on load
|
|
163
|
+
|
|
164
|
+
window.addEventListener('orientationchange', onScreenOrientationChangeEvent, false);
|
|
165
|
+
window.addEventListener('deviceorientation', onDeviceOrientationChangeEvent, false);
|
|
166
|
+
|
|
167
|
+
scope.enabled = true;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this.disconnect = function () {
|
|
171
|
+
window.removeEventListener('orientationchange', onScreenOrientationChangeEvent, false);
|
|
172
|
+
window.removeEventListener('deviceorientation', onDeviceOrientationChangeEvent, false);
|
|
173
|
+
|
|
174
|
+
scope.enabled = false;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
this.update = function () {
|
|
178
|
+
if (scope.enabled === false) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const device = scope.deviceOrientation;
|
|
183
|
+
|
|
184
|
+
if (device) {
|
|
185
|
+
const alpha = device.alpha ? THREE.Math.degToRad(device.alpha) + scope.alphaOffset : 0; // Z
|
|
186
|
+
|
|
187
|
+
const beta = device.beta ? THREE.Math.degToRad(device.beta) : 0; // X'
|
|
188
|
+
|
|
189
|
+
const gamma = device.gamma ? THREE.Math.degToRad(device.gamma) : 0; // Y''
|
|
190
|
+
|
|
191
|
+
const orient = scope.screenOrientation ? THREE.Math.degToRad(scope.screenOrientation) : 0; // O
|
|
192
|
+
|
|
193
|
+
if (alpha === 0 || beta === 0 || gamma === 0) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
setObjectQuaternion(scope.object.quaternion, alpha, beta, gamma, orient);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
this.dispose = function () {
|
|
202
|
+
scope.disconnect();
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
this.connect();
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @author qiao / https://github.com/qiao
|
|
210
|
+
* @author mrdoob / http://mrdoob.com
|
|
211
|
+
* @author alteredq / http://alteredqualia.com/
|
|
212
|
+
* @author WestLangley / http://github.com/WestLangley
|
|
213
|
+
* @author erich666 / http://erichaines.com
|
|
214
|
+
* @author ScieCode / http://github.com/sciecode
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
// This set of controls performs orbiting, dollying (zooming), and panning.
|
|
218
|
+
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
|
|
219
|
+
//
|
|
220
|
+
// Orbit - left mouse / touch: one-finger move
|
|
221
|
+
// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
|
|
222
|
+
// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move
|
|
223
|
+
|
|
224
|
+
// eslint-disable-next-line no-import-assign
|
|
225
|
+
THREE.OrbitControls = function (object, domElement) {
|
|
226
|
+
let zoomChanged;
|
|
227
|
+
const panOffset = new THREE.Vector3();
|
|
228
|
+
let scale;
|
|
229
|
+
const sphericalDelta = new THREE.Spherical();
|
|
230
|
+
// current position in spherical coordinates
|
|
231
|
+
const spherical = new THREE.Spherical();
|
|
232
|
+
|
|
233
|
+
const EPS = 0.000001;
|
|
234
|
+
// internals
|
|
235
|
+
const changeEvent = { type: 'change' };
|
|
236
|
+
|
|
237
|
+
const scope = this;
|
|
238
|
+
|
|
239
|
+
this.object = object;
|
|
240
|
+
|
|
241
|
+
this.domElement = (domElement !== undefined) ? domElement : document;
|
|
242
|
+
|
|
243
|
+
// Set to false to disable this control
|
|
244
|
+
this.enabled = true;
|
|
245
|
+
|
|
246
|
+
// "target" sets the location of focus, where the object orbits around
|
|
247
|
+
this.target = new THREE.Vector3();
|
|
248
|
+
|
|
249
|
+
// How far you can dolly in and out ( PerspectiveCamera only )
|
|
250
|
+
this.minDistance = 0;
|
|
251
|
+
this.maxDistance = Infinity;
|
|
252
|
+
|
|
253
|
+
// How far you can zoom in and out ( OrthographicCamera only )
|
|
254
|
+
this.minZoom = 0;
|
|
255
|
+
this.maxZoom = Infinity;
|
|
256
|
+
|
|
257
|
+
// How far you can orbit vertically, upper and lower limits.
|
|
258
|
+
// Range is 0 to Math.PI radians.
|
|
259
|
+
this.minPolarAngle = 0; // radians
|
|
260
|
+
this.maxPolarAngle = Math.PI; // radians
|
|
261
|
+
|
|
262
|
+
// How far you can orbit horizontally, upper and lower limits.
|
|
263
|
+
// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].
|
|
264
|
+
this.minAzimuthAngle = -Infinity; // radians
|
|
265
|
+
this.maxAzimuthAngle = Infinity; // radians
|
|
266
|
+
|
|
267
|
+
// Set to true to enable damping (inertia)
|
|
268
|
+
// If damping is enabled, you must call controls.update() in your animation loop
|
|
269
|
+
this.enableDamping = false;
|
|
270
|
+
this.dampingFactor = 0.25;
|
|
271
|
+
|
|
272
|
+
// This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
|
|
273
|
+
// Set to false to disable zooming
|
|
274
|
+
this.enableZoom = true;
|
|
275
|
+
this.zoomSpeed = 1.0;
|
|
276
|
+
|
|
277
|
+
// Set to false to disable rotating
|
|
278
|
+
this.enableRotate = true;
|
|
279
|
+
this.rotateSpeed = 1.0;
|
|
280
|
+
|
|
281
|
+
// Set to false to disable panning
|
|
282
|
+
this.enablePan = true;
|
|
283
|
+
this.panSpeed = 1.0;
|
|
284
|
+
this.screenSpacePanning = false; // if true, pan in screen-space
|
|
285
|
+
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
|
|
286
|
+
|
|
287
|
+
// Set to true to automatically rotate around the target
|
|
288
|
+
// If auto-rotate is enabled, you must call controls.update() in your animation loop
|
|
289
|
+
this.autoRotate = false;
|
|
290
|
+
this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60
|
|
291
|
+
|
|
292
|
+
// Set to false to disable use of the keys
|
|
293
|
+
this.enableKeys = true;
|
|
294
|
+
|
|
295
|
+
// The four arrow keys
|
|
296
|
+
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };
|
|
297
|
+
|
|
298
|
+
// Mouse buttons
|
|
299
|
+
this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };
|
|
300
|
+
|
|
301
|
+
// for reset
|
|
302
|
+
this.target0 = this.target.clone();
|
|
303
|
+
this.position0 = this.object.position.clone();
|
|
304
|
+
this.zoom0 = this.object.zoom;
|
|
305
|
+
|
|
306
|
+
//
|
|
307
|
+
// public methods
|
|
308
|
+
//
|
|
309
|
+
|
|
310
|
+
this.getPolarAngle = function () {
|
|
311
|
+
return spherical.phi;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
this.getAzimuthalAngle = function () {
|
|
315
|
+
return spherical.theta;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
this.saveState = function () {
|
|
319
|
+
scope.target0.copy(scope.target);
|
|
320
|
+
scope.position0.copy(scope.object.position);
|
|
321
|
+
scope.zoom0 = scope.object.zoom;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
this.reset = function () {
|
|
325
|
+
scope.target.copy(scope.target0);
|
|
326
|
+
scope.object.position.copy(scope.position0);
|
|
327
|
+
scope.object.zoom = scope.zoom0;
|
|
328
|
+
|
|
329
|
+
scope.object.updateProjectionMatrix();
|
|
330
|
+
scope.dispatchEvent(changeEvent);
|
|
331
|
+
|
|
332
|
+
scope.update();
|
|
333
|
+
|
|
334
|
+
state = STATE.NONE;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// this method is exposed, but perhaps it would be better if we can make it private...
|
|
338
|
+
this.update = function () {
|
|
339
|
+
const offset = new THREE.Vector3();
|
|
340
|
+
|
|
341
|
+
// so camera.up is the orbit axis
|
|
342
|
+
const quat = new THREE.Quaternion().setFromUnitVectors(object.up, new THREE.Vector3(0, 1, 0));
|
|
343
|
+
const quatInverse = quat.clone().inverse();
|
|
344
|
+
|
|
345
|
+
const lastPosition = new THREE.Vector3();
|
|
346
|
+
const lastQuaternion = new THREE.Quaternion();
|
|
347
|
+
|
|
348
|
+
return function update() {
|
|
349
|
+
const position = scope.object.position;
|
|
350
|
+
|
|
351
|
+
offset.copy(position).sub(scope.target);
|
|
352
|
+
|
|
353
|
+
// rotate offset to "y-axis-is-up" space
|
|
354
|
+
offset.applyQuaternion(quat);
|
|
355
|
+
|
|
356
|
+
// angle from z-axis around y-axis
|
|
357
|
+
spherical.setFromVector3(offset);
|
|
358
|
+
|
|
359
|
+
if (scope.autoRotate && state === STATE.NONE) {
|
|
360
|
+
this.rotateLeft(getAutoRotationAngle());
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
spherical.theta += sphericalDelta.theta;
|
|
364
|
+
spherical.phi += sphericalDelta.phi;
|
|
365
|
+
|
|
366
|
+
// restrict theta to be between desired limits
|
|
367
|
+
spherical.theta = Math.max(scope.minAzimuthAngle, Math.min(scope.maxAzimuthAngle, spherical.theta));
|
|
368
|
+
|
|
369
|
+
// restrict phi to be between desired limits
|
|
370
|
+
spherical.phi = Math.max(scope.minPolarAngle, Math.min(scope.maxPolarAngle, spherical.phi));
|
|
371
|
+
|
|
372
|
+
spherical.makeSafe();
|
|
373
|
+
|
|
374
|
+
spherical.radius *= scale;
|
|
375
|
+
|
|
376
|
+
// restrict radius to be between desired limits
|
|
377
|
+
spherical.radius = Math.max(scope.minDistance, Math.min(scope.maxDistance, spherical.radius));
|
|
378
|
+
|
|
379
|
+
// move target to panned location
|
|
380
|
+
scope.target.add(panOffset);
|
|
381
|
+
|
|
382
|
+
offset.setFromSpherical(spherical);
|
|
383
|
+
|
|
384
|
+
// rotate offset back to "camera-up-vector-is-up" space
|
|
385
|
+
offset.applyQuaternion(quatInverse);
|
|
386
|
+
|
|
387
|
+
position.copy(scope.target).add(offset);
|
|
388
|
+
|
|
389
|
+
scope.object.lookAt(scope.target);
|
|
390
|
+
|
|
391
|
+
if (scope.enableDamping === true) {
|
|
392
|
+
sphericalDelta.theta *= (1 - scope.dampingFactor);
|
|
393
|
+
sphericalDelta.phi *= (1 - scope.dampingFactor);
|
|
394
|
+
|
|
395
|
+
panOffset.multiplyScalar(1 - scope.dampingFactor);
|
|
396
|
+
} else {
|
|
397
|
+
sphericalDelta.set(0, 0, 0);
|
|
398
|
+
|
|
399
|
+
panOffset.set(0, 0, 0);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
scale = 1;
|
|
403
|
+
|
|
404
|
+
// update condition is:
|
|
405
|
+
// min(camera displacement, camera rotation in radians)^2 > EPS
|
|
406
|
+
// using small-angle approximation cos(x/2) = 1 - x^2 / 8
|
|
407
|
+
if (zoomChanged ||
|
|
408
|
+
lastPosition.distanceToSquared(scope.object.position) > EPS ||
|
|
409
|
+
8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS) {
|
|
410
|
+
scope.dispatchEvent(changeEvent);
|
|
411
|
+
|
|
412
|
+
lastPosition.copy(scope.object.position);
|
|
413
|
+
lastQuaternion.copy(scope.object.quaternion);
|
|
414
|
+
zoomChanged = false;
|
|
415
|
+
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return false;
|
|
420
|
+
};
|
|
421
|
+
}();
|
|
422
|
+
|
|
423
|
+
this.dispose = function () {
|
|
424
|
+
scope.domElement.removeEventListener('contextmenu', onContextMenu, false);
|
|
425
|
+
scope.domElement.removeEventListener('mousedown', onMouseDown, false);
|
|
426
|
+
scope.domElement.removeEventListener('wheel', onMouseWheel, false);
|
|
427
|
+
|
|
428
|
+
scope.domElement.removeEventListener('touchstart', onTouchStart, false);
|
|
429
|
+
scope.domElement.removeEventListener('touchend', onTouchEnd, false);
|
|
430
|
+
scope.domElement.removeEventListener('touchmove', onTouchMove, false);
|
|
431
|
+
|
|
432
|
+
document.removeEventListener('mousemove', onMouseMove, false);
|
|
433
|
+
document.removeEventListener('mouseup', onMouseUp, false);
|
|
434
|
+
|
|
435
|
+
window.removeEventListener('keydown', onKeyDown, false);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
const startEvent = { type: 'start' };
|
|
439
|
+
const endEvent = { type: 'end' };
|
|
440
|
+
|
|
441
|
+
const STATE = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4 };
|
|
442
|
+
|
|
443
|
+
let state = STATE.NONE;
|
|
444
|
+
|
|
445
|
+
scale = 1;
|
|
446
|
+
zoomChanged = false;
|
|
447
|
+
|
|
448
|
+
const rotateStart = new THREE.Vector2();
|
|
449
|
+
const rotateEnd = new THREE.Vector2();
|
|
450
|
+
const rotateDelta = new THREE.Vector2();
|
|
451
|
+
|
|
452
|
+
const panStart = new THREE.Vector2();
|
|
453
|
+
const panEnd = new THREE.Vector2();
|
|
454
|
+
const panDelta = new THREE.Vector2();
|
|
455
|
+
|
|
456
|
+
const dollyStart = new THREE.Vector2();
|
|
457
|
+
const dollyEnd = new THREE.Vector2();
|
|
458
|
+
const dollyDelta = new THREE.Vector2();
|
|
459
|
+
|
|
460
|
+
function getAutoRotationAngle() {
|
|
461
|
+
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function getZoomScale() {
|
|
465
|
+
return Math.pow(0.95, scope.zoomSpeed);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function rotateLeft(angle) {
|
|
469
|
+
sphericalDelta.theta -= angle;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function rotateUp(angle) {
|
|
473
|
+
sphericalDelta.phi -= angle;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
this.rotateLeft = function (angle) {
|
|
477
|
+
sphericalDelta.theta -= angle;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
this.rotateUp = function (angle) {
|
|
481
|
+
sphericalDelta.phi -= angle;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
const panLeft = function () {
|
|
485
|
+
const v = new THREE.Vector3();
|
|
486
|
+
|
|
487
|
+
return function panLeft(distance, objectMatrix) {
|
|
488
|
+
v.setFromMatrixColumn(objectMatrix, 0); // get X column of objectMatrix
|
|
489
|
+
v.multiplyScalar(-distance);
|
|
490
|
+
|
|
491
|
+
panOffset.add(v);
|
|
492
|
+
};
|
|
493
|
+
}();
|
|
494
|
+
|
|
495
|
+
const panUp = function () {
|
|
496
|
+
const v = new THREE.Vector3();
|
|
497
|
+
|
|
498
|
+
return function panUp(distance, objectMatrix) {
|
|
499
|
+
if (scope.screenSpacePanning === true) {
|
|
500
|
+
v.setFromMatrixColumn(objectMatrix, 1);
|
|
501
|
+
} else {
|
|
502
|
+
v.setFromMatrixColumn(objectMatrix, 0);
|
|
503
|
+
v.crossVectors(scope.object.up, v);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
v.multiplyScalar(distance);
|
|
507
|
+
|
|
508
|
+
panOffset.add(v);
|
|
509
|
+
};
|
|
510
|
+
}();
|
|
511
|
+
|
|
512
|
+
// deltaX and deltaY are in pixels; right and down are positive
|
|
513
|
+
const pan = function () {
|
|
514
|
+
const offset = new THREE.Vector3();
|
|
515
|
+
|
|
516
|
+
return function pan(deltaX, deltaY) {
|
|
517
|
+
const element = scope.domElement === document ? scope.domElement.body : scope.domElement;
|
|
518
|
+
|
|
519
|
+
if (scope.object.isPerspectiveCamera) {
|
|
520
|
+
// perspective
|
|
521
|
+
const position = scope.object.position;
|
|
522
|
+
|
|
523
|
+
offset.copy(position).sub(scope.target);
|
|
524
|
+
let targetDistance = offset.length();
|
|
525
|
+
|
|
526
|
+
// half of the fov is center to top of screen
|
|
527
|
+
targetDistance *= Math.tan((scope.object.fov / 2) * Math.PI / 180.0);
|
|
528
|
+
|
|
529
|
+
// we use only clientHeight here so aspect ratio does not distort speed
|
|
530
|
+
panLeft(2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix);
|
|
531
|
+
panUp(2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix);
|
|
532
|
+
} else if (scope.object.isOrthographicCamera) {
|
|
533
|
+
// orthographic
|
|
534
|
+
panLeft(
|
|
535
|
+
deltaX * (scope.object.right - scope.object.left) / scope.object.zoom / element.clientWidth,
|
|
536
|
+
scope.object.matrix
|
|
537
|
+
);
|
|
538
|
+
panUp(
|
|
539
|
+
deltaY * (scope.object.top - scope.object.bottom) / scope.object.zoom / element.clientHeight,
|
|
540
|
+
scope.object.matrix
|
|
541
|
+
);
|
|
542
|
+
} else {
|
|
543
|
+
// camera neither orthographic nor perspective
|
|
544
|
+
console.warn('WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.');
|
|
545
|
+
scope.enablePan = false;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
}();
|
|
549
|
+
|
|
550
|
+
function dollyIn(dollyScale) {
|
|
551
|
+
if (scope.object.isPerspectiveCamera) {
|
|
552
|
+
scale /= dollyScale;
|
|
553
|
+
} else if (scope.object.isOrthographicCamera) {
|
|
554
|
+
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom * dollyScale));
|
|
555
|
+
scope.object.updateProjectionMatrix();
|
|
556
|
+
zoomChanged = true;
|
|
557
|
+
} else {
|
|
558
|
+
console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');
|
|
559
|
+
scope.enableZoom = false;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
function dollyOut(dollyScale) {
|
|
564
|
+
if (scope.object.isPerspectiveCamera) {
|
|
565
|
+
scale *= dollyScale;
|
|
566
|
+
} else if (scope.object.isOrthographicCamera) {
|
|
567
|
+
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / dollyScale));
|
|
568
|
+
scope.object.updateProjectionMatrix();
|
|
569
|
+
zoomChanged = true;
|
|
570
|
+
} else {
|
|
571
|
+
console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');
|
|
572
|
+
scope.enableZoom = false;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
//
|
|
577
|
+
// event callbacks - update the object state
|
|
578
|
+
//
|
|
579
|
+
function handleMouseDownRotate(event) {
|
|
580
|
+
rotateStart.set(event.clientX, event.clientY);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function handleMouseDownDolly(event) {
|
|
584
|
+
dollyStart.set(event.clientX, event.clientY);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
function handleMouseDownPan(event) {
|
|
588
|
+
panStart.set(event.clientX, event.clientY);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function handleMouseMoveRotate(event) {
|
|
592
|
+
rotateEnd.set(event.clientX, event.clientY);
|
|
593
|
+
|
|
594
|
+
rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
|
|
595
|
+
|
|
596
|
+
const element = scope.domElement === document ? scope.domElement.body : scope.domElement;
|
|
597
|
+
|
|
598
|
+
rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); // yes, height
|
|
599
|
+
|
|
600
|
+
rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight);
|
|
601
|
+
|
|
602
|
+
rotateStart.copy(rotateEnd);
|
|
603
|
+
|
|
604
|
+
scope.update();
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
function handleMouseMoveDolly(event) {
|
|
608
|
+
dollyEnd.set(event.clientX, event.clientY);
|
|
609
|
+
|
|
610
|
+
dollyDelta.subVectors(dollyEnd, dollyStart);
|
|
611
|
+
|
|
612
|
+
if (dollyDelta.y > 0) {
|
|
613
|
+
dollyIn(getZoomScale());
|
|
614
|
+
} else if (dollyDelta.y < 0) {
|
|
615
|
+
dollyOut(getZoomScale());
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
dollyStart.copy(dollyEnd);
|
|
619
|
+
|
|
620
|
+
scope.update();
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function handleMouseMovePan(event) {
|
|
624
|
+
panEnd.set(event.clientX, event.clientY);
|
|
625
|
+
|
|
626
|
+
panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
|
|
627
|
+
|
|
628
|
+
pan(panDelta.x, panDelta.y);
|
|
629
|
+
|
|
630
|
+
panStart.copy(panEnd);
|
|
631
|
+
|
|
632
|
+
scope.update();
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
function handleMouseUp() {}
|
|
636
|
+
|
|
637
|
+
function handleMouseWheel(event) {
|
|
638
|
+
if (event.deltaY < 0) {
|
|
639
|
+
dollyOut(getZoomScale());
|
|
640
|
+
} else if (event.deltaY > 0) {
|
|
641
|
+
dollyIn(getZoomScale());
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
scope.update();
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function handleKeyDown(event) {
|
|
648
|
+
switch (event.keyCode) {
|
|
649
|
+
case scope.keys.UP:
|
|
650
|
+
pan(0, scope.keyPanSpeed);
|
|
651
|
+
scope.update();
|
|
652
|
+
break;
|
|
653
|
+
|
|
654
|
+
case scope.keys.BOTTOM:
|
|
655
|
+
pan(0, -scope.keyPanSpeed);
|
|
656
|
+
scope.update();
|
|
657
|
+
break;
|
|
658
|
+
|
|
659
|
+
case scope.keys.LEFT:
|
|
660
|
+
pan(scope.keyPanSpeed, 0);
|
|
661
|
+
scope.update();
|
|
662
|
+
break;
|
|
663
|
+
|
|
664
|
+
case scope.keys.RIGHT:
|
|
665
|
+
pan(-scope.keyPanSpeed, 0);
|
|
666
|
+
scope.update();
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function handleTouchStartRotate(event) {
|
|
672
|
+
rotateStart.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function handleTouchStartDollyPan(event) {
|
|
676
|
+
if (scope.enableZoom) {
|
|
677
|
+
const dx = event.touches[0].pageX - event.touches[1].pageX;
|
|
678
|
+
const dy = event.touches[0].pageY - event.touches[1].pageY;
|
|
679
|
+
|
|
680
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
681
|
+
|
|
682
|
+
dollyStart.set(0, distance);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (scope.enablePan) {
|
|
686
|
+
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
|
687
|
+
const y = 0.5 * (event.touches[0].pageY + event.touches[1].pageY);
|
|
688
|
+
|
|
689
|
+
panStart.set(x, y);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
function handleTouchMoveRotate(event) {
|
|
694
|
+
rotateEnd.set(event.touches[0].pageX, event.touches[0].pageY);
|
|
695
|
+
|
|
696
|
+
rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
|
|
697
|
+
|
|
698
|
+
const element = scope.domElement === document ? scope.domElement.body : scope.domElement;
|
|
699
|
+
|
|
700
|
+
rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); // yes, height
|
|
701
|
+
|
|
702
|
+
rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight);
|
|
703
|
+
|
|
704
|
+
rotateStart.copy(rotateEnd);
|
|
705
|
+
|
|
706
|
+
scope.update();
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
function handleTouchMoveDollyPan(event) {
|
|
710
|
+
if (scope.enableZoom) {
|
|
711
|
+
const dx = event.touches[0].pageX - event.touches[1].pageX;
|
|
712
|
+
const dy = event.touches[0].pageY - event.touches[1].pageY;
|
|
713
|
+
|
|
714
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
715
|
+
|
|
716
|
+
dollyEnd.set(0, distance);
|
|
717
|
+
|
|
718
|
+
dollyDelta.set(0, Math.pow(dollyEnd.y / dollyStart.y, scope.zoomSpeed));
|
|
719
|
+
|
|
720
|
+
dollyIn(dollyDelta.y);
|
|
721
|
+
|
|
722
|
+
dollyStart.copy(dollyEnd);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
if (scope.enablePan) {
|
|
726
|
+
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
|
727
|
+
const y = 0.5 * (event.touches[0].pageY + event.touches[1].pageY);
|
|
728
|
+
|
|
729
|
+
panEnd.set(x, y);
|
|
730
|
+
|
|
731
|
+
panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
|
|
732
|
+
|
|
733
|
+
pan(panDelta.x, panDelta.y);
|
|
734
|
+
|
|
735
|
+
panStart.copy(panEnd);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
scope.update();
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function handleTouchEnd() {}
|
|
742
|
+
|
|
743
|
+
//
|
|
744
|
+
// event handlers - FSM: listen for events and reset state
|
|
745
|
+
//
|
|
746
|
+
function onMouseDown(event) {
|
|
747
|
+
if (scope.enabled === false) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
event.preventDefault();
|
|
752
|
+
|
|
753
|
+
switch (event.button) {
|
|
754
|
+
case scope.mouseButtons.ORBIT:
|
|
755
|
+
if (scope.enableRotate === false) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
handleMouseDownRotate(event);
|
|
760
|
+
|
|
761
|
+
state = STATE.ROTATE;
|
|
762
|
+
|
|
763
|
+
break;
|
|
764
|
+
case scope.mouseButtons.ZOOM:
|
|
765
|
+
if (scope.enableZoom === false) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
handleMouseDownDolly(event);
|
|
770
|
+
|
|
771
|
+
state = STATE.DOLLY;
|
|
772
|
+
|
|
773
|
+
break;
|
|
774
|
+
case scope.mouseButtons.PAN:
|
|
775
|
+
if (scope.enablePan === false) {
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
handleMouseDownPan(event);
|
|
780
|
+
|
|
781
|
+
state = STATE.PAN;
|
|
782
|
+
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
if (state !== STATE.NONE) {
|
|
787
|
+
document.addEventListener('mousemove', onMouseMove, false);
|
|
788
|
+
document.addEventListener('mouseup', onMouseUp, false);
|
|
789
|
+
|
|
790
|
+
scope.dispatchEvent(startEvent);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
function onMouseMove(event) {
|
|
795
|
+
if (scope.enabled === false) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
event.preventDefault();
|
|
800
|
+
|
|
801
|
+
switch (state) {
|
|
802
|
+
case STATE.ROTATE:
|
|
803
|
+
if (scope.enableRotate === false) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
handleMouseMoveRotate(event);
|
|
808
|
+
|
|
809
|
+
break;
|
|
810
|
+
case STATE.DOLLY:
|
|
811
|
+
if (scope.enableZoom === false) {
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
handleMouseMoveDolly(event);
|
|
816
|
+
|
|
817
|
+
break;
|
|
818
|
+
case STATE.PAN:
|
|
819
|
+
if (scope.enablePan === false) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
handleMouseMovePan(event);
|
|
824
|
+
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
function onMouseUp(event) {
|
|
830
|
+
if (scope.enabled === false) {
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
handleMouseUp(event);
|
|
835
|
+
|
|
836
|
+
document.removeEventListener('mousemove', onMouseMove, false);
|
|
837
|
+
document.removeEventListener('mouseup', onMouseUp, false);
|
|
838
|
+
|
|
839
|
+
scope.dispatchEvent(endEvent);
|
|
840
|
+
|
|
841
|
+
state = STATE.NONE;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
function onMouseWheel(event) {
|
|
845
|
+
if (scope.enabled === false || scope.enableZoom === false || (state !== STATE.NONE && state !== STATE.ROTATE)) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
event.preventDefault();
|
|
850
|
+
event.stopPropagation();
|
|
851
|
+
|
|
852
|
+
scope.dispatchEvent(startEvent);
|
|
853
|
+
|
|
854
|
+
handleMouseWheel(event);
|
|
855
|
+
|
|
856
|
+
scope.dispatchEvent(endEvent);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function onKeyDown(event) {
|
|
860
|
+
if (scope.enabled === false || scope.enableKeys === false || scope.enablePan === false) {
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
handleKeyDown(event);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
function onTouchStart(event) {
|
|
868
|
+
if (scope.enabled === false) {
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
event.preventDefault();
|
|
873
|
+
|
|
874
|
+
switch (event.touches.length) {
|
|
875
|
+
case 1: // one-fingered touch: rotate
|
|
876
|
+
if (scope.enableRotate === false) {
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
handleTouchStartRotate(event);
|
|
881
|
+
|
|
882
|
+
state = STATE.TOUCH_ROTATE;
|
|
883
|
+
|
|
884
|
+
break;
|
|
885
|
+
case 2: // two-fingered touch: dolly-pan
|
|
886
|
+
if (scope.enableZoom === false && scope.enablePan === false) {
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
handleTouchStartDollyPan(event);
|
|
891
|
+
|
|
892
|
+
state = STATE.TOUCH_DOLLY_PAN;
|
|
893
|
+
|
|
894
|
+
break;
|
|
895
|
+
default:
|
|
896
|
+
state = STATE.NONE;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
if (state !== STATE.NONE) {
|
|
900
|
+
scope.dispatchEvent(startEvent);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function onTouchMove(event) {
|
|
905
|
+
if (scope.enabled === false) {
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
event.preventDefault();
|
|
910
|
+
event.stopPropagation();
|
|
911
|
+
|
|
912
|
+
switch (event.touches.length) {
|
|
913
|
+
case 1: // one-fingered touch: rotate
|
|
914
|
+
if (scope.enableRotate === false) {
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
if (state !== STATE.TOUCH_ROTATE) {
|
|
918
|
+
return;
|
|
919
|
+
} // is this needed?
|
|
920
|
+
|
|
921
|
+
handleTouchMoveRotate(event);
|
|
922
|
+
|
|
923
|
+
break;
|
|
924
|
+
case 2: // two-fingered touch: dolly-pan
|
|
925
|
+
if (scope.enableZoom === false && scope.enablePan === false) {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (state !== STATE.TOUCH_DOLLY_PAN) {
|
|
929
|
+
return;
|
|
930
|
+
} // is this needed?
|
|
931
|
+
|
|
932
|
+
handleTouchMoveDollyPan(event);
|
|
933
|
+
|
|
934
|
+
break;
|
|
935
|
+
default:
|
|
936
|
+
state = STATE.NONE;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function onTouchEnd(event) {
|
|
941
|
+
if (scope.enabled === false) {
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
handleTouchEnd(event);
|
|
946
|
+
|
|
947
|
+
scope.dispatchEvent(endEvent);
|
|
948
|
+
|
|
949
|
+
state = STATE.NONE;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
function onContextMenu(event) {
|
|
953
|
+
if (scope.enabled === false) {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
event.preventDefault();
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
scope.domElement.addEventListener('contextmenu', onContextMenu, false);
|
|
961
|
+
|
|
962
|
+
scope.domElement.addEventListener('mousedown', onMouseDown, false);
|
|
963
|
+
scope.domElement.addEventListener('wheel', onMouseWheel, false);
|
|
964
|
+
|
|
965
|
+
scope.domElement.addEventListener('touchstart', onTouchStart, false);
|
|
966
|
+
scope.domElement.addEventListener('touchend', onTouchEnd, false);
|
|
967
|
+
scope.domElement.addEventListener('touchmove', onTouchMove, false);
|
|
968
|
+
|
|
969
|
+
window.addEventListener('keydown', onKeyDown, false);
|
|
970
|
+
|
|
971
|
+
// force an update at start
|
|
972
|
+
this.update();
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
THREE.OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
976
|
+
THREE.OrbitControls.prototype.constructor = THREE.OrbitControls;
|
|
977
|
+
|
|
978
|
+
// This set of controls performs orbiting, dollying (zooming), and panning.
|
|
979
|
+
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
|
|
980
|
+
// This is very similar to OrbitControls, another set of touch behavior
|
|
981
|
+
//
|
|
982
|
+
// Orbit - right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger rotate
|
|
983
|
+
// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
|
|
984
|
+
// Pan - left mouse, or arrow keys / touch: one-finger move
|
|
985
|
+
|
|
986
|
+
// eslint-disable-next-line no-import-assign
|
|
987
|
+
THREE.MapControls = function (object, domElement) {
|
|
988
|
+
THREE.OrbitControls.call(this, object, domElement);
|
|
989
|
+
|
|
990
|
+
this.mouseButtons.LEFT = THREE.MOUSE.PAN;
|
|
991
|
+
this.mouseButtons.RIGHT = THREE.MOUSE.ROTATE;
|
|
992
|
+
|
|
993
|
+
this.touches.ONE = THREE.TOUCH.PAN;
|
|
994
|
+
this.touches.TWO = THREE.TOUCH.DOLLY_ROTATE;
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
THREE.MapControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
998
|
+
THREE.MapControls.prototype.constructor = THREE.MapControls;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export default OrbitOrientationControls;
|