@terraware/web-components 5.0.27 → 5.1.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/components/AntSwitch/index.js +19 -22
- package/components/Autocomplete/Autocomplete.js +106 -130
- package/components/Badge/index.js +28 -29
- package/components/BusySpinner/index.js +40 -45
- package/components/Button/Button.js +41 -47
- package/components/Checkbox.js +64 -63
- package/components/Confirm/index.js +74 -83
- package/components/DatePicker/DatePicker.js +138 -141
- package/components/DialogBox/DialogBox.js +111 -118
- package/components/Divisor.js +18 -18
- package/components/Dropdown.js +66 -94
- package/components/EditableTable/index.js +211 -271
- package/components/ErrorBox/ErrorBox.js +47 -49
- package/components/FileChooser/index.js +117 -135
- package/components/FormBottomBar/index.js +75 -84
- package/components/Icon/Icon.js +12 -20
- package/components/Icon/icons/index.js +256 -256
- package/components/IconTooltip/index.js +49 -60
- package/components/Map/MapBox.js +545 -452
- package/components/Map/MapContainer.js +25 -29
- package/components/Map/MapDateSliderControl.js +64 -64
- package/components/Map/MapDrawer.js +41 -47
- package/components/Map/MapLegend.js +176 -172
- package/components/Map/MapViewStyleControl.js +59 -63
- package/components/Map/ReactMapboxWrapper.js +3 -2
- package/components/Map/index.js +161 -180
- package/components/Map/types.js +12 -17
- package/components/Map/useMaintainLayerOrder.js +16 -26
- package/components/Markdown/index.js +25 -26
- package/components/Message/Message.js +73 -76
- package/components/MultiSelect/index.js +112 -124
- package/components/Navbar/NavFooter.js +9 -13
- package/components/Navbar/NavItem.js +70 -76
- package/components/Navbar/NavSection.js +17 -19
- package/components/Navbar/Navbar.js +39 -46
- package/components/Navbar/SubNavbar.js +9 -13
- package/components/Note.js +18 -22
- package/components/OverlayModal/OverlayModal.js +56 -63
- package/components/PageForm/index.js +33 -41
- package/components/PhotoChooser/index.js +165 -173
- package/components/PhotosCarousel/PhotoSlide.js +32 -35
- package/components/PhotosCarousel/index.js +80 -85
- package/components/PhotosCarousel/usePhotosCarousel.js +69 -76
- package/components/Pill/index.js +41 -45
- package/components/PillList/index.js +17 -24
- package/components/PlacementWrapper/index.js +38 -59
- package/components/PopoverMenu/Popover.js +68 -85
- package/components/PopoverMenu/index.js +51 -56
- package/components/PopoverMultiSelect/index.js +52 -59
- package/components/ProgressCircle/ProgressCircle.js +28 -32
- package/components/RadioButton.js +17 -19
- package/components/Select/Select.js +13 -15
- package/components/Select/SelectT.js +235 -250
- package/components/Separator/index.js +14 -17
- package/components/Size.js +0 -1
- package/components/Slider/index.js +43 -56
- package/components/SummaryBox.js +70 -72
- package/components/Tabs/index.js +133 -135
- package/components/TextTruncated/index.js +117 -130
- package/components/Textfield/Textfield.js +158 -190
- package/components/Textfield/TruncatedTextArea.js +70 -84
- package/components/TimelineSlider/TimelineMarker.js +25 -30
- package/components/TimelineSlider/TimelineRail.js +8 -11
- package/components/TimelineSlider/index.js +64 -66
- package/components/TimelineSliderV2/ClusterBadge.js +25 -29
- package/components/TimelineSliderV2/TimelineDot.js +31 -35
- package/components/TimelineSliderV2/TimelineRail.js +8 -11
- package/components/TimelineSliderV2/index.js +121 -103
- package/components/TimelineSliderV2/layout.js +124 -147
- package/components/TimelineSliderV2/types.js +0 -1
- package/components/Tooltip/Tooltip.js +47 -56
- package/components/ViewPhotosDialog/index.js +28 -35
- package/components/VirtualWalkthrough/Annotation.js +163 -207
- package/components/VirtualWalkthrough/AnnotationEditPane.js +198 -184
- package/components/VirtualWalkthrough/AnnotationPanel.js +187 -199
- package/components/VirtualWalkthrough/Application.js +31 -34
- package/components/VirtualWalkthrough/AutoRotator.js +85 -223
- package/components/VirtualWalkthrough/BlockingSpinner.js +26 -28
- package/components/VirtualWalkthrough/BoundaryRing.js +30 -34
- package/components/VirtualWalkthrough/BoundaryWall.js +32 -36
- package/components/VirtualWalkthrough/CameraInfo.js +100 -89
- package/components/VirtualWalkthrough/ControlsInfoPane.js +254 -195
- package/components/VirtualWalkthrough/GradientSky.js +72 -73
- package/components/VirtualWalkthrough/SplatControls.js +209 -221
- package/components/VirtualWalkthrough/SplatCrop.js +21 -20
- package/components/VirtualWalkthrough/SplatFadeCrop.js +21 -20
- package/components/VirtualWalkthrough/SplatModel.js +65 -85
- package/components/VirtualWalkthrough/SplatRevealRain.js +41 -46
- package/components/VirtualWalkthrough/TfAnnotationManager.js +197 -379
- package/components/VirtualWalkthrough/TfXrNavigation.js +73 -162
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +438 -431
- package/components/VirtualWalkthrough/VrAnnotationPanel.js +18 -22
- package/components/VirtualWalkthrough/XrAnnotationInteraction.js +14 -17
- package/components/VirtualWalkthrough/XrExitButton.js +14 -17
- package/components/VirtualWalkthrough/XrGazeDwell.js +14 -17
- package/components/VirtualWalkthrough/XrPointerRay.js +14 -17
- package/components/VirtualWalkthrough/XrStartPose.js +67 -121
- package/components/VirtualWalkthrough/boundary-ring.js +87 -117
- package/components/VirtualWalkthrough/boundary-wall.js +175 -258
- package/components/VirtualWalkthrough/camera-adoption.js +18 -64
- package/components/VirtualWalkthrough/groundPlane.js +32 -47
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +35 -35
- package/components/VirtualWalkthrough/splatFormat.js +13 -47
- package/components/VirtualWalkthrough/useAdoptedCamera.js +23 -44
- package/components/VirtualWalkthrough/useRestartOnVr.js +26 -37
- package/components/VirtualWalkthrough/useXrRenderTuning.js +33 -54
- package/components/VirtualWalkthrough/vr-annotation-panel-layout.js +67 -99
- package/components/VirtualWalkthrough/vr-annotation-panel.js +403 -433
- package/components/VirtualWalkthrough/vr-annotation-scroll.js +10 -28
- package/components/VirtualWalkthrough/walkthrough-camera.js +204 -329
- package/components/VirtualWalkthrough/xr-annotation-candidate-buffer.js +39 -80
- package/components/VirtualWalkthrough/xr-annotation-candidates.js +6 -18
- package/components/VirtualWalkthrough/xr-annotation-interaction.js +31 -56
- package/components/VirtualWalkthrough/xr-annotation-targeting.js +22 -38
- package/components/VirtualWalkthrough/xr-button-arming.js +7 -17
- package/components/VirtualWalkthrough/xr-button-hold.js +22 -36
- package/components/VirtualWalkthrough/xr-exit-button-mask.js +22 -36
- package/components/VirtualWalkthrough/xr-exit-button.js +148 -207
- package/components/VirtualWalkthrough/xr-face-buttons.js +19 -29
- package/components/VirtualWalkthrough/xr-gaze-dwell-state.js +23 -34
- package/components/VirtualWalkthrough/xr-gaze-dwell.js +107 -144
- package/components/VirtualWalkthrough/xr-interactive-ui.js +12 -24
- package/components/VirtualWalkthrough/xr-pointer-ray.js +13 -20
- package/components/VirtualWalkthrough/xr-progress-pie-material.js +117 -88
- package/components/VirtualWalkthrough/xr-progress-pie.js +1 -10
- package/components/VirtualWalkthrough/xr-ray-quad.js +16 -30
- package/components/VirtualWalkthrough/xr-render-tuning.js +17 -48
- package/components/VirtualWalkthrough/xr-scene-bounds.js +21 -37
- package/components/VirtualWalkthrough/xr-start-pose.js +27 -73
- package/components/VirtualWalkthrough/xr-teleport-gesture.js +16 -42
- package/components/svg/BlobbyGrayIconImage.js +41 -39
- package/components/svg/BlobbyGrayIconImport.js +41 -39
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +41 -39
- package/components/svg/BlobbyIconCloudChecked.js +202 -164
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +202 -164
- package/components/svg/BlobbyIconFolder.js +202 -164
- package/components/svg/BlobbyIconGraphReport.js +202 -164
- package/components/svg/BlobbyIconHappy.js +202 -164
- package/components/svg/BlobbyIconHeartMonitor.js +202 -164
- package/components/svg/BlobbyIconLeaf.js +202 -164
- package/components/svg/BlobbyIconLibrary.js +202 -164
- package/components/svg/BlobbyIconNursery.js +204 -166
- package/components/svg/BlobbyIconOrganization.js +202 -164
- package/components/svg/BlobbyIconParchment.js +202 -164
- package/components/svg/BlobbyIconPeople.js +202 -164
- package/components/svg/BlobbyIconSeedBank.js +202 -164
- package/components/svg/BlobbyIconSeedling.js +202 -164
- package/components/svg/BlobbyIconSeeds.js +202 -164
- package/components/svg/BlobbyIconSite.js +206 -167
- package/components/svg/BlobbyIconSparkles.js +202 -164
- package/components/svg/BlobbyIconWrench.js +202 -164
- package/components/svg/Bug.js +19 -21
- package/components/svg/Calendar.js +19 -21
- package/components/svg/CaretDown.js +19 -21
- package/components/svg/CaretLeft.js +19 -21
- package/components/svg/CaretRight.js +19 -21
- package/components/svg/CaretUp.js +19 -21
- package/components/svg/ChevronDown.js +19 -21
- package/components/svg/ChevronUp.js +19 -21
- package/components/svg/Close.js +19 -21
- package/components/svg/Critical.js +19 -21
- package/components/svg/Edit.js +202 -164
- package/components/svg/Error.js +19 -21
- package/components/svg/Filter.js +19 -21
- package/components/svg/Folder.js +19 -21
- package/components/svg/Help.js +19 -21
- package/components/svg/Home.js +19 -21
- package/components/svg/IconAdd.js +19 -21
- package/components/svg/IconArrowRight.js +21 -23
- package/components/svg/IconBusinessNetwork.js +19 -21
- package/components/svg/IconCalendar.js +19 -21
- package/components/svg/IconCancel.js +19 -21
- package/components/svg/IconChargingBattery.js +19 -21
- package/components/svg/IconChecklist.js +21 -23
- package/components/svg/IconCheckmark.js +19 -21
- package/components/svg/IconCoinInHand.js +19 -21
- package/components/svg/IconColumns.js +19 -21
- package/components/svg/IconComment.js +20 -22
- package/components/svg/IconDashboard.js +19 -21
- package/components/svg/IconDataMigration.js +19 -21
- package/components/svg/IconDocument.js +21 -23
- package/components/svg/IconDownloadFromTheCloud.js +21 -23
- package/components/svg/IconEdit.js +21 -23
- package/components/svg/IconExpand.js +21 -23
- package/components/svg/IconExport.js +19 -21
- package/components/svg/IconExternalLink.js +19 -21
- package/components/svg/IconEye.js +19 -21
- package/components/svg/IconEyeOff.js +19 -21
- package/components/svg/IconFile.js +19 -21
- package/components/svg/IconFolder.js +19 -21
- package/components/svg/IconFullScreen.js +20 -22
- package/components/svg/IconFutures.js +19 -21
- package/components/svg/IconGraphReport.js +19 -21
- package/components/svg/IconGrid.js +19 -21
- package/components/svg/IconHeartMonitor.js +19 -21
- package/components/svg/IconHelp.js +21 -23
- package/components/svg/IconHistory.js +19 -21
- package/components/svg/IconImport.js +19 -21
- package/components/svg/IconIndex.js +19 -21
- package/components/svg/IconLayers.js +19 -21
- package/components/svg/IconLibrary.js +20 -22
- package/components/svg/IconList.js +19 -21
- package/components/svg/IconLivePlant.js +19 -21
- package/components/svg/IconLocations.js +19 -21
- package/components/svg/IconMail.js +19 -21
- package/components/svg/IconManager.js +19 -21
- package/components/svg/IconMap.js +19 -21
- package/components/svg/IconMarker.js +19 -21
- package/components/svg/IconMenu.js +19 -21
- package/components/svg/IconMenuHorizontal.js +19 -21
- package/components/svg/IconModule.js +19 -21
- package/components/svg/IconMyLocation.js +19 -21
- package/components/svg/IconNote.js +21 -23
- package/components/svg/IconNursery.js +21 -23
- package/components/svg/IconOrg.js +19 -21
- package/components/svg/IconParchment.js +19 -21
- package/components/svg/IconPhoto.js +19 -21
- package/components/svg/IconPlantsFilled.js +19 -21
- package/components/svg/IconRedo.js +19 -21
- package/components/svg/IconRestorationSite.js +19 -21
- package/components/svg/IconSeedBank.js +19 -21
- package/components/svg/IconSeedling.js +19 -21
- package/components/svg/IconSettings.js +19 -21
- package/components/svg/IconSlice.js +19 -21
- package/components/svg/IconSubmit.js +19 -21
- package/components/svg/IconSubtract.js +21 -23
- package/components/svg/IconSynced.js +19 -21
- package/components/svg/IconTrashCan.js +19 -21
- package/components/svg/IconTreasureMap.js +19 -21
- package/components/svg/IconUnavailable.js +19 -21
- package/components/svg/IconUndo.js +19 -21
- package/components/svg/IconVariable.js +19 -21
- package/components/svg/IconVideo.js +30 -31
- package/components/svg/IconWifi.js +19 -21
- package/components/svg/Info.js +19 -21
- package/components/svg/Key.js +19 -21
- package/components/svg/Leaf.js +19 -21
- package/components/svg/Lock.js +19 -21
- package/components/svg/Logo.js +48 -43
- package/components/svg/MenuVertical.js +19 -21
- package/components/svg/Notification.js +19 -21
- package/components/svg/Person.js +19 -21
- package/components/svg/Plus.js +19 -21
- package/components/svg/RestorationSite.js +19 -21
- package/components/svg/Search.js +19 -21
- package/components/svg/Seeds.js +19 -21
- package/components/svg/Site.js +19 -21
- package/components/svg/Sparkles.js +19 -21
- package/components/svg/Species.js +19 -21
- package/components/svg/Species2.js +202 -164
- package/components/svg/Spinner.js +54 -48
- package/components/svg/Star.js +19 -21
- package/components/svg/Success.js +19 -21
- package/components/svg/SuccessFilled.js +19 -21
- package/components/svg/TerrawareLogoDesktop.js +55 -49
- package/components/svg/TerrawareLogoMobile.js +25 -26
- package/components/svg/Touchscreen.js +19 -21
- package/components/svg/UploadCloud.js +202 -164
- package/components/svg/Warning.js +19 -21
- package/components/svg/WelcomeClipboard.js +156 -133
- package/components/svg/index.js +129 -129
- package/components/table/EnhancedTableToolbar.js +68 -74
- package/components/table/EnhancedTableToolbarV2.js +31 -41
- package/components/table/TableCellRenderer.js +196 -231
- package/components/table/TableHeader.js +71 -73
- package/components/table/TableHeaderItem.js +97 -102
- package/components/table/density.js +18 -19
- package/components/table/index.js +350 -369
- package/components/table/sort.js +27 -52
- package/components/table/types.js +0 -1
- package/components/types/index.js +0 -1
- package/hooks/cameraEntityContext.js +2 -13
- package/hooks/useBoolean.js +17 -13
- package/hooks/useCameraPosition.js +56 -56
- package/hooks/useDevicePerformance.js +17 -17
- package/hooks/useXr.js +85 -87
- package/index.js +58 -58
- package/package.json +1 -1
- package/setupTests.js +0 -4
- package/strings/export.js +111 -170
- package/strings/index.js +25 -54
- package/strings/locales.js +21 -41
- package/strings/strings-en.js +49 -51
- package/strings/strings-es.js +49 -51
- package/strings/strings-fr.js +49 -51
- package/strings/strings-gx.js +49 -51
- package/style-dictionary-dist/TerrawareTheme.js +186 -186
- package/theme.js +74 -76
- package/utils/color.js +8 -15
- package/utils/date.js +42 -108
- package/utils/index.js +4 -4
- package/utils/preventDefaultEvent.js +3 -3
- package/utils/text.js +11 -11
- package/utils/useDeviceInfo.js +42 -79
- package/virtualWalkthrough.js +23 -23
|
@@ -1,54 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Render settings applied for the duration of an XR session. Splats rasterize as alpha-blended
|
|
3
|
-
* quads with no early-z rejection, which makes a headset's stereo pixel throughput the binding
|
|
4
|
-
* constraint on framerate long before splat count is.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Peripheral back-buffer resolution reduction, 0 (off) to 1 (strongest). Ineffective while MSAA is
|
|
9
|
-
* on, which is one reason the application requests `antialias: false`.
|
|
10
|
-
*/
|
|
11
1
|
const XR_FIXED_FOVEATION = 1;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The subset of `GSplatParams` this module writes. Structural rather than the PlayCanvas type so
|
|
15
|
-
* the logic can be exercised against a plain object.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* `radialSorting` orders splats by distance from the camera rather than by depth along its forward
|
|
20
|
-
* axis, which is the more accurate ordering when the camera rotates rather than translates. Sorting
|
|
21
|
-
* runs on a worker and so lags the view by at least a frame; head rotation dominates in a headset,
|
|
22
|
-
* where that lag is what reads as swimming.
|
|
23
|
-
*
|
|
24
|
-
* The other two trade fidelity for fill rate: `alphaClipForward` drops near-transparent splats from
|
|
25
|
-
* the forward pass, and `minPixelSize` drops splats that project to less than a few pixels.
|
|
26
|
-
*/
|
|
27
2
|
const XR_GSPLAT_TUNING = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
3
|
+
radialSorting: true,
|
|
4
|
+
alphaClipForward: 0.1,
|
|
5
|
+
minPixelSize: 1
|
|
31
6
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
params.radialSorting = XR_GSPLAT_TUNING.radialSorting;
|
|
44
|
-
params.alphaClipForward = XR_GSPLAT_TUNING.alphaClipForward;
|
|
45
|
-
params.minPixelSize = XR_GSPLAT_TUNING.minPixelSize;
|
|
46
|
-
return previous;
|
|
7
|
+
const applyGsplatTuning = (params)=>{
|
|
8
|
+
const previous = {
|
|
9
|
+
radialSorting: params.radialSorting,
|
|
10
|
+
alphaClipForward: params.alphaClipForward,
|
|
11
|
+
minPixelSize: params.minPixelSize
|
|
12
|
+
};
|
|
13
|
+
params.radialSorting = XR_GSPLAT_TUNING.radialSorting;
|
|
14
|
+
params.alphaClipForward = XR_GSPLAT_TUNING.alphaClipForward;
|
|
15
|
+
params.minPixelSize = XR_GSPLAT_TUNING.minPixelSize;
|
|
16
|
+
return previous;
|
|
47
17
|
};
|
|
48
|
-
const restoreGsplatTuning = (params, previous)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
18
|
+
const restoreGsplatTuning = (params, previous)=>{
|
|
19
|
+
params.radialSorting = previous.radialSorting;
|
|
20
|
+
params.alphaClipForward = previous.alphaClipForward;
|
|
21
|
+
params.minPixelSize = previous.minPixelSize;
|
|
52
22
|
};
|
|
53
|
-
|
|
54
23
|
export { XR_FIXED_FOVEATION, XR_GSPLAT_TUNING, applyGsplatTuning, restoreGsplatTuning };
|
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
z,
|
|
15
|
-
distance: 0
|
|
1
|
+
const clampToCircle = (x, z, centerX, centerZ, radius)=>{
|
|
2
|
+
if (radius <= 0) return {
|
|
3
|
+
x,
|
|
4
|
+
z,
|
|
5
|
+
distance: 0
|
|
6
|
+
};
|
|
7
|
+
const dx = x - centerX;
|
|
8
|
+
const dz = z - centerZ;
|
|
9
|
+
const dist = Math.sqrt(dx * dx + dz * dz);
|
|
10
|
+
if (dist <= radius) return {
|
|
11
|
+
x,
|
|
12
|
+
z,
|
|
13
|
+
distance: 0
|
|
16
14
|
};
|
|
17
|
-
|
|
18
|
-
const dx = x - centerX;
|
|
19
|
-
const dz = z - centerZ;
|
|
20
|
-
const dist = Math.sqrt(dx * dx + dz * dz);
|
|
21
|
-
if (dist <= radius) {
|
|
15
|
+
const scale = radius / dist;
|
|
22
16
|
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
x: centerX + dx * scale,
|
|
18
|
+
z: centerZ + dz * scale,
|
|
19
|
+
distance: dist - radius
|
|
26
20
|
};
|
|
27
|
-
}
|
|
28
|
-
const scale = radius / dist;
|
|
29
|
-
return {
|
|
30
|
-
x: centerX + dx * scale,
|
|
31
|
-
z: centerZ + dz * scale,
|
|
32
|
-
distance: dist - radius
|
|
33
|
-
};
|
|
34
21
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const dz = z - centerZ;
|
|
40
|
-
return Math.sqrt(dx * dx + dz * dz) - radius;
|
|
22
|
+
const distanceToCircleEdge = (x, z, centerX, centerZ, radius)=>{
|
|
23
|
+
const dx = x - centerX;
|
|
24
|
+
const dz = z - centerZ;
|
|
25
|
+
return Math.sqrt(dx * dx + dz * dz) - radius;
|
|
41
26
|
};
|
|
42
|
-
|
|
43
27
|
export { clampToCircle, distanceToCircleEdge };
|
|
@@ -1,80 +1,34 @@
|
|
|
1
|
-
import { clampToCircle } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Where to put the XR rig so the head starts at a chosen spot facing a chosen point.
|
|
5
|
-
*
|
|
6
|
-
* PlayCanvas writes the head pose into the camera entity's *local* transform every frame, so the
|
|
7
|
-
* only thing a scene can move is the rig the camera hangs off. The head sits at an arbitrary offset
|
|
8
|
-
* within the rig — the reference space is pinned to wherever the user physically stood when the
|
|
9
|
-
* session began — so the rig pose has to be solved backwards from the head pose rather than set to
|
|
10
|
-
* the target outright.
|
|
11
|
-
*
|
|
12
|
-
* All angles are degrees and all coordinates world-space XZ; Y is left to the caller, since the
|
|
13
|
-
* user stands on the rig floor rather than on the scene's ground plane.
|
|
14
|
-
*/
|
|
1
|
+
import { clampToCircle } from "./xr-scene-bounds.js";
|
|
15
2
|
const RAD_TO_DEG = 180 / Math.PI;
|
|
16
3
|
const DEG_TO_RAD = Math.PI / 180;
|
|
17
|
-
|
|
18
|
-
/** Below this length a direction vector carries no usable heading. */
|
|
19
4
|
const DIRECTION_EPSILON = 1e-6;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const wrapped = ((degrees + 180) % 360 + 360) % 360 - 180;
|
|
24
|
-
return wrapped === -180 ? 180 : wrapped;
|
|
5
|
+
const normalizeAngle = (degrees)=>{
|
|
6
|
+
const wrapped = ((degrees + 180) % 360 + 360) % 360 - 180;
|
|
7
|
+
return -180 === wrapped ? 180 : wrapped;
|
|
25
8
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
* vector has no horizontal component to read it from.
|
|
37
|
-
*/
|
|
38
|
-
const yawFromBasis = (forward, right) => yawFromDirection(forward.x, forward.z) ?? Math.atan2(-right.z, right.x) * RAD_TO_DEG;
|
|
39
|
-
|
|
40
|
-
/** Rotates a point about the origin by `degrees` of PlayCanvas yaw. */
|
|
41
|
-
const rotateXz = (point, degrees) => {
|
|
42
|
-
const radians = degrees * DEG_TO_RAD;
|
|
43
|
-
const cos = Math.cos(radians);
|
|
44
|
-
const sin = Math.sin(radians);
|
|
45
|
-
return {
|
|
46
|
-
x: point.x * cos + point.z * sin,
|
|
47
|
-
z: -point.x * sin + point.z * cos
|
|
48
|
-
};
|
|
9
|
+
const yawFromDirection = (dx, dz)=>Math.abs(dx) < DIRECTION_EPSILON && Math.abs(dz) < DIRECTION_EPSILON ? null : Math.atan2(-dx, -dz) * RAD_TO_DEG;
|
|
10
|
+
const yawFromBasis = (forward, right)=>yawFromDirection(forward.x, forward.z) ?? Math.atan2(-right.z, right.x) * RAD_TO_DEG;
|
|
11
|
+
const rotateXz = (point, degrees)=>{
|
|
12
|
+
const radians = degrees * DEG_TO_RAD;
|
|
13
|
+
const cos = Math.cos(radians);
|
|
14
|
+
const sin = Math.sin(radians);
|
|
15
|
+
return {
|
|
16
|
+
x: point.x * cos + point.z * sin,
|
|
17
|
+
z: -point.x * sin + point.z * cos
|
|
18
|
+
};
|
|
49
19
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
focus,
|
|
64
|
-
bounds
|
|
65
|
-
}) => {
|
|
66
|
-
const landing = bounds ? clampToCircle(target.x, target.z, bounds.x, bounds.z, bounds.radius) : target;
|
|
67
|
-
const facingYaw = yawFromDirection(focus.x - landing.x, focus.z - landing.z);
|
|
68
|
-
const yawDelta = facingYaw === null ? 0 : normalizeAngle(facingYaw - headYaw);
|
|
69
|
-
const offset = rotateXz({
|
|
70
|
-
x: head.x - rig.x,
|
|
71
|
-
z: head.z - rig.z
|
|
72
|
-
}, yawDelta);
|
|
73
|
-
return {
|
|
74
|
-
yawDelta,
|
|
75
|
-
x: landing.x - offset.x,
|
|
76
|
-
z: landing.z - offset.z
|
|
77
|
-
};
|
|
20
|
+
const xrStartRigPose = ({ head, headYaw, rig, target, focus, bounds })=>{
|
|
21
|
+
const landing = bounds ? clampToCircle(target.x, target.z, bounds.x, bounds.z, bounds.radius) : target;
|
|
22
|
+
const facingYaw = yawFromDirection(focus.x - landing.x, focus.z - landing.z);
|
|
23
|
+
const yawDelta = null === facingYaw ? 0 : normalizeAngle(facingYaw - headYaw);
|
|
24
|
+
const offset = rotateXz({
|
|
25
|
+
x: head.x - rig.x,
|
|
26
|
+
z: head.z - rig.z
|
|
27
|
+
}, yawDelta);
|
|
28
|
+
return {
|
|
29
|
+
yawDelta,
|
|
30
|
+
x: landing.x - offset.x,
|
|
31
|
+
z: landing.z - offset.z
|
|
32
|
+
};
|
|
78
33
|
};
|
|
79
|
-
|
|
80
34
|
export { xrStartRigPose, yawFromBasis, yawFromDirection };
|
|
@@ -1,47 +1,21 @@
|
|
|
1
|
-
/** Per-frame aim state for one input source, sampled while its select gesture is in progress. */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Decides whether the select gesture that just ended is allowed to teleport. The two reasons to
|
|
5
|
-
* refuse have deliberately different lifetimes:
|
|
6
|
-
*
|
|
7
|
-
* - `teleportDisabled` latches for the rest of the press. The React flag behind it re-enables as
|
|
8
|
-
* soon as the select dismisses the panel, which can land before the selectend that ends the press.
|
|
9
|
-
* - `uiBlocked` keeps only the newest frame, because that frame is the one whose arc hit the base
|
|
10
|
-
* script has cached and would commit on release. Re-deciding from the release-time ray instead
|
|
11
|
-
* would let a flick off the UI commit a target that was aimed while over it, and latching the
|
|
12
|
-
* whole press would refuse an aim that merely swept across UI before coming to rest on floor.
|
|
13
|
-
*
|
|
14
|
-
* Callers must poll every frame for every source they care about; a press and release between polls
|
|
15
|
-
* is missed.
|
|
16
|
-
*/
|
|
17
1
|
class TeleportGestureLatch {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
_teleportDisabled = new WeakSet();
|
|
3
|
+
_uiBlocked = new WeakSet();
|
|
4
|
+
track(inputSource, frame) {
|
|
5
|
+
if (!frame.pressed) {
|
|
6
|
+
this._teleportDisabled.delete(inputSource);
|
|
7
|
+
this._uiBlocked.delete(inputSource);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (frame.teleportDisabled) this._teleportDisabled.add(inputSource);
|
|
11
|
+
if (frame.uiBlocked) this._uiBlocked.add(inputSource);
|
|
12
|
+
else this._uiBlocked.delete(inputSource);
|
|
27
13
|
}
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
consumeBlocked(inputSource) {
|
|
15
|
+
const blocked = this._teleportDisabled.has(inputSource) || this._uiBlocked.has(inputSource);
|
|
16
|
+
this._teleportDisabled.delete(inputSource);
|
|
17
|
+
this._uiBlocked.delete(inputSource);
|
|
18
|
+
return blocked;
|
|
30
19
|
}
|
|
31
|
-
if (frame.uiBlocked) {
|
|
32
|
-
this._uiBlocked.add(inputSource);
|
|
33
|
-
} else {
|
|
34
|
-
this._uiBlocked.delete(inputSource);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** True when the press may not teleport. Clears both latches so they never outlive the press. */
|
|
39
|
-
consumeBlocked(inputSource) {
|
|
40
|
-
const blocked = this._teleportDisabled.has(inputSource) || this._uiBlocked.has(inputSource);
|
|
41
|
-
this._teleportDisabled.delete(inputSource);
|
|
42
|
-
this._uiBlocked.delete(inputSource);
|
|
43
|
-
return blocked;
|
|
44
|
-
}
|
|
45
20
|
}
|
|
46
|
-
|
|
47
21
|
export { TeleportGestureLatch };
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgBlobbyGrayIconImage = ({ title, titleId, ...props })=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
fill: "none",
|
|
6
|
+
viewBox: "0 0 200 128",
|
|
7
|
+
"aria-labelledby": titleId,
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
title ? /*#__PURE__*/ jsx("title", {
|
|
11
|
+
id: titleId,
|
|
12
|
+
children: title
|
|
13
|
+
}) : null,
|
|
14
|
+
/*#__PURE__*/ jsxs("g", {
|
|
15
|
+
clipPath: "url(#blobby-gray-icon-image_svg__a)",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx("path", {
|
|
18
|
+
fill: "#F1F0EC",
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M113.962 6.222c26.535 2.074 38.447 30.862 44.693 56.735 4.621 19.146-2.901 38.537-18.932 49.978-15.595 11.131-35.55 10.486-51.986.639C63.732 99.19 34.311 80.943 40.954 53.757c7.619-31.19 41-50.037 73.009-47.535",
|
|
21
|
+
clipRule: "evenodd"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("path", {
|
|
24
|
+
fill: "#7F775B",
|
|
25
|
+
d: "M83.333 40C79.307 40 76 43.307 76 47.333v33.334C76 84.693 79.307 88 83.333 88h33.334c4.026 0 7.333-3.307 7.333-7.333V47.333c0-4.026-3.307-7.333-7.333-7.333zm0 4h33.334A3.304 3.304 0 0 1 120 47.333v27.274l-8.016-7.755-.002-.003a5.4 5.4 0 0 0-3.75-1.516 5.4 5.4 0 0 0-3.75 1.519l-2.732 2.643-8.24-7.972A5.4 5.4 0 0 0 89.758 60a5.4 5.4 0 0 0-3.75 1.52l-.003.003L80 67.333v-20A3.304 3.304 0 0 1 83.333 44m25.334 5.333c-1.834 0-3.462.76-4.495 1.922-1.033 1.163-1.505 2.634-1.505 4.078s.472 2.916 1.505 4.078 2.661 1.922 4.495 1.922c1.833 0 3.461-.76 4.494-1.922 1.034-1.162 1.506-2.633 1.506-4.078 0-1.444-.472-2.915-1.506-4.078-1.033-1.162-2.661-1.922-4.494-1.922m0 4c.833 0 1.205.24 1.505.578s.495.867.495 1.422c0 .556-.195 1.085-.495 1.422-.3.338-.672.578-1.505.578-.834 0-1.205-.24-1.506-.578s-.494-.866-.494-1.422.194-1.084.494-1.422c.301-.337.672-.578 1.506-.578M89.757 64a1.37 1.37 0 0 1 .972.398l8.143 7.878L86.752 84h-3.419A3.304 3.304 0 0 1 80 80.667v-7.769l8.787-8.5c.283-.274.626-.398.97-.398m18.475 5.333c.353 0 .691.123.971.394L120 80.172v.495A3.304 3.304 0 0 1 116.667 84h-24.16l14.756-14.273c.277-.268.618-.394.969-.394"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx("defs", {
|
|
30
|
+
children: /*#__PURE__*/ jsx("clipPath", {
|
|
31
|
+
id: "blobby-gray-icon-image_svg__a",
|
|
32
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
33
|
+
fill: "#fff",
|
|
34
|
+
d: "M0 0h200v128H0z"
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
const BlobbyGrayIconImage = SvgBlobbyGrayIconImage;
|
|
41
|
+
export default BlobbyGrayIconImage;
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgBlobbyGrayIconImport = ({ title, titleId, ...props })=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
fill: "none",
|
|
6
|
+
viewBox: "0 0 200 128",
|
|
7
|
+
"aria-labelledby": titleId,
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
title ? /*#__PURE__*/ jsx("title", {
|
|
11
|
+
id: titleId,
|
|
12
|
+
children: title
|
|
13
|
+
}) : null,
|
|
14
|
+
/*#__PURE__*/ jsxs("g", {
|
|
15
|
+
clipPath: "url(#blobby-gray-icon-import_svg__a)",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx("path", {
|
|
18
|
+
fill: "#F1F0EC",
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M97.492 4.026c24.033-.76 45.335 14.966 53.284 37.66 8.572 24.47 4.488 52.73-16.101 68.491-22.132 16.943-53.93 19.23-75.615 1.718C39.75 96.3 45.34 68.141 53.67 44.76c7.4-20.77 21.784-40.036 43.822-40.734",
|
|
21
|
+
clipRule: "evenodd"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("path", {
|
|
24
|
+
fill: "#7F775B",
|
|
25
|
+
d: "M84.667 37.333c-3.29 0-6 2.71-6 6v41.334c0 3.29 2.71 6 6 6h30.666c3.29 0 6-2.71 6-6v-28c0-.53-.21-1.04-.586-1.414l-.02-.021-17.313-17.313a2 2 0 0 0-1.414-.586zm0 4H100v11.334c0 3.29 2.71 6 6 6h11.333v26c0 1.128-.871 2-2 2H84.667c-1.129 0-2-.872-2-2V43.333c0-1.128.871-2 2-2M104 44.161l10.505 10.506H106c-1.129 0-2-.872-2-2zM99.971 60a2 2 0 0 0-1.385.586l-5.333 5.333a2 2 0 1 0 2.828 2.828L98 66.828V74A2 2 0 1 0 102 74v-7.172l1.919 1.92a2.002 2.002 0 0 0 3.295-.63 1.99 1.99 0 0 0-.016-1.55 2 2 0 0 0-.451-.649l-5.333-5.333A2 2 0 0 0 99.971 60m-8.638 18.667a2.002 2.002 0 0 0-1.873 2.772 2 2 0 0 0 1.873 1.228h17.334a2 2 0 1 0 0-4z"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx("defs", {
|
|
30
|
+
children: /*#__PURE__*/ jsx("clipPath", {
|
|
31
|
+
id: "blobby-gray-icon-import_svg__a",
|
|
32
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
33
|
+
fill: "#fff",
|
|
34
|
+
d: "M0 0h200v128H0z"
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
const BlobbyGrayIconImport = SvgBlobbyGrayIconImport;
|
|
41
|
+
export default BlobbyGrayIconImport;
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgBlobbyGrayIconUploadToTheCloud = ({ title, titleId, ...props })=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
fill: "none",
|
|
6
|
+
viewBox: "0 0 200 128",
|
|
7
|
+
"aria-labelledby": titleId,
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
title ? /*#__PURE__*/ jsx("title", {
|
|
11
|
+
id: titleId,
|
|
12
|
+
children: title
|
|
13
|
+
}) : null,
|
|
14
|
+
/*#__PURE__*/ jsxs("g", {
|
|
15
|
+
clipPath: "url(#blobby-gray-icon-upload-to-the-cloud_svg__a)",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx("path", {
|
|
18
|
+
fill: "#F1F0EC",
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
d: "M97.492 4.026c24.033-.76 45.335 14.966 53.284 37.66 8.572 24.47 4.488 52.73-16.101 68.491-22.132 16.943-53.93 19.23-75.615 1.718C39.75 96.3 45.34 68.141 53.67 44.76c7.4-20.77 21.784-40.036 43.822-40.734",
|
|
21
|
+
clipRule: "evenodd"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("path", {
|
|
24
|
+
fill: "#7F775B",
|
|
25
|
+
d: "M100 45.333c-8.373 0-15.264 6.467-15.943 14.667h-.724C77.084 60 72 65.084 72 71.333s5.084 11.334 11.333 11.334h12v-4h-12c-4.044 0-7.333-3.29-7.333-7.334S79.29 64 83.333 64H86a2 2 0 0 0 2-2v-.667c0-6.616 5.384-12 12-12s12 5.384 12 12V62a2 2 0 0 0 2 2h2.667c4.044 0 7.333 3.29 7.333 7.333s-3.289 7.334-7.333 7.334h-12v4h12c6.249 0 11.333-5.084 11.333-11.334C128 65.084 122.916 60 116.667 60h-.724c-.679-8.2-7.57-14.667-15.943-14.667m-.031 18.638a2 2 0 0 0-1.565.797l-5.818 5.818a2 2 0 1 0 2.828 2.828L98 70.828V86a2.002 2.002 0 0 0 2.772 1.874A2 2 0 0 0 102 86V70.828l2.586 2.586a1.998 1.998 0 0 0 3.295-.63 2.005 2.005 0 0 0-.467-2.198l-5.828-5.828a2 2 0 0 0-1.617-.787"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx("defs", {
|
|
30
|
+
children: /*#__PURE__*/ jsx("clipPath", {
|
|
31
|
+
id: "blobby-gray-icon-upload-to-the-cloud_svg__a",
|
|
32
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
33
|
+
fill: "#fff",
|
|
34
|
+
d: "M0 0h200v128H0z"
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
const BlobbyGrayIconUploadToTheCloud = SvgBlobbyGrayIconUploadToTheCloud;
|
|
41
|
+
export default BlobbyGrayIconUploadToTheCloud;
|