@realsee/dnalogel 2.1.1 → 2.1.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -12
- package/components/index.js +242 -569
- package/dist/index.cjs.js +58 -73
- package/dist/index.es.js +7842 -12958
- package/dist/index.js +7842 -12958
- package/dist/index.umd.js +46 -61
- package/docs/assets/highlight.css +3 -3
- package/docs/assets/main.js +4 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +462 -619
- package/docs/classes/CruisePluginController.html +397 -23
- package/docs/classes/Magnifier.html +187 -9
- package/docs/classes/ModelRoomLabelController.html +149 -11
- package/docs/classes/Object3DHelperController.html +356 -0
- package/docs/classes/PaintBrush.html +260 -0
- package/docs/classes/PanoTagPluginController.html +940 -0
- package/docs/classes/Util.BetterTween.html +134 -0
- package/docs/classes/Util.FivePointSelector.html +144 -0
- package/docs/classes/Util.Interval.html +158 -0
- package/docs/classes/Util.Magnifier.html +196 -0
- package/docs/classes/Util.PointDomHelper.html +135 -0
- package/docs/classes/Util.PointHelper.html +127 -0
- package/docs/classes/Util.Rectangle.html +181 -0
- package/docs/enums/CameraMovementEffect.html +70 -3
- package/docs/enums/ContentType.html +116 -0
- package/docs/enums/DIRECTION.html +81 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +81 -1
- package/docs/enums/DimensionType.html +67 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +74 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +81 -1
- package/docs/enums/LinkType.html +67 -0
- package/docs/enums/PaintBrushTypeEnum.html +74 -0
- package/docs/enums/PointType.html +67 -0
- package/docs/enums/Rotation.html +77 -3
- package/docs/functions/CSS3DRenderPlugin.html +233 -0
- package/docs/functions/CameraMovementPlugin.html +237 -0
- package/docs/functions/CruisePlugin.html +233 -0
- package/docs/functions/GuideLinePlugin.html +235 -0
- package/docs/functions/ItemLabelPlugin.html +235 -0
- package/docs/functions/MapviewFloorplanPlugin.html +235 -0
- package/docs/functions/ModelChassisCompassPlugin.html +237 -0
- package/docs/functions/ModelEntryDoorGuidePlugin.html +237 -0
- package/docs/functions/ModelFloorplanPlugin.html +235 -0
- package/docs/functions/ModelItemLabelPlugin.html +235 -0
- package/docs/functions/ModelRoomLabelPlugin.html +233 -0
- package/docs/functions/ModelTVVideoPlugin.html +235 -0
- package/docs/functions/ModelViewPlugin.html +237 -0
- package/docs/functions/Object3DHelperPlugin.html +233 -0
- package/docs/functions/PanoCompassPlugin.html +235 -0
- package/docs/functions/PanoCursorRaycasterPlugin.html +238 -0
- package/docs/functions/PanoDoorLabelPlugin.html +235 -0
- package/docs/functions/PanoFloorplanRadarPlugin.html +235 -0
- package/docs/functions/PanoMeasurePlugin.html +235 -0
- package/docs/functions/PanoRulerPlugin.html +237 -0
- package/docs/functions/PanoRulerProPlugin.html +237 -0
- package/docs/functions/PanoSpatialTagPlugin.html +237 -0
- package/docs/functions/PanoTagPlugin.html +249 -0
- package/docs/functions/TopviewFloorplanPlugin.html +235 -0
- package/docs/functions/Util.getCoordsFromClient.html +78 -0
- package/docs/functions/Util.getCoordsFromElement.html +78 -0
- package/docs/functions/Util.getFrameTime.html +70 -0
- package/docs/functions/Util.getIntersectFromRelativePosition.html +78 -0
- package/docs/functions/Util.getRaycasterFromFivePointer.html +78 -0
- package/docs/functions/Util.isNil.html +79 -0
- package/docs/functions/Util.nextFrame.html +73 -0
- package/docs/functions/Util.notNil.html +78 -0
- package/docs/functions/Util.requestAnimationFrameInterval.html +98 -0
- package/docs/functions/Util.tweenProgress.html +84 -0
- package/docs/functions/pluginFlag.html +233 -0
- package/docs/index.html +222 -9
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +205 -0
- package/docs/interfaces/CSS3DRenderPluginState.html +85 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +111 -17
- package/docs/interfaces/ContentTypeMap.html +212 -0
- package/docs/interfaces/FloorplanBounding.html +89 -10
- package/docs/interfaces/FloorplanData.html +95 -3
- package/docs/interfaces/FloorplanEntrance.html +114 -15
- package/docs/interfaces/FloorplanExtraObject.html +108 -7
- package/docs/interfaces/FloorplanExtraObject3D.html +99 -3
- package/docs/interfaces/FloorplanFloorData.html +88 -3
- package/docs/interfaces/FloorplanImagePosition.html +74 -3
- package/docs/interfaces/FloorplanObserver.html +92 -5
- package/docs/interfaces/FloorplanOutlineItem.html +88 -3
- package/docs/interfaces/FloorplanPosition.html +74 -3
- package/docs/interfaces/FloorplanRoomItem.html +134 -17
- package/docs/interfaces/FloorplanRoomLabelItem.html +78 -7
- package/docs/interfaces/FloorplanServerBounding.html +89 -10
- package/docs/interfaces/FloorplanServerComputedData.html +92 -1
- package/docs/interfaces/FloorplanServerData.html +74 -3
- package/docs/interfaces/FloorplanServerDoorItem.html +92 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +78 -1
- package/docs/interfaces/FloorplanServerEntrance.html +114 -15
- package/docs/interfaces/FloorplanServerFloorData.html +88 -3
- package/docs/interfaces/FloorplanServerImagePosition.html +74 -3
- package/docs/interfaces/FloorplanServerObserver.html +92 -5
- package/docs/interfaces/FloorplanServerOutlineItem.html +88 -3
- package/docs/interfaces/FloorplanServerPosition.html +74 -3
- package/docs/interfaces/FloorplanServerRoomItem.html +145 -20
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +78 -7
- package/docs/interfaces/ItemLabelPluginData.html +64 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +149 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +85 -1
- package/docs/interfaces/LineJson.html +71 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +71 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +107 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +71 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +78 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +115 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +64 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +149 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +71 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +64 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +85 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +109 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +64 -1
- package/docs/interfaces/ModelViewPluginExportType.html +129 -1
- package/docs/interfaces/Object3DHelperState.html +78 -0
- package/docs/interfaces/OpenParameter.html +74 -3
- package/docs/interfaces/PaintBrushAction.html +118 -0
- package/docs/interfaces/PaintBrushConfigs.html +122 -0
- package/docs/interfaces/PaintBrushState.html +99 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +186 -11
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +227 -1
- package/docs/interfaces/PanoMeasureParameterType.html +128 -5
- package/docs/interfaces/PanoRulerPluginExportType.html +138 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +87 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +78 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +114 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +84 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +71 -1
- package/docs/interfaces/PanoRulerProPluginState.html +78 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +241 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +230 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +114 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +96 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +192 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +92 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +113 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +99 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +92 -1
- package/docs/interfaces/Point.html +78 -1
- package/docs/interfaces/PointJson.html +78 -1
- package/docs/interfaces/Room.html +85 -1
- package/docs/interfaces/RoomInfo.html +71 -1
- package/docs/interfaces/RoomLabel.html +141 -13
- package/docs/interfaces/RoomRules.html +230 -1
- package/docs/interfaces/Rooms.html +230 -1
- package/docs/interfaces/Scissor.html +100 -0
- package/docs/interfaces/TagConfig.html +120 -0
- package/docs/interfaces/Tags.html +89 -0
- package/docs/interfaces/Util.MagnifierParameter.html +116 -0
- package/docs/interfaces/Util.MouseGroupParameter.html +79 -0
- package/docs/modules/Util.html +91 -0
- package/docs/modules.html +425 -36
- package/docs/types/ArrayPosition.html +224 -0
- package/docs/types/CSS3DRenderExportType.html +224 -0
- package/docs/types/CSS3DRenderPluginExportType.html +224 -0
- package/docs/types/CSS3DRenderPluginParameterType.html +224 -0
- package/docs/types/Color.html +224 -0
- package/docs/types/ContentTypeConfigKey.html +224 -0
- package/docs/types/ContentTypeConfigKeyArray.html +224 -0
- package/docs/types/Create3DDomContainerReturnType.html +224 -0
- package/docs/types/Create3DElementReturnType.html +224 -0
- package/docs/types/CruisePluginExportType.html +224 -0
- package/docs/types/Direction-1.html +224 -0
- package/docs/types/Direction4.html +224 -0
- package/docs/types/FloorplanRuleLabels.html +226 -0
- package/docs/types/FloorplanServerRuleLabels.html +224 -0
- package/docs/types/GuideLinePluginExportType.html +224 -0
- package/docs/types/HelperEventMap.html +314 -0
- package/docs/types/MapviewFloorplanPluginParameterType.html +224 -0
- package/docs/types/MapviewFloorplanPluginReturnType.html +224 -0
- package/docs/types/MediaData.html +224 -0
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +224 -0
- package/docs/types/ModelFloorplanPluginParameterType.html +224 -0
- package/docs/types/ModelFloorplanPluginReturnType.html +224 -0
- package/docs/types/ModelRoomLabelPluginParameters.html +224 -0
- package/docs/types/ModelRoomLabelPluginReturnType.html +224 -0
- package/docs/types/MoveArgs.html +226 -0
- package/docs/types/MoveOpts.html +226 -0
- package/docs/types/Object3DHelperEventMap.html +317 -0
- package/docs/types/ObjectFit.html +224 -0
- package/docs/types/PaintBrushEventMap.html +255 -0
- package/docs/types/PanoCompassPluginData.html +224 -0
- package/docs/types/PanoCompassPluginExportType.html +224 -0
- package/docs/types/PanoCompassPluginParameterType.html +224 -0
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +224 -0
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +224 -0
- package/docs/types/PanoMeasurePluginEvent.html +224 -0
- package/docs/types/PanoMeasureReturnType.html +224 -0
- package/docs/types/PanoSpatialTagPluginId.html +224 -0
- package/docs/types/PanoTagPluginExportInterface.html +224 -0
- package/docs/types/PanoTagPluginParamsInterface.html +224 -0
- package/docs/types/PlaneTag.html +233 -0
- package/docs/types/PointTag.html +235 -0
- package/docs/types/Position.html +224 -0
- package/docs/types/RotateArgs.html +226 -0
- package/docs/types/RotateOpts.html +226 -0
- package/docs/types/RuleLabelsKey.html +224 -0
- package/docs/types/RuleLabelsValue.html +224 -0
- package/docs/types/Tag.html +235 -0
- package/docs/types/Tag2D.html +233 -0
- package/docs/types/Tag3D.html +233 -0
- package/docs/types/TagId.html +224 -0
- package/docs/types/TopviewFloorplanPluginParameterType.html +224 -0
- package/docs/types/TopviewFloorplanPluginReturnType.html +224 -0
- package/docs/variables/FLOOR_TYPE_MAP.html +226 -0
- package/docs/variables/PLUGIN.html +224 -0
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +226 -0
- package/docs/variables/ROOM_TYPE_MAP.html +226 -0
- package/docs/variables/VERSION.html +224 -0
- package/docs/variables/itemLabelPluginServerParams.html +231 -0
- package/docs/variables/modelItemLabelPluginServerParams.html +231 -0
- package/docs/variables/modelRoomLabelPluginServerParams.html +231 -0
- package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +2 -2
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +1 -300
- package/libs/CSS3DRenderPlugin/Controller.d.ts +3 -3
- package/libs/CSS3DRenderPlugin/Controller.js +1 -81
- package/libs/CSS3DRenderPlugin/index.js +1 -14
- package/libs/CSS3DRenderPlugin/typing.js +1 -1
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +1 -67
- package/libs/CSS3DRenderPlugin/utils/centerPoint.js +1 -10
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/index.js +1 -13
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/random.js +1 -6
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +1 -71
- package/libs/CameraMovementPlugin/index.js +1 -15
- package/libs/CameraMovementPlugin/typing.js +1 -5
- package/libs/CruisePlugin/Controller.js +1 -440
- package/libs/CruisePlugin/index.js +1 -27
- package/libs/CruisePlugin/utils/coordinatesAngle.js +1 -9
- package/libs/CruisePlugin/utils/coordinatesToVector.js +1 -12
- package/libs/CruisePlugin/utils/formatRad.js +1 -7
- package/libs/CruisePlugin/utils/linerValue.js +1 -7
- package/libs/CruisePlugin/utils/safeCall.js +1 -12
- package/libs/CruisePlugin/utils/sleep.js +1 -10
- package/libs/CruisePlugin/utils/vectorToCoordinates.js +1 -10
- package/libs/GuideLinePlugin/Controller.js +1 -112
- package/libs/GuideLinePlugin/index.js +1 -15
- package/libs/GuideLinePlugin/utils/getArrowMaterial.js +1 -13
- package/libs/GuideLinePlugin/utils/getLineGeometries.js +1 -118
- package/libs/GuideLinePlugin/utils/polyline-normals.d.ts +3 -0
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +1 -254
- package/libs/ItemLabelPlugin/ItemLabelItem.js +2 -133
- package/libs/ItemLabelPlugin/Plugin.js +2 -85
- package/libs/ItemLabelPlugin/index.js +1 -25
- package/libs/ItemLabelPlugin/typings.js +1 -4
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +1 -4
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +1 -16
- package/libs/ItemLabelPlugin/utils/isImpacted.js +1 -10
- package/libs/ItemLabelPlugin/utils/parseData.js +1 -10
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +1 -11
- package/libs/ModelChassisCompassPlugin/Plugin.js +1 -55
- package/libs/ModelChassisCompassPlugin/index.js +1 -10
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +1 -66
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -11
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -196
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +2 -42
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +2 -79
- package/libs/ModelItemLabelPlugin/events.type.js +1 -1
- package/libs/ModelItemLabelPlugin/index.js +1 -21
- package/libs/ModelItemLabelPlugin/typings.js +1 -4
- package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -9
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -4
- package/libs/ModelRoomLabelPlugin/Controller.js +1 -64
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +1 -45
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +1 -151
- package/libs/ModelRoomLabelPlugin/index.js +1 -16
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +1 -16
- package/libs/ModelTVVideoPlugin/Plugin.js +1 -157
- package/libs/ModelTVVideoPlugin/index.js +1 -19
- package/libs/ModelTVVideoPlugin/typings.js +1 -4
- package/libs/ModelTVVideoPlugin/utils/parseData.js +1 -20
- package/libs/ModelViewPlugin/Plugin.js +1 -96
- package/libs/ModelViewPlugin/index.js +1 -8
- package/libs/Object3DHelperPlugin/Controller.d.ts +1 -1
- package/libs/Object3DHelperPlugin/Controller.js +1 -137
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.d.ts +1 -1
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +1 -35
- package/libs/Object3DHelperPlugin/index.js +1 -42
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -4
- package/libs/PanoCompassPlugin/Controller.js +1 -205
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +1 -24
- package/libs/PanoCompassPlugin/index.js +1 -24
- package/libs/PanoCursorRaycasterPlugin/index.js +1 -60
- package/libs/PanoDoorLabelPlugin/BaseController.js +1 -50
- package/libs/PanoDoorLabelPlugin/Controller.js +1 -215
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +1 -65
- package/libs/PanoDoorLabelPlugin/index.d.ts +1 -1
- package/libs/PanoDoorLabelPlugin/index.js +1 -15
- package/libs/PanoDoorLabelPlugin/utils.d.ts +2 -2
- package/libs/PanoDoorLabelPlugin/utils.js +1 -23
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +1 -63
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -114
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -138
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +1 -33
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +1 -101
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -169
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -167
- package/libs/PanoMeasurePlugin/Model/index.d.ts +4 -4
- package/libs/PanoMeasurePlugin/Model/index.js +1 -99
- package/libs/PanoMeasurePlugin/Model/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Model/line.js +1 -60
- package/libs/PanoMeasurePlugin/Model/point.js +1 -30
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/polyline.js +1 -47
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +2 -5
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +3 -67
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +1 -28
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +1 -41
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -103
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +8 -12
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -50
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +1 -36
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -48
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +3 -8
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +1 -39
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +1 -70
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +2 -7
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -123
- package/libs/PanoMeasurePlugin/index.js +1 -60
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +1 -12
- package/libs/PanoMeasurePlugin/utils/constants.js +1 -23
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +1 -62
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +1 -13
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +1 -16
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +1 -9
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +1 -8
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -4
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +1 -7
- package/libs/PanoMeasurePlugin/utils/line.js +1 -18
- package/libs/PanoMeasurePlugin/utils/math.js +1 -13
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +3 -33
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +1 -8
- package/libs/PanoRulerPlugin/Plugin.js +3 -241
- package/libs/PanoRulerPlugin/index.js +1 -11
- package/libs/PanoRulerPlugin/style.js +2 -5
- package/libs/PanoRulerProPlugin/Controller.js +1 -74
- package/libs/PanoRulerProPlugin/RulerItem.js +1 -118
- package/libs/PanoRulerProPlugin/RulerItems.js +1 -181
- package/libs/PanoRulerProPlugin/index.js +1 -17
- package/libs/PanoSpatialTagPlugin/Components/origins.js +1 -82
- package/libs/PanoSpatialTagPlugin/Components/tag.js +1 -124
- package/libs/PanoSpatialTagPlugin/Plugin.js +1 -258
- package/libs/PanoSpatialTagPlugin/index.js +1 -24
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -1
- package/libs/PanoSpatialTagPlugin/store.js +1 -6
- package/libs/PanoSpatialTagPlugin/style.js +1 -11
- package/libs/PanoSpatialTagPlugin/typings.js +1 -1
- package/libs/PanoTagPlugin/Assets/Icon.js +1 -6
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +1 -103
- package/libs/PanoTagPlugin/Components/Common/Audio.js +1 -163
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +1 -93
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +1 -91
- package/libs/PanoTagPlugin/Components/Common/Media.js +1 -3438
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +1 -139
- package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +1 -181
- package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +1 -52
- package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +1 -52
- package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +1 -170
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +15 -125
- package/libs/PanoTagPlugin/Components/Common/Text.js +1 -984
- package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +1 -140
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +1 -72
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -202
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +1 -128
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +1 -231
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +1 -95
- package/libs/PanoTagPlugin/Components/Tag/TextTag.js +1 -134
- package/libs/PanoTagPlugin/Components/Tag/index.js +2 -308
- package/libs/PanoTagPlugin/Components/TagContainer.js +1 -187
- package/libs/PanoTagPlugin/Components/TagWrapper.js +1 -183
- package/libs/PanoTagPlugin/controller/TagCacheController.js +1 -32
- package/libs/PanoTagPlugin/controller/TagComputer.d.ts +5 -5
- package/libs/PanoTagPlugin/controller/TagComputer.js +1 -15
- package/libs/PanoTagPlugin/controller/index.js +1 -386
- package/libs/PanoTagPlugin/index.js +1 -71
- package/libs/PanoTagPlugin/tag.config.js +1 -44
- package/libs/PanoTagPlugin/typings/controller.js +1 -1
- package/libs/PanoTagPlugin/typings/index.js +1 -7
- package/libs/PanoTagPlugin/typings/tag.js +1 -7
- package/libs/PanoTagPlugin/utils/actionAfterFiveModelLoad.js +1 -6
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +1 -27
- package/libs/PanoTagPlugin/utils/checkRange.d.ts +1 -1
- package/libs/PanoTagPlugin/utils/checkRange.js +1 -10
- package/libs/PanoTagPlugin/utils/constants.js +1 -8
- package/libs/PanoTagPlugin/utils/debounce.js +1 -12
- package/libs/PanoTagPlugin/utils/doUtil.js +1 -12
- package/libs/PanoTagPlugin/utils/index.js +1 -36
- package/libs/PanoTagPlugin/utils/noTypecheck.js +1 -4
- package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +1 -13
- package/libs/PanoTagPlugin/utils/planeNormal.js +1 -11
- package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -17
- package/libs/PanoTagPlugin/utils/search.js +1 -33
- package/libs/PanoTagPlugin/utils/tagPosition.js +1 -13
- package/libs/PanoTagPlugin/utils/throttle.js +1 -11
- package/libs/base/BasePlugin.js +1 -18
- package/libs/base/BasePluginWithData.js +1 -7
- package/libs/components/PaintBrush/Controller.d.ts +2 -2
- package/libs/components/PaintBrush/Controller.js +1 -309
- package/libs/components/PaintBrush/Subscribe.js +1 -47
- package/libs/components/PaintBrush/index.js +1 -52
- package/libs/components/PaintBrush/style.js +2 -5
- package/libs/components/PaintBrush/tween.js +1 -15
- package/libs/components/PaintBrush/typings.js +1 -4
- package/libs/components/PaintBrush/utils.d.ts +1 -1
- package/libs/components/PaintBrush/utils.js +1 -45
- package/libs/components/index.js +1 -13
- package/libs/env.d.ts +1 -0
- package/libs/floorplan/Assets/camera.js +1 -4
- package/libs/floorplan/Assets/compass.js +1 -4
- package/libs/floorplan/Assets/floorplanExtraObject.js +1 -4
- package/libs/floorplan/Components/BaseImage.js +1 -104
- package/libs/floorplan/Components/Camera.js +1 -62
- package/libs/floorplan/Components/Compass.js +1 -60
- package/libs/floorplan/Components/CurrentFloor.js +1 -255
- package/libs/floorplan/Components/Main.js +1 -282
- package/libs/floorplan/Components/Normalmage.js +1 -37
- package/libs/floorplan/Components/RoomHighlight/Room.js +1 -61
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +1 -122
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +1 -152
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +1 -174
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +1 -184
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +1 -37
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -39
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +1 -37
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +1 -134
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +1 -139
- package/libs/floorplan/Components/SvgImage.js +2 -39
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +1 -322
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +1 -49
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -318
- package/libs/floorplan/ModelFloorplanPlugin/index.js +1 -49
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +1 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +1 -133
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +1 -72
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +1 -191
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -146
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +1 -26
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -265
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +1 -46
- package/libs/floorplan/constant.js +1 -4
- package/libs/floorplan/index.js +1 -67
- package/libs/floorplan/typings/floorplanData.js +1 -1
- package/libs/floorplan/typings/floorplanServerData.js +1 -101
- package/libs/floorplan/utils/constant.js +1 -8
- package/libs/floorplan/utils/correctFiveState.js +1 -36
- package/libs/floorplan/utils/formatData.js +1 -82
- package/libs/floorplan/utils/formatPosition.js +1 -35
- package/libs/index.js +1 -330
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -155
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +1 -53
- package/libs/shared-utils/Object3DHelper/Constants/color.js +1 -21
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +1 -29
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -74
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +1 -117
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -142
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +1 -81
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +1 -31
- package/libs/shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js +1 -14
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -31
- package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +1 -35
- package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -103
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +1 -143
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +1 -137
- package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -30
- package/libs/shared-utils/Object3DHelper/index.js +1 -140
- package/libs/shared-utils/Object3DHelper/typings/Direction.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Hooks.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Scissor.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/index.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/calculateThreeMouse.js +1 -11
- package/libs/shared-utils/Object3DHelper/utils/direction.js +1 -30
- package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +1 -18
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.js +1 -14
- package/libs/shared-utils/Object3DHelper/utils/getPoint.js +1 -18
- package/libs/shared-utils/Object3DHelper/utils/index.js +1 -29
- package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +1 -13
- package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +1 -5
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.ts +34 -0
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -191
- package/libs/shared-utils/Object3DHelper/utils/vectorIsEqual.js +1 -6
- package/libs/shared-utils/Subscribe.js +1 -50
- package/libs/shared-utils/animationFrame/BetterTween.js +1 -6
- package/libs/shared-utils/animationFrame/calculateProgress.js +1 -12
- package/libs/shared-utils/animationFrame/formatRad.js +1 -13
- package/libs/shared-utils/animationFrame/index.js +1 -51
- package/libs/shared-utils/animationFrame/tween.js +1 -30
- package/libs/shared-utils/changeModelCanvasOpacity.js +1 -12
- package/libs/shared-utils/createCanvasTextTexture.js +1 -11
- package/libs/shared-utils/createLine/index.js +1 -9
- package/libs/shared-utils/debounce.js +1 -11
- package/libs/shared-utils/equal.js +1 -54
- package/libs/shared-utils/filter.js +1 -30
- package/libs/shared-utils/five/changeMode.js +1 -21
- package/libs/shared-utils/getPxmm.js +1 -21
- package/libs/shared-utils/index.js +1 -45
- package/libs/shared-utils/isNil.js +1 -10
- package/libs/shared-utils/isTruelyObject.js +1 -6
- package/libs/shared-utils/math/Interval.js +1 -23
- package/libs/shared-utils/math/Rectangle.js +1 -23
- package/libs/shared-utils/math/index.js +1 -6
- package/libs/shared-utils/math/planimetry.d.ts +5 -5
- package/libs/shared-utils/math/planimetry.js +1 -135
- package/libs/shared-utils/math/rad2Deg.js +1 -6
- package/libs/shared-utils/nearlyEqual.js +1 -6
- package/libs/shared-utils/nextFrame.js +1 -6
- package/libs/shared-utils/noop.js +1 -5
- package/libs/shared-utils/object3d2LocalMatrix.js +1 -19
- package/libs/shared-utils/removeArrayItem.d.ts +1 -1
- package/libs/shared-utils/removeArrayItem.js +1 -8
- package/libs/shared-utils/tap.js +1 -6
- package/libs/shared-utils/three/Assets/index.js +1 -5
- package/libs/shared-utils/three/FivePointSelector.d.ts +1 -1
- package/libs/shared-utils/three/FivePointSelector.js +1 -63
- package/libs/shared-utils/three/Magnifier.d.ts +2 -2
- package/libs/shared-utils/three/Magnifier.js +1 -104
- package/libs/shared-utils/three/PointDomHelper.js +1 -68
- package/libs/shared-utils/three/PointHelper.js +3 -60
- package/libs/shared-utils/three/getCoords.js +1 -13
- package/libs/shared-utils/three/getIntersect.d.ts +1 -1
- package/libs/shared-utils/three/getIntersect.js +1 -8
- package/libs/shared-utils/three/getRaycaster.d.ts +1 -1
- package/libs/shared-utils/three/getRaycaster.js +1 -12
- package/libs/shared-utils/three/index.js +1 -33
- package/libs/shared-utils/three/loadTexture.js +1 -10
- package/libs/shared-utils/three/transformPositionToVector3.js +1 -5
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +1 -13
- package/libs/shared-utils/throttle.js +1 -11
- package/libs/shared-utils/tinyEJSrender.js +14 -138
- package/libs/shared-utils/to.js +1 -11
- package/libs/shared-utils/uuid.js +1 -10
- package/libs/vendor/swiper/components-shared/get-changed-params.js +1 -0
- package/libs/vendor/swiper/components-shared/get-params.js +1 -0
- package/libs/vendor/swiper/components-shared/mount-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/params-list.js +1 -0
- package/libs/vendor/swiper/components-shared/update-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/utils.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-slide.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-svelte.js +1 -0
- package/libs/vendor/swiper/svelte/swiper.js +1 -0
- package/package.json +218 -31
- package/dist/style.css +0 -1
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
- package/libs/CruisePlugin/typing.js +0 -1
- package/libs/GuideLinePlugin/typing.js +0 -1
- package/libs/GuideLinePlugin/utils/getPoint.d.ts +0 -3
- package/libs/GuideLinePlugin/utils/getPoint.js +0 -18
- package/libs/GuideLinePlugin/utils/polyline-normals.d.js +0 -1
- package/libs/ItemLabelPlugin/events.type.js +0 -1
- package/libs/ModelRoomLabelPlugin/typings.js +0 -1
- package/libs/Object3DHelperPlugin/mocks/addObject3D.d.ts +0 -2
- package/libs/Object3DHelperPlugin/mocks/addObject3D.js +0 -1377
- package/libs/Object3DHelperPlugin/mocks/objects.d.ts +0 -7
- package/libs/Object3DHelperPlugin/mocks/objects.js +0 -47
- package/libs/Object3DHelperPlugin/typings.js +0 -1
- package/libs/PanoCompassPlugin/typings.js +0 -1
- package/libs/PanoDoorLabelPlugin/typings.js +0 -1
- package/libs/PanoMeasurePlugin/typings/data.js +0 -1
- package/libs/PanoMeasurePlugin/typings/event.type.js +0 -1
- package/libs/PanoMeasurePlugin/typings/index.js +0 -1
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +0 -1
- package/libs/PanoMeasurePlugin/typings/utils.type.js +0 -1
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +0 -2
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +0 -6
- package/libs/PanoRulerPlugin/typings.js +0 -1
- package/libs/PanoRulerProPlugin/typings.js +0 -1
- package/libs/PanoTagPlugin/Components/Common/TextItem.js +0 -106
- package/libs/TagComputer.2bc444dc.js +0 -315
- package/libs/floorplan/MapviewFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +0 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -11
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +0 -1
- package/libs/floorplan/typings/index.js +0 -1
- package/libs/floorplan/typings/utility.js +0 -1
- package/libs/hammer.b5b6115e.js +0 -882
- package/libs/index.164f1850.js +0 -641
- package/libs/index.5d5d1089.js +0 -34
- package/libs/index.6a0eead1.js +0 -12
- package/libs/index.ad783a2f.js +0 -31
- package/libs/index.dca207cb.js +0 -37
- package/libs/index.f2f85d71.js +0 -40
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +0 -1
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.js +0 -6
- package/libs/shared-utils/Object3DHelper/utils/negateScale.d.ts +0 -2
- package/libs/shared-utils/Object3DHelper/utils/negateScale.js +0 -7
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.d.js +0 -4
- package/libs/shared-utils/Preloader.d.ts +0 -6
- package/libs/shared-utils/Preloader.js +0 -18
- package/libs/shared-utils/formatRad.d.ts +0 -7
- package/libs/shared-utils/formatRad.js +0 -7
- package/libs/shared-utils/getRandomColor.d.ts +0 -1
- package/libs/shared-utils/getRandomColor.js +0 -6
- package/libs/shared-utils/logger.d.ts +0 -16
- package/libs/shared-utils/logger.js +0 -27
- package/libs/shared-utils/math/evenNumber.d.ts +0 -3
- package/libs/shared-utils/math/evenNumber.js +0 -7
- package/libs/shared-utils/px2rem.d.ts +0 -1
- package/libs/shared-utils/px2rem.js +0 -6
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +0 -6
- package/libs/shared-utils/three/getExtraModelLoader.js +0 -18
- package/libs/shared-utils/three/getNormal.d.ts +0 -2
- package/libs/shared-utils/three/getNormal.js +0 -7
- package/libs/shared-utils/three/getTextureLoader.d.ts +0 -6
- package/libs/shared-utils/three/getTextureLoader.js +0 -16
- package/libs/shared-utils/three/loadFbxObj.d.ts +0 -2
- package/libs/shared-utils/three/loadFbxObj.js +0 -16
- package/libs/shared-utils/vectorTocoordinates.d.ts +0 -7
- package/libs/shared-utils/vectorTocoordinates.js +0 -10
- package/libs/style.css +0 -1
- package/libs/tween.esm.bad2b2b4.js +0 -340
- package/libs/typings/math.type.js +0 -1
- package/libs/typings/utils.type.d.ts +0 -2
- package/libs/typings/utils.type.js +0 -1
|
@@ -1,1377 +0,0 @@
|
|
|
1
|
-
import * as je from "three";
|
|
2
|
-
import Be from "three";
|
|
3
|
-
var De = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Te = {}, Ie = { exports: {} };
|
|
4
|
-
(function(y) {
|
|
5
|
-
var M, l, S, R, O, N, B, U, C, E, K, V, I, z, Z, q, W, te, re, he, le, ce, ue, Q, ae;
|
|
6
|
-
(function(D) {
|
|
7
|
-
var se = typeof De == "object" ? De : typeof self == "object" ? self : typeof this == "object" ? this : {};
|
|
8
|
-
D(ne(se, ne(y.exports)));
|
|
9
|
-
function ne(s, c) {
|
|
10
|
-
return s !== se && (typeof Object.create == "function" ? Object.defineProperty(s, "__esModule", { value: !0 }) : s.__esModule = !0), function(p, m) {
|
|
11
|
-
return s[p] = c ? c(p, m) : m;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
})(function(D) {
|
|
15
|
-
var se = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(s, c) {
|
|
16
|
-
s.__proto__ = c;
|
|
17
|
-
} || function(s, c) {
|
|
18
|
-
for (var p in c)
|
|
19
|
-
Object.prototype.hasOwnProperty.call(c, p) && (s[p] = c[p]);
|
|
20
|
-
};
|
|
21
|
-
M = function(s, c) {
|
|
22
|
-
if (typeof c != "function" && c !== null)
|
|
23
|
-
throw new TypeError("Class extends value " + String(c) + " is not a constructor or null");
|
|
24
|
-
se(s, c);
|
|
25
|
-
function p() {
|
|
26
|
-
this.constructor = s;
|
|
27
|
-
}
|
|
28
|
-
s.prototype = c === null ? Object.create(c) : (p.prototype = c.prototype, new p());
|
|
29
|
-
}, l = Object.assign || function(s) {
|
|
30
|
-
for (var c, p = 1, m = arguments.length; p < m; p++) {
|
|
31
|
-
c = arguments[p];
|
|
32
|
-
for (var T in c)
|
|
33
|
-
Object.prototype.hasOwnProperty.call(c, T) && (s[T] = c[T]);
|
|
34
|
-
}
|
|
35
|
-
return s;
|
|
36
|
-
}, S = function(s, c) {
|
|
37
|
-
var p = {};
|
|
38
|
-
for (var m in s)
|
|
39
|
-
Object.prototype.hasOwnProperty.call(s, m) && c.indexOf(m) < 0 && (p[m] = s[m]);
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
41
|
-
for (var T = 0, m = Object.getOwnPropertySymbols(s); T < m.length; T++)
|
|
42
|
-
c.indexOf(m[T]) < 0 && Object.prototype.propertyIsEnumerable.call(s, m[T]) && (p[m[T]] = s[m[T]]);
|
|
43
|
-
return p;
|
|
44
|
-
}, R = function(s, c, p, m) {
|
|
45
|
-
var T = arguments.length, g = T < 3 ? c : m === null ? m = Object.getOwnPropertyDescriptor(c, p) : m, x;
|
|
46
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
47
|
-
g = Reflect.decorate(s, c, p, m);
|
|
48
|
-
else
|
|
49
|
-
for (var H = s.length - 1; H >= 0; H--)
|
|
50
|
-
(x = s[H]) && (g = (T < 3 ? x(g) : T > 3 ? x(c, p, g) : x(c, p)) || g);
|
|
51
|
-
return T > 3 && g && Object.defineProperty(c, p, g), g;
|
|
52
|
-
}, O = function(s, c) {
|
|
53
|
-
return function(p, m) {
|
|
54
|
-
c(p, m, s);
|
|
55
|
-
};
|
|
56
|
-
}, N = function(s, c) {
|
|
57
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
58
|
-
return Reflect.metadata(s, c);
|
|
59
|
-
}, B = function(s, c, p, m) {
|
|
60
|
-
function T(g) {
|
|
61
|
-
return g instanceof p ? g : new p(function(x) {
|
|
62
|
-
x(g);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return new (p || (p = Promise))(function(g, x) {
|
|
66
|
-
function H($) {
|
|
67
|
-
try {
|
|
68
|
-
P(m.next($));
|
|
69
|
-
} catch (G) {
|
|
70
|
-
x(G);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function Y($) {
|
|
74
|
-
try {
|
|
75
|
-
P(m.throw($));
|
|
76
|
-
} catch (G) {
|
|
77
|
-
x(G);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function P($) {
|
|
81
|
-
$.done ? g($.value) : T($.value).then(H, Y);
|
|
82
|
-
}
|
|
83
|
-
P((m = m.apply(s, c || [])).next());
|
|
84
|
-
});
|
|
85
|
-
}, U = function(s, c) {
|
|
86
|
-
var p = { label: 0, sent: function() {
|
|
87
|
-
if (g[0] & 1)
|
|
88
|
-
throw g[1];
|
|
89
|
-
return g[1];
|
|
90
|
-
}, trys: [], ops: [] }, m, T, g, x;
|
|
91
|
-
return x = { next: H(0), throw: H(1), return: H(2) }, typeof Symbol == "function" && (x[Symbol.iterator] = function() {
|
|
92
|
-
return this;
|
|
93
|
-
}), x;
|
|
94
|
-
function H(P) {
|
|
95
|
-
return function($) {
|
|
96
|
-
return Y([P, $]);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function Y(P) {
|
|
100
|
-
if (m)
|
|
101
|
-
throw new TypeError("Generator is already executing.");
|
|
102
|
-
for (; p; )
|
|
103
|
-
try {
|
|
104
|
-
if (m = 1, T && (g = P[0] & 2 ? T.return : P[0] ? T.throw || ((g = T.return) && g.call(T), 0) : T.next) && !(g = g.call(T, P[1])).done)
|
|
105
|
-
return g;
|
|
106
|
-
switch (T = 0, g && (P = [P[0] & 2, g.value]), P[0]) {
|
|
107
|
-
case 0:
|
|
108
|
-
case 1:
|
|
109
|
-
g = P;
|
|
110
|
-
break;
|
|
111
|
-
case 4:
|
|
112
|
-
return p.label++, { value: P[1], done: !1 };
|
|
113
|
-
case 5:
|
|
114
|
-
p.label++, T = P[1], P = [0];
|
|
115
|
-
continue;
|
|
116
|
-
case 7:
|
|
117
|
-
P = p.ops.pop(), p.trys.pop();
|
|
118
|
-
continue;
|
|
119
|
-
default:
|
|
120
|
-
if (g = p.trys, !(g = g.length > 0 && g[g.length - 1]) && (P[0] === 6 || P[0] === 2)) {
|
|
121
|
-
p = 0;
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
if (P[0] === 3 && (!g || P[1] > g[0] && P[1] < g[3])) {
|
|
125
|
-
p.label = P[1];
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
if (P[0] === 6 && p.label < g[1]) {
|
|
129
|
-
p.label = g[1], g = P;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
if (g && p.label < g[2]) {
|
|
133
|
-
p.label = g[2], p.ops.push(P);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
g[2] && p.ops.pop(), p.trys.pop();
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
P = c.call(s, p);
|
|
140
|
-
} catch ($) {
|
|
141
|
-
P = [6, $], T = 0;
|
|
142
|
-
} finally {
|
|
143
|
-
m = g = 0;
|
|
144
|
-
}
|
|
145
|
-
if (P[0] & 5)
|
|
146
|
-
throw P[1];
|
|
147
|
-
return { value: P[0] ? P[1] : void 0, done: !0 };
|
|
148
|
-
}
|
|
149
|
-
}, C = function(s, c) {
|
|
150
|
-
for (var p in s)
|
|
151
|
-
p !== "default" && !Object.prototype.hasOwnProperty.call(c, p) && ae(c, s, p);
|
|
152
|
-
}, ae = Object.create ? function(s, c, p, m) {
|
|
153
|
-
m === void 0 && (m = p);
|
|
154
|
-
var T = Object.getOwnPropertyDescriptor(c, p);
|
|
155
|
-
(!T || ("get" in T ? !c.__esModule : T.writable || T.configurable)) && (T = { enumerable: !0, get: function() {
|
|
156
|
-
return c[p];
|
|
157
|
-
} }), Object.defineProperty(s, m, T);
|
|
158
|
-
} : function(s, c, p, m) {
|
|
159
|
-
m === void 0 && (m = p), s[m] = c[p];
|
|
160
|
-
}, E = function(s) {
|
|
161
|
-
var c = typeof Symbol == "function" && Symbol.iterator, p = c && s[c], m = 0;
|
|
162
|
-
if (p)
|
|
163
|
-
return p.call(s);
|
|
164
|
-
if (s && typeof s.length == "number")
|
|
165
|
-
return {
|
|
166
|
-
next: function() {
|
|
167
|
-
return s && m >= s.length && (s = void 0), { value: s && s[m++], done: !s };
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
throw new TypeError(c ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
171
|
-
}, K = function(s, c) {
|
|
172
|
-
var p = typeof Symbol == "function" && s[Symbol.iterator];
|
|
173
|
-
if (!p)
|
|
174
|
-
return s;
|
|
175
|
-
var m = p.call(s), T, g = [], x;
|
|
176
|
-
try {
|
|
177
|
-
for (; (c === void 0 || c-- > 0) && !(T = m.next()).done; )
|
|
178
|
-
g.push(T.value);
|
|
179
|
-
} catch (H) {
|
|
180
|
-
x = { error: H };
|
|
181
|
-
} finally {
|
|
182
|
-
try {
|
|
183
|
-
T && !T.done && (p = m.return) && p.call(m);
|
|
184
|
-
} finally {
|
|
185
|
-
if (x)
|
|
186
|
-
throw x.error;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return g;
|
|
190
|
-
}, V = function() {
|
|
191
|
-
for (var s = [], c = 0; c < arguments.length; c++)
|
|
192
|
-
s = s.concat(K(arguments[c]));
|
|
193
|
-
return s;
|
|
194
|
-
}, I = function() {
|
|
195
|
-
for (var s = 0, c = 0, p = arguments.length; c < p; c++)
|
|
196
|
-
s += arguments[c].length;
|
|
197
|
-
for (var m = Array(s), T = 0, c = 0; c < p; c++)
|
|
198
|
-
for (var g = arguments[c], x = 0, H = g.length; x < H; x++, T++)
|
|
199
|
-
m[T] = g[x];
|
|
200
|
-
return m;
|
|
201
|
-
}, z = function(s, c, p) {
|
|
202
|
-
if (p || arguments.length === 2)
|
|
203
|
-
for (var m = 0, T = c.length, g; m < T; m++)
|
|
204
|
-
(g || !(m in c)) && (g || (g = Array.prototype.slice.call(c, 0, m)), g[m] = c[m]);
|
|
205
|
-
return s.concat(g || Array.prototype.slice.call(c));
|
|
206
|
-
}, Z = function(s) {
|
|
207
|
-
return this instanceof Z ? (this.v = s, this) : new Z(s);
|
|
208
|
-
}, q = function(s, c, p) {
|
|
209
|
-
if (!Symbol.asyncIterator)
|
|
210
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
211
|
-
var m = p.apply(s, c || []), T, g = [];
|
|
212
|
-
return T = {}, x("next"), x("throw"), x("return"), T[Symbol.asyncIterator] = function() {
|
|
213
|
-
return this;
|
|
214
|
-
}, T;
|
|
215
|
-
function x(J) {
|
|
216
|
-
m[J] && (T[J] = function(me) {
|
|
217
|
-
return new Promise(function(t, e) {
|
|
218
|
-
g.push([J, me, t, e]) > 1 || H(J, me);
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function H(J, me) {
|
|
223
|
-
try {
|
|
224
|
-
Y(m[J](me));
|
|
225
|
-
} catch (t) {
|
|
226
|
-
G(g[0][3], t);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
function Y(J) {
|
|
230
|
-
J.value instanceof Z ? Promise.resolve(J.value.v).then(P, $) : G(g[0][2], J);
|
|
231
|
-
}
|
|
232
|
-
function P(J) {
|
|
233
|
-
H("next", J);
|
|
234
|
-
}
|
|
235
|
-
function $(J) {
|
|
236
|
-
H("throw", J);
|
|
237
|
-
}
|
|
238
|
-
function G(J, me) {
|
|
239
|
-
J(me), g.shift(), g.length && H(g[0][0], g[0][1]);
|
|
240
|
-
}
|
|
241
|
-
}, W = function(s) {
|
|
242
|
-
var c, p;
|
|
243
|
-
return c = {}, m("next"), m("throw", function(T) {
|
|
244
|
-
throw T;
|
|
245
|
-
}), m("return"), c[Symbol.iterator] = function() {
|
|
246
|
-
return this;
|
|
247
|
-
}, c;
|
|
248
|
-
function m(T, g) {
|
|
249
|
-
c[T] = s[T] ? function(x) {
|
|
250
|
-
return (p = !p) ? { value: Z(s[T](x)), done: T === "return" } : g ? g(x) : x;
|
|
251
|
-
} : g;
|
|
252
|
-
}
|
|
253
|
-
}, te = function(s) {
|
|
254
|
-
if (!Symbol.asyncIterator)
|
|
255
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
256
|
-
var c = s[Symbol.asyncIterator], p;
|
|
257
|
-
return c ? c.call(s) : (s = typeof E == "function" ? E(s) : s[Symbol.iterator](), p = {}, m("next"), m("throw"), m("return"), p[Symbol.asyncIterator] = function() {
|
|
258
|
-
return this;
|
|
259
|
-
}, p);
|
|
260
|
-
function m(g) {
|
|
261
|
-
p[g] = s[g] && function(x) {
|
|
262
|
-
return new Promise(function(H, Y) {
|
|
263
|
-
x = s[g](x), T(H, Y, x.done, x.value);
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
function T(g, x, H, Y) {
|
|
268
|
-
Promise.resolve(Y).then(function(P) {
|
|
269
|
-
g({ value: P, done: H });
|
|
270
|
-
}, x);
|
|
271
|
-
}
|
|
272
|
-
}, re = function(s, c) {
|
|
273
|
-
return Object.defineProperty ? Object.defineProperty(s, "raw", { value: c }) : s.raw = c, s;
|
|
274
|
-
};
|
|
275
|
-
var ne = Object.create ? function(s, c) {
|
|
276
|
-
Object.defineProperty(s, "default", { enumerable: !0, value: c });
|
|
277
|
-
} : function(s, c) {
|
|
278
|
-
s.default = c;
|
|
279
|
-
};
|
|
280
|
-
he = function(s) {
|
|
281
|
-
if (s && s.__esModule)
|
|
282
|
-
return s;
|
|
283
|
-
var c = {};
|
|
284
|
-
if (s != null)
|
|
285
|
-
for (var p in s)
|
|
286
|
-
p !== "default" && Object.prototype.hasOwnProperty.call(s, p) && ae(c, s, p);
|
|
287
|
-
return ne(c, s), c;
|
|
288
|
-
}, le = function(s) {
|
|
289
|
-
return s && s.__esModule ? s : { default: s };
|
|
290
|
-
}, ce = function(s, c, p, m) {
|
|
291
|
-
if (p === "a" && !m)
|
|
292
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
293
|
-
if (typeof c == "function" ? s !== c || !m : !c.has(s))
|
|
294
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
295
|
-
return p === "m" ? m : p === "a" ? m.call(s) : m ? m.value : c.get(s);
|
|
296
|
-
}, ue = function(s, c, p, m, T) {
|
|
297
|
-
if (m === "m")
|
|
298
|
-
throw new TypeError("Private method is not writable");
|
|
299
|
-
if (m === "a" && !T)
|
|
300
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
301
|
-
if (typeof c == "function" ? s !== c || !T : !c.has(s))
|
|
302
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
303
|
-
return m === "a" ? T.call(s, p) : T ? T.value = p : c.set(s, p), p;
|
|
304
|
-
}, Q = function(s, c) {
|
|
305
|
-
if (c === null || typeof c != "object" && typeof c != "function")
|
|
306
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
307
|
-
return typeof s == "function" ? c === s : s.has(c);
|
|
308
|
-
}, D("__extends", M), D("__assign", l), D("__rest", S), D("__decorate", R), D("__param", O), D("__metadata", N), D("__awaiter", B), D("__generator", U), D("__exportStar", C), D("__createBinding", ae), D("__values", E), D("__read", K), D("__spread", V), D("__spreadArrays", I), D("__spreadArray", z), D("__await", Z), D("__asyncGenerator", q), D("__asyncDelegator", W), D("__asyncValues", te), D("__makeTemplateObject", re), D("__importStar", he), D("__importDefault", le), D("__classPrivateFieldGet", ce), D("__classPrivateFieldSet", ue), D("__classPrivateFieldIn", Q);
|
|
309
|
-
});
|
|
310
|
-
})(Ie);
|
|
311
|
-
var Fe;
|
|
312
|
-
Object.defineProperty(Te, "__esModule", { value: !0 });
|
|
313
|
-
var Ue = Ie.exports, f = Be;
|
|
314
|
-
function Ke(y) {
|
|
315
|
-
if (y && y.__esModule)
|
|
316
|
-
return y;
|
|
317
|
-
var M = /* @__PURE__ */ Object.create(null);
|
|
318
|
-
return y && Object.keys(y).forEach(function(l) {
|
|
319
|
-
if (l !== "default") {
|
|
320
|
-
var S = Object.getOwnPropertyDescriptor(y, l);
|
|
321
|
-
Object.defineProperty(M, l, S.get ? S : { enumerable: !0, get: function() {
|
|
322
|
-
return y[l];
|
|
323
|
-
} });
|
|
324
|
-
}
|
|
325
|
-
}), M.default = y, Object.freeze(M);
|
|
326
|
-
}
|
|
327
|
-
var Oe = Ke(f), He = function() {
|
|
328
|
-
function y(t) {
|
|
329
|
-
f.Loader.call(this, t), this.dracoLoader = null, this.ddsLoader = null;
|
|
330
|
-
}
|
|
331
|
-
function M() {
|
|
332
|
-
var t = {};
|
|
333
|
-
return { get: function(e) {
|
|
334
|
-
return t[e];
|
|
335
|
-
}, add: function(e, a) {
|
|
336
|
-
t[e] = a;
|
|
337
|
-
}, remove: function(e) {
|
|
338
|
-
delete t[e];
|
|
339
|
-
}, removeAll: function() {
|
|
340
|
-
t = {};
|
|
341
|
-
} };
|
|
342
|
-
}
|
|
343
|
-
y.prototype = Object.assign(Object.create(f.Loader.prototype), { constructor: y, load: function(t, e, a, r) {
|
|
344
|
-
var i, n = this;
|
|
345
|
-
i = this.resourcePath !== "" ? this.resourcePath : this.path !== "" ? this.path : f.LoaderUtils.extractUrlBase(t), n.manager.itemStart(t);
|
|
346
|
-
var u = function(h) {
|
|
347
|
-
r ? r(h) : console.error(h), n.manager.itemError(t), n.manager.itemEnd(t);
|
|
348
|
-
}, o = new f.FileLoader(n.manager);
|
|
349
|
-
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), n.crossOrigin === "use-credentials" && o.setWithCredentials(!0), o.load(t, function(h) {
|
|
350
|
-
try {
|
|
351
|
-
n.parse(h, i, function(d) {
|
|
352
|
-
e(d), n.manager.itemEnd(t);
|
|
353
|
-
}, u);
|
|
354
|
-
} catch (d) {
|
|
355
|
-
u(d);
|
|
356
|
-
}
|
|
357
|
-
}, a, u);
|
|
358
|
-
}, setDRACOLoader: function(t) {
|
|
359
|
-
return this.dracoLoader = t, this;
|
|
360
|
-
}, setDDSLoader: function(t) {
|
|
361
|
-
return this.ddsLoader = t, this;
|
|
362
|
-
}, parse: function(t, e, a, r) {
|
|
363
|
-
var i, n = {};
|
|
364
|
-
if (typeof t == "string")
|
|
365
|
-
i = t;
|
|
366
|
-
else if (f.LoaderUtils.decodeText(new Uint8Array(t, 0, 4)) === B) {
|
|
367
|
-
try {
|
|
368
|
-
n[l.KHR_BINARY_GLTF] = new E(t);
|
|
369
|
-
} catch (v) {
|
|
370
|
-
return void (r && r(v));
|
|
371
|
-
}
|
|
372
|
-
i = n[l.KHR_BINARY_GLTF].content;
|
|
373
|
-
} else
|
|
374
|
-
i = f.LoaderUtils.decodeText(new Uint8Array(t));
|
|
375
|
-
var u = JSON.parse(i);
|
|
376
|
-
if (u.asset === void 0 || u.asset.version[0] < 2)
|
|
377
|
-
r && r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
378
|
-
else {
|
|
379
|
-
if (u.extensionsUsed)
|
|
380
|
-
for (var o = 0; o < u.extensionsUsed.length; ++o) {
|
|
381
|
-
var h = u.extensionsUsed[o], d = u.extensionsRequired || [];
|
|
382
|
-
switch (h) {
|
|
383
|
-
case l.KHR_LIGHTS_PUNCTUAL:
|
|
384
|
-
n[h] = new R(u);
|
|
385
|
-
break;
|
|
386
|
-
case l.KHR_MATERIALS_CLEARCOAT:
|
|
387
|
-
n[h] = new N();
|
|
388
|
-
break;
|
|
389
|
-
case l.KHR_MATERIALS_UNLIT:
|
|
390
|
-
n[h] = new O();
|
|
391
|
-
break;
|
|
392
|
-
case l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
|
|
393
|
-
n[h] = new z();
|
|
394
|
-
break;
|
|
395
|
-
case l.KHR_DRACO_MESH_COMPRESSION:
|
|
396
|
-
n[h] = new K(u, this.dracoLoader);
|
|
397
|
-
break;
|
|
398
|
-
case l.MSFT_TEXTURE_DDS:
|
|
399
|
-
n[h] = new S(this.ddsLoader);
|
|
400
|
-
break;
|
|
401
|
-
case l.KHR_TEXTURE_TRANSFORM:
|
|
402
|
-
n[h] = new V();
|
|
403
|
-
break;
|
|
404
|
-
case l.KHR_MESH_QUANTIZATION:
|
|
405
|
-
n[h] = new Z();
|
|
406
|
-
break;
|
|
407
|
-
default:
|
|
408
|
-
d.indexOf(h) >= 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
var _ = new G(u, n, { path: e || this.resourcePath || "", crossOrigin: this.crossOrigin, manager: this.manager });
|
|
412
|
-
_.fileLoader.setRequestHeader(this.requestHeader), _.parse(a, r);
|
|
413
|
-
}
|
|
414
|
-
} });
|
|
415
|
-
var l = { KHR_BINARY_GLTF: "KHR_binary_glTF", KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression", KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual", KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat", KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness", KHR_MATERIALS_UNLIT: "KHR_materials_unlit", KHR_TEXTURE_TRANSFORM: "KHR_texture_transform", KHR_MESH_QUANTIZATION: "KHR_mesh_quantization", MSFT_TEXTURE_DDS: "MSFT_texture_dds" };
|
|
416
|
-
function S(t) {
|
|
417
|
-
if (!t)
|
|
418
|
-
throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");
|
|
419
|
-
this.name = l.MSFT_TEXTURE_DDS, this.ddsLoader = t;
|
|
420
|
-
}
|
|
421
|
-
function R(t) {
|
|
422
|
-
this.name = l.KHR_LIGHTS_PUNCTUAL;
|
|
423
|
-
var e = t.extensions && t.extensions[l.KHR_LIGHTS_PUNCTUAL] || {};
|
|
424
|
-
this.lightDefs = e.lights || [];
|
|
425
|
-
}
|
|
426
|
-
function O() {
|
|
427
|
-
this.name = l.KHR_MATERIALS_UNLIT;
|
|
428
|
-
}
|
|
429
|
-
function N() {
|
|
430
|
-
this.name = l.KHR_MATERIALS_CLEARCOAT;
|
|
431
|
-
}
|
|
432
|
-
R.prototype.loadLight = function(t) {
|
|
433
|
-
var e, a = this.lightDefs[t], r = new f.Color(16777215);
|
|
434
|
-
a.color !== void 0 && r.fromArray(a.color);
|
|
435
|
-
var i = a.range !== void 0 ? a.range : 0;
|
|
436
|
-
switch (a.type) {
|
|
437
|
-
case "directional":
|
|
438
|
-
(e = new f.DirectionalLight(r)).target.position.set(0, 0, -1), e.add(e.target);
|
|
439
|
-
break;
|
|
440
|
-
case "point":
|
|
441
|
-
(e = new f.PointLight(r)).distance = i;
|
|
442
|
-
break;
|
|
443
|
-
case "spot":
|
|
444
|
-
(e = new f.SpotLight(r)).distance = i, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, e.angle = a.spot.outerConeAngle, e.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, e.target.position.set(0, 0, -1), e.add(e.target);
|
|
445
|
-
break;
|
|
446
|
-
default:
|
|
447
|
-
throw new Error('THREE.GLTFLoader: Unexpected light type, "' + a.type + '".');
|
|
448
|
-
}
|
|
449
|
-
return e.position.set(0, 0, 0), e.decay = 2, a.intensity !== void 0 && (e.intensity = a.intensity), e.name = a.name || "light_" + t, Promise.resolve(e);
|
|
450
|
-
}, O.prototype.getMaterialType = function() {
|
|
451
|
-
return f.MeshBasicMaterial;
|
|
452
|
-
}, O.prototype.extendParams = function(t, e, a) {
|
|
453
|
-
var r = [];
|
|
454
|
-
t.color = new f.Color(1, 1, 1), t.opacity = 1;
|
|
455
|
-
var i = e.pbrMetallicRoughness;
|
|
456
|
-
if (i) {
|
|
457
|
-
if (Array.isArray(i.baseColorFactor)) {
|
|
458
|
-
var n = i.baseColorFactor;
|
|
459
|
-
t.color.fromArray(n), t.opacity = n[3];
|
|
460
|
-
}
|
|
461
|
-
i.baseColorTexture !== void 0 && r.push(a.assignTexture(t, "map", i.baseColorTexture));
|
|
462
|
-
}
|
|
463
|
-
return Promise.all(r);
|
|
464
|
-
}, N.prototype.getMaterialType = function() {
|
|
465
|
-
return f.MeshPhysicalMaterial;
|
|
466
|
-
}, N.prototype.extendParams = function(t, e, a) {
|
|
467
|
-
var r = [], i = e.extensions[this.name];
|
|
468
|
-
if (i.clearcoatFactor !== void 0 && (t.clearcoat = i.clearcoatFactor), i.clearcoatTexture !== void 0 && r.push(a.assignTexture(t, "clearcoatMap", i.clearcoatTexture)), i.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = i.clearcoatRoughnessFactor), i.clearcoatRoughnessTexture !== void 0 && r.push(a.assignTexture(t, "clearcoatRoughnessMap", i.clearcoatRoughnessTexture)), i.clearcoatNormalTexture !== void 0 && (r.push(a.assignTexture(t, "clearcoatNormalMap", i.clearcoatNormalTexture)), i.clearcoatNormalTexture.scale !== void 0)) {
|
|
469
|
-
var n = i.clearcoatNormalTexture.scale;
|
|
470
|
-
t.clearcoatNormalScale = new f.Vector2(n, n);
|
|
471
|
-
}
|
|
472
|
-
return Promise.all(r);
|
|
473
|
-
};
|
|
474
|
-
var B = "glTF", U = 1313821514, C = 5130562;
|
|
475
|
-
function E(t) {
|
|
476
|
-
this.name = l.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
477
|
-
var e = new DataView(t, 0, 12);
|
|
478
|
-
if (this.header = { magic: f.LoaderUtils.decodeText(new Uint8Array(t.slice(0, 4))), version: e.getUint32(4, !0), length: e.getUint32(8, !0) }, this.header.magic !== B)
|
|
479
|
-
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
480
|
-
if (this.header.version < 2)
|
|
481
|
-
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
482
|
-
for (var a = new DataView(t, 12), r = 0; r < a.byteLength; ) {
|
|
483
|
-
var i = a.getUint32(r, !0);
|
|
484
|
-
r += 4;
|
|
485
|
-
var n = a.getUint32(r, !0);
|
|
486
|
-
if (r += 4, n === U) {
|
|
487
|
-
var u = new Uint8Array(t, 12 + r, i);
|
|
488
|
-
this.content = f.LoaderUtils.decodeText(u);
|
|
489
|
-
} else if (n === C) {
|
|
490
|
-
var o = 12 + r;
|
|
491
|
-
this.body = t.slice(o, o + i);
|
|
492
|
-
}
|
|
493
|
-
r += i;
|
|
494
|
-
}
|
|
495
|
-
if (this.content === null)
|
|
496
|
-
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
497
|
-
}
|
|
498
|
-
function K(t, e) {
|
|
499
|
-
if (!e)
|
|
500
|
-
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
501
|
-
this.name = l.KHR_DRACO_MESH_COMPRESSION, this.json = t, this.dracoLoader = e, this.dracoLoader.preload();
|
|
502
|
-
}
|
|
503
|
-
function V() {
|
|
504
|
-
this.name = l.KHR_TEXTURE_TRANSFORM;
|
|
505
|
-
}
|
|
506
|
-
function I(t) {
|
|
507
|
-
f.MeshStandardMaterial.call(this), this.isGLTFSpecularGlossinessMaterial = !0;
|
|
508
|
-
var e = ["#ifdef USE_SPECULARMAP", " uniform sampler2D specularMap;", "#endif"].join(`
|
|
509
|
-
`), a = ["#ifdef USE_GLOSSINESSMAP", " uniform sampler2D glossinessMap;", "#endif"].join(`
|
|
510
|
-
`), r = ["vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", " vec4 texelSpecular = texture2D( specularMap, vUv );", " texelSpecular = sRGBToLinear( texelSpecular );", " // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", " specularFactor *= texelSpecular.rgb;", "#endif"].join(`
|
|
511
|
-
`), i = ["float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", " vec4 texelGlossiness = texture2D( glossinessMap, vUv );", " // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", " glossinessFactor *= texelGlossiness.a;", "#endif"].join(`
|
|
512
|
-
`), n = ["PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb;", "vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );", "float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );", "material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.", "material.specularRoughness += geometryRoughness;", "material.specularRoughness = min( material.specularRoughness, 1.0 );", "material.specularColor = specularFactor.rgb;"].join(`
|
|
513
|
-
`), u = { specular: { value: new f.Color().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null } };
|
|
514
|
-
this._extraUniforms = u, this.onBeforeCompile = function(o) {
|
|
515
|
-
for (var h in u)
|
|
516
|
-
o.uniforms[h] = u[h];
|
|
517
|
-
o.fragmentShader = o.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;"), o.fragmentShader = o.fragmentShader.replace("uniform float metalness;", "uniform float glossiness;"), o.fragmentShader = o.fragmentShader.replace("#include <roughnessmap_pars_fragment>", e), o.fragmentShader = o.fragmentShader.replace("#include <metalnessmap_pars_fragment>", a), o.fragmentShader = o.fragmentShader.replace("#include <roughnessmap_fragment>", r), o.fragmentShader = o.fragmentShader.replace("#include <metalnessmap_fragment>", i), o.fragmentShader = o.fragmentShader.replace("#include <lights_physical_fragment>", n);
|
|
518
|
-
}, Object.defineProperties(this, { specular: { get: function() {
|
|
519
|
-
return u.specular.value;
|
|
520
|
-
}, set: function(o) {
|
|
521
|
-
u.specular.value = o;
|
|
522
|
-
} }, specularMap: { get: function() {
|
|
523
|
-
return u.specularMap.value;
|
|
524
|
-
}, set: function(o) {
|
|
525
|
-
u.specularMap.value = o;
|
|
526
|
-
} }, glossiness: { get: function() {
|
|
527
|
-
return u.glossiness.value;
|
|
528
|
-
}, set: function(o) {
|
|
529
|
-
u.glossiness.value = o;
|
|
530
|
-
} }, glossinessMap: { get: function() {
|
|
531
|
-
return u.glossinessMap.value;
|
|
532
|
-
}, set: function(o) {
|
|
533
|
-
u.glossinessMap.value = o, o ? (this.defines.USE_GLOSSINESSMAP = "", this.defines.USE_ROUGHNESSMAP = "") : (delete this.defines.USE_ROUGHNESSMAP, delete this.defines.USE_GLOSSINESSMAP);
|
|
534
|
-
} } }), delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this.setValues(t);
|
|
535
|
-
}
|
|
536
|
-
function z() {
|
|
537
|
-
return { name: l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS, specularGlossinessParams: ["color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "normalMapType", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio"], getMaterialType: function() {
|
|
538
|
-
return I;
|
|
539
|
-
}, extendParams: function(t, e, a) {
|
|
540
|
-
var r = e.extensions[this.name];
|
|
541
|
-
t.color = new f.Color(1, 1, 1), t.opacity = 1;
|
|
542
|
-
var i = [];
|
|
543
|
-
if (Array.isArray(r.diffuseFactor)) {
|
|
544
|
-
var n = r.diffuseFactor;
|
|
545
|
-
t.color.fromArray(n), t.opacity = n[3];
|
|
546
|
-
}
|
|
547
|
-
if (r.diffuseTexture !== void 0 && i.push(a.assignTexture(t, "map", r.diffuseTexture)), t.emissive = new f.Color(0, 0, 0), t.glossiness = r.glossinessFactor !== void 0 ? r.glossinessFactor : 1, t.specular = new f.Color(1, 1, 1), Array.isArray(r.specularFactor) && t.specular.fromArray(r.specularFactor), r.specularGlossinessTexture !== void 0) {
|
|
548
|
-
var u = r.specularGlossinessTexture;
|
|
549
|
-
i.push(a.assignTexture(t, "glossinessMap", u)), i.push(a.assignTexture(t, "specularMap", u));
|
|
550
|
-
}
|
|
551
|
-
return Promise.all(i);
|
|
552
|
-
}, createMaterial: function(t) {
|
|
553
|
-
var e = new I(t);
|
|
554
|
-
return e.fog = !0, e.color = t.color, e.map = t.map === void 0 ? null : t.map, e.lightMap = null, e.lightMapIntensity = 1, e.aoMap = t.aoMap === void 0 ? null : t.aoMap, e.aoMapIntensity = 1, e.emissive = t.emissive, e.emissiveIntensity = 1, e.emissiveMap = t.emissiveMap === void 0 ? null : t.emissiveMap, e.bumpMap = t.bumpMap === void 0 ? null : t.bumpMap, e.bumpScale = 1, e.normalMap = t.normalMap === void 0 ? null : t.normalMap, e.normalMapType = f.TangentSpaceNormalMap, t.normalScale && (e.normalScale = t.normalScale), e.displacementMap = null, e.displacementScale = 1, e.displacementBias = 0, e.specularMap = t.specularMap === void 0 ? null : t.specularMap, e.specular = t.specular, e.glossinessMap = t.glossinessMap === void 0 ? null : t.glossinessMap, e.glossiness = t.glossiness, e.alphaMap = null, e.envMap = t.envMap === void 0 ? null : t.envMap, e.envMapIntensity = 1, e.refractionRatio = 0.98, e;
|
|
555
|
-
} };
|
|
556
|
-
}
|
|
557
|
-
function Z() {
|
|
558
|
-
this.name = l.KHR_MESH_QUANTIZATION;
|
|
559
|
-
}
|
|
560
|
-
function q(t, e, a, r) {
|
|
561
|
-
f.Interpolant.call(this, t, e, a, r);
|
|
562
|
-
}
|
|
563
|
-
K.prototype.decodePrimitive = function(t, e) {
|
|
564
|
-
var a = this.json, r = this.dracoLoader, i = t.extensions[this.name].bufferView, n = t.extensions[this.name].attributes, u = {}, o = {}, h = {};
|
|
565
|
-
for (var d in n) {
|
|
566
|
-
var _ = ne[d] || d.toLowerCase();
|
|
567
|
-
u[_] = n[d];
|
|
568
|
-
}
|
|
569
|
-
for (d in t.attributes)
|
|
570
|
-
if (_ = ne[d] || d.toLowerCase(), n[d] !== void 0) {
|
|
571
|
-
var v = a.accessors[t.attributes[d]], b = Q[v.componentType];
|
|
572
|
-
h[_] = b, o[_] = v.normalized === !0;
|
|
573
|
-
}
|
|
574
|
-
return e.getDependency("bufferView", i).then(function(A) {
|
|
575
|
-
return new Promise(function(L) {
|
|
576
|
-
r.decodeDracoFile(A, function(w) {
|
|
577
|
-
for (var j in w.attributes) {
|
|
578
|
-
var k = w.attributes[j], F = o[j];
|
|
579
|
-
F !== void 0 && (k.normalized = F);
|
|
580
|
-
}
|
|
581
|
-
L(w);
|
|
582
|
-
}, u, h);
|
|
583
|
-
});
|
|
584
|
-
});
|
|
585
|
-
}, V.prototype.extendTexture = function(t, e) {
|
|
586
|
-
return t = t.clone(), e.offset !== void 0 && t.offset.fromArray(e.offset), e.rotation !== void 0 && (t.rotation = e.rotation), e.scale !== void 0 && t.repeat.fromArray(e.scale), e.texCoord !== void 0 && console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.'), t.needsUpdate = !0, t;
|
|
587
|
-
}, I.prototype = Object.create(f.MeshStandardMaterial.prototype), I.prototype.constructor = I, I.prototype.copy = function(t) {
|
|
588
|
-
return f.MeshStandardMaterial.prototype.copy.call(this, t), this.specularMap = t.specularMap, this.specular.copy(t.specular), this.glossinessMap = t.glossinessMap, this.glossiness = t.glossiness, delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this;
|
|
589
|
-
}, q.prototype = Object.create(f.Interpolant.prototype), q.prototype.constructor = q, q.prototype.copySampleValue_ = function(t) {
|
|
590
|
-
for (var e = this.resultBuffer, a = this.sampleValues, r = this.valueSize, i = t * r * 3 + r, n = 0; n !== r; n++)
|
|
591
|
-
e[n] = a[i + n];
|
|
592
|
-
return e;
|
|
593
|
-
}, q.prototype.beforeStart_ = q.prototype.copySampleValue_, q.prototype.afterEnd_ = q.prototype.copySampleValue_, q.prototype.interpolate_ = function(t, e, a, r) {
|
|
594
|
-
for (var i = this.resultBuffer, n = this.sampleValues, u = this.valueSize, o = 2 * u, h = 3 * u, d = r - e, _ = (a - e) / d, v = _ * _, b = v * _, A = t * h, L = A - h, w = -2 * b + 3 * v, j = b - v, k = 1 - w, F = j - v + _, X = 0; X !== u; X++) {
|
|
595
|
-
var fe = n[L + X + u], ie = n[L + X + o] * d, ee = n[A + X + u], pe = n[A + X] * d;
|
|
596
|
-
i[X] = k * fe + F * ie + w * ee + j * pe;
|
|
597
|
-
}
|
|
598
|
-
return i;
|
|
599
|
-
};
|
|
600
|
-
var W = 0, te = 1, re = 2, he = 3, le = 4, ce = 5, ue = 6, Q = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }, ae = { 9728: f.NearestFilter, 9729: f.LinearFilter, 9984: f.NearestMipmapNearestFilter, 9985: f.LinearMipmapNearestFilter, 9986: f.NearestMipmapLinearFilter, 9987: f.LinearMipmapLinearFilter }, D = { 33071: f.ClampToEdgeWrapping, 33648: f.MirroredRepeatWrapping, 10497: f.RepeatWrapping }, se = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, ne = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv2", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }, s = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }, c = { CUBICSPLINE: void 0, LINEAR: f.InterpolateLinear, STEP: f.InterpolateDiscrete }, p = "OPAQUE", m = "MASK", T = "BLEND", g = { "image/png": f.RGBAFormat, "image/jpeg": f.RGBFormat };
|
|
601
|
-
function x(t, e) {
|
|
602
|
-
return typeof t != "string" || t === "" ? "" : (/^https?:\/\//i.test(e) && /^\//.test(t) && (e = e.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(t) || /^data:.*,.*$/i.test(t) || /^blob:.*$/i.test(t) ? t : e + t);
|
|
603
|
-
}
|
|
604
|
-
function H(t, e, a) {
|
|
605
|
-
for (var r in a.extensions)
|
|
606
|
-
t[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = a.extensions[r]);
|
|
607
|
-
}
|
|
608
|
-
function Y(t, e) {
|
|
609
|
-
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(t.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
610
|
-
}
|
|
611
|
-
function P(t, e) {
|
|
612
|
-
if (t.updateMorphTargets(), e.weights !== void 0)
|
|
613
|
-
for (var a = 0, r = e.weights.length; a < r; a++)
|
|
614
|
-
t.morphTargetInfluences[a] = e.weights[a];
|
|
615
|
-
if (e.extras && Array.isArray(e.extras.targetNames)) {
|
|
616
|
-
var i = e.extras.targetNames;
|
|
617
|
-
if (t.morphTargetInfluences.length === i.length)
|
|
618
|
-
for (t.morphTargetDictionary = {}, a = 0, r = i.length; a < r; a++)
|
|
619
|
-
t.morphTargetDictionary[i[a]] = a;
|
|
620
|
-
else
|
|
621
|
-
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
function $(t) {
|
|
625
|
-
for (var e = "", a = Object.keys(t).sort(), r = 0, i = a.length; r < i; r++)
|
|
626
|
-
e += a[r] + ":" + t[a[r]] + ";";
|
|
627
|
-
return e;
|
|
628
|
-
}
|
|
629
|
-
function G(t, e, a) {
|
|
630
|
-
this.json = t || {}, this.extensions = e || {}, this.options = a || {}, this.cache = new M(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.textureLoader = new f.TextureLoader(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.fileLoader = new f.FileLoader(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
631
|
-
}
|
|
632
|
-
function J(t, e, a) {
|
|
633
|
-
var r = e.attributes, i = [];
|
|
634
|
-
function n(d, _) {
|
|
635
|
-
return a.getDependency("accessor", d).then(function(v) {
|
|
636
|
-
t.setAttribute(_, v);
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
for (var u in r) {
|
|
640
|
-
var o = ne[u] || u.toLowerCase();
|
|
641
|
-
o in t.attributes || i.push(n(r[u], o));
|
|
642
|
-
}
|
|
643
|
-
if (e.indices !== void 0 && !t.index) {
|
|
644
|
-
var h = a.getDependency("accessor", e.indices).then(function(d) {
|
|
645
|
-
t.setIndex(d);
|
|
646
|
-
});
|
|
647
|
-
i.push(h);
|
|
648
|
-
}
|
|
649
|
-
return Y(t, e), function(d, _, v) {
|
|
650
|
-
var b = _.attributes, A = new f.Box3();
|
|
651
|
-
if (b.POSITION !== void 0) {
|
|
652
|
-
var L = (ie = v.json.accessors[b.POSITION]).min, w = ie.max;
|
|
653
|
-
if (L !== void 0 && w !== void 0) {
|
|
654
|
-
A.set(new f.Vector3(L[0], L[1], L[2]), new f.Vector3(w[0], w[1], w[2]));
|
|
655
|
-
var j = _.targets;
|
|
656
|
-
if (j !== void 0) {
|
|
657
|
-
for (var k = new f.Vector3(), F = new f.Vector3(), X = 0, fe = j.length; X < fe; X++) {
|
|
658
|
-
var ie, ee = j[X];
|
|
659
|
-
ee.POSITION !== void 0 && (L = (ie = v.json.accessors[ee.POSITION]).min, w = ie.max, L !== void 0 && w !== void 0 ? (F.setX(Math.max(Math.abs(L[0]), Math.abs(w[0]))), F.setY(Math.max(Math.abs(L[1]), Math.abs(w[1]))), F.setZ(Math.max(Math.abs(L[2]), Math.abs(w[2]))), k.max(F)) : console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."));
|
|
660
|
-
}
|
|
661
|
-
A.expandByVector(k);
|
|
662
|
-
}
|
|
663
|
-
d.boundingBox = A;
|
|
664
|
-
var pe = new f.Sphere();
|
|
665
|
-
A.getCenter(pe.center), pe.radius = A.min.distanceTo(A.max) / 2, d.boundingSphere = pe;
|
|
666
|
-
} else
|
|
667
|
-
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
668
|
-
}
|
|
669
|
-
}(t, e, a), Promise.all(i).then(function() {
|
|
670
|
-
return e.targets !== void 0 ? function(d, _, v) {
|
|
671
|
-
for (var b = !1, A = !1, L = 0, w = _.length; L < w && ((F = _[L]).POSITION !== void 0 && (b = !0), F.NORMAL !== void 0 && (A = !0), !b || !A); L++)
|
|
672
|
-
;
|
|
673
|
-
if (!b && !A)
|
|
674
|
-
return Promise.resolve(d);
|
|
675
|
-
var j = [], k = [];
|
|
676
|
-
for (L = 0, w = _.length; L < w; L++) {
|
|
677
|
-
var F = _[L];
|
|
678
|
-
if (b) {
|
|
679
|
-
var X = F.POSITION !== void 0 ? v.getDependency("accessor", F.POSITION) : d.attributes.position;
|
|
680
|
-
j.push(X);
|
|
681
|
-
}
|
|
682
|
-
A && (X = F.NORMAL !== void 0 ? v.getDependency("accessor", F.NORMAL) : d.attributes.normal, k.push(X));
|
|
683
|
-
}
|
|
684
|
-
return Promise.all([Promise.all(j), Promise.all(k)]).then(function(fe) {
|
|
685
|
-
var ie = fe[0], ee = fe[1];
|
|
686
|
-
return b && (d.morphAttributes.position = ie), A && (d.morphAttributes.normal = ee), d.morphTargetsRelative = !0, d;
|
|
687
|
-
});
|
|
688
|
-
}(t, e.targets, a) : t;
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
function me(t, e) {
|
|
692
|
-
var a = t.getIndex();
|
|
693
|
-
if (a === null) {
|
|
694
|
-
var r = [], i = t.getAttribute("position");
|
|
695
|
-
if (i === void 0)
|
|
696
|
-
return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), t;
|
|
697
|
-
for (var n = 0; n < i.count; n++)
|
|
698
|
-
r.push(n);
|
|
699
|
-
t.setIndex(r), a = t.getIndex();
|
|
700
|
-
}
|
|
701
|
-
var u = a.count - 2, o = [];
|
|
702
|
-
if (e === f.TriangleFanDrawMode)
|
|
703
|
-
for (n = 1; n <= u; n++)
|
|
704
|
-
o.push(a.getX(0)), o.push(a.getX(n)), o.push(a.getX(n + 1));
|
|
705
|
-
else
|
|
706
|
-
for (n = 0; n < u; n++)
|
|
707
|
-
n % 2 == 0 ? (o.push(a.getX(n)), o.push(a.getX(n + 1)), o.push(a.getX(n + 2))) : (o.push(a.getX(n + 2)), o.push(a.getX(n + 1)), o.push(a.getX(n)));
|
|
708
|
-
o.length / 3 !== u && console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
709
|
-
var h = t.clone();
|
|
710
|
-
return h.setIndex(o), h;
|
|
711
|
-
}
|
|
712
|
-
return G.prototype.parse = function(t, e) {
|
|
713
|
-
var a = this, r = this.json, i = this.extensions;
|
|
714
|
-
this.cache.removeAll(), this.markDefs(), Promise.all([this.getDependencies("scene"), this.getDependencies("animation"), this.getDependencies("camera")]).then(function(n) {
|
|
715
|
-
var u = { scene: n[0][r.scene || 0], scenes: n[0], animations: n[1], cameras: n[2], asset: r.asset, parser: a, userData: {} };
|
|
716
|
-
H(i, u, r), Y(u, r), t(u);
|
|
717
|
-
}).catch(e);
|
|
718
|
-
}, G.prototype.markDefs = function() {
|
|
719
|
-
for (var t = this.json.nodes || [], e = this.json.skins || [], a = this.json.meshes || [], r = {}, i = {}, n = 0, u = e.length; n < u; n++)
|
|
720
|
-
for (var o = e[n].joints, h = 0, d = o.length; h < d; h++)
|
|
721
|
-
t[o[h]].isBone = !0;
|
|
722
|
-
for (var _ = 0, v = t.length; _ < v; _++) {
|
|
723
|
-
var b = t[_];
|
|
724
|
-
b.mesh !== void 0 && (r[b.mesh] === void 0 && (r[b.mesh] = i[b.mesh] = 0), r[b.mesh]++, b.skin !== void 0 && (a[b.mesh].isSkinnedMesh = !0));
|
|
725
|
-
}
|
|
726
|
-
this.json.meshReferences = r, this.json.meshUses = i;
|
|
727
|
-
}, G.prototype.getDependency = function(t, e) {
|
|
728
|
-
var a = t + ":" + e, r = this.cache.get(a);
|
|
729
|
-
if (!r) {
|
|
730
|
-
switch (t) {
|
|
731
|
-
case "scene":
|
|
732
|
-
r = this.loadScene(e);
|
|
733
|
-
break;
|
|
734
|
-
case "node":
|
|
735
|
-
r = this.loadNode(e);
|
|
736
|
-
break;
|
|
737
|
-
case "mesh":
|
|
738
|
-
r = this.loadMesh(e);
|
|
739
|
-
break;
|
|
740
|
-
case "accessor":
|
|
741
|
-
r = this.loadAccessor(e);
|
|
742
|
-
break;
|
|
743
|
-
case "bufferView":
|
|
744
|
-
r = this.loadBufferView(e);
|
|
745
|
-
break;
|
|
746
|
-
case "buffer":
|
|
747
|
-
r = this.loadBuffer(e);
|
|
748
|
-
break;
|
|
749
|
-
case "material":
|
|
750
|
-
r = this.loadMaterial(e);
|
|
751
|
-
break;
|
|
752
|
-
case "texture":
|
|
753
|
-
r = this.loadTexture(e);
|
|
754
|
-
break;
|
|
755
|
-
case "skin":
|
|
756
|
-
r = this.loadSkin(e);
|
|
757
|
-
break;
|
|
758
|
-
case "animation":
|
|
759
|
-
r = this.loadAnimation(e);
|
|
760
|
-
break;
|
|
761
|
-
case "camera":
|
|
762
|
-
r = this.loadCamera(e);
|
|
763
|
-
break;
|
|
764
|
-
case "light":
|
|
765
|
-
r = this.extensions[l.KHR_LIGHTS_PUNCTUAL].loadLight(e);
|
|
766
|
-
break;
|
|
767
|
-
default:
|
|
768
|
-
throw new Error("Unknown type: " + t);
|
|
769
|
-
}
|
|
770
|
-
this.cache.add(a, r);
|
|
771
|
-
}
|
|
772
|
-
return r;
|
|
773
|
-
}, G.prototype.getDependencies = function(t) {
|
|
774
|
-
var e = this.cache.get(t);
|
|
775
|
-
if (!e) {
|
|
776
|
-
var a = this, r = this.json[t + (t === "mesh" ? "es" : "s")] || [];
|
|
777
|
-
e = Promise.all(r.map(function(i, n) {
|
|
778
|
-
return a.getDependency(t, n);
|
|
779
|
-
})), this.cache.add(t, e);
|
|
780
|
-
}
|
|
781
|
-
return e;
|
|
782
|
-
}, G.prototype.loadBuffer = function(t) {
|
|
783
|
-
var e = this.json.buffers[t], a = this.fileLoader;
|
|
784
|
-
if (e.type && e.type !== "arraybuffer")
|
|
785
|
-
throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
|
|
786
|
-
if (e.uri === void 0 && t === 0)
|
|
787
|
-
return Promise.resolve(this.extensions[l.KHR_BINARY_GLTF].body);
|
|
788
|
-
var r = this.options;
|
|
789
|
-
return new Promise(function(i, n) {
|
|
790
|
-
a.load(x(e.uri, r.path), i, void 0, function() {
|
|
791
|
-
n(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'));
|
|
792
|
-
});
|
|
793
|
-
});
|
|
794
|
-
}, G.prototype.loadBufferView = function(t) {
|
|
795
|
-
var e = this.json.bufferViews[t];
|
|
796
|
-
return this.getDependency("buffer", e.buffer).then(function(a) {
|
|
797
|
-
var r = e.byteLength || 0, i = e.byteOffset || 0;
|
|
798
|
-
return a.slice(i, i + r);
|
|
799
|
-
});
|
|
800
|
-
}, G.prototype.loadAccessor = function(t) {
|
|
801
|
-
var e = this, a = this.json, r = this.json.accessors[t];
|
|
802
|
-
if (r.bufferView === void 0 && r.sparse === void 0)
|
|
803
|
-
return Promise.resolve(null);
|
|
804
|
-
var i = [];
|
|
805
|
-
return r.bufferView !== void 0 ? i.push(this.getDependency("bufferView", r.bufferView)) : i.push(null), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(n) {
|
|
806
|
-
var u, o, h = n[0], d = se[r.type], _ = Q[r.componentType], v = _.BYTES_PER_ELEMENT, b = v * d, A = r.byteOffset || 0, L = r.bufferView !== void 0 ? a.bufferViews[r.bufferView].byteStride : void 0, w = r.normalized === !0;
|
|
807
|
-
if (L && L !== b) {
|
|
808
|
-
var j = Math.floor(A / L), k = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + j + ":" + r.count, F = e.cache.get(k);
|
|
809
|
-
F || (u = new _(h, j * L, r.count * L / v), F = new f.InterleavedBuffer(u, L / v), e.cache.add(k, F)), o = new f.InterleavedBufferAttribute(F, d, A % L / v, w);
|
|
810
|
-
} else
|
|
811
|
-
u = h === null ? new _(r.count * d) : new _(h, A, r.count * d), o = new f.BufferAttribute(u, d, w);
|
|
812
|
-
if (r.sparse !== void 0) {
|
|
813
|
-
var X = se.SCALAR, fe = Q[r.sparse.indices.componentType], ie = r.sparse.indices.byteOffset || 0, ee = r.sparse.values.byteOffset || 0, pe = new fe(n[1], ie, r.sparse.count * X), de = new _(n[2], ee, r.sparse.count * d);
|
|
814
|
-
h !== null && (o = new f.BufferAttribute(o.array.slice(), o.itemSize, o.normalized));
|
|
815
|
-
for (var ve = 0, Se = pe.length; ve < Se; ve++) {
|
|
816
|
-
var ye = pe[ve];
|
|
817
|
-
if (o.setX(ye, de[ve * d]), d >= 2 && o.setY(ye, de[ve * d + 1]), d >= 3 && o.setZ(ye, de[ve * d + 2]), d >= 4 && o.setW(ye, de[ve * d + 3]), d >= 5)
|
|
818
|
-
throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
return o;
|
|
822
|
-
});
|
|
823
|
-
}, G.prototype.loadTexture = function(t) {
|
|
824
|
-
var e, a = this, r = this.json, i = this.options, n = this.textureLoader, u = self.URL || self.webkitURL, o = r.textures[t], h = o.extensions || {}, d = (e = h[l.MSFT_TEXTURE_DDS] ? r.images[h[l.MSFT_TEXTURE_DDS].source] : r.images[o.source]).uri, _ = !1;
|
|
825
|
-
return e.bufferView !== void 0 && (d = a.getDependency("bufferView", e.bufferView).then(function(v) {
|
|
826
|
-
_ = !0;
|
|
827
|
-
var b = new Blob([v], { type: e.mimeType });
|
|
828
|
-
return d = u.createObjectURL(b);
|
|
829
|
-
})), Promise.resolve(d).then(function(v) {
|
|
830
|
-
var b = i.manager.getHandler(v);
|
|
831
|
-
return b || (b = h[l.MSFT_TEXTURE_DDS] ? a.extensions[l.MSFT_TEXTURE_DDS].ddsLoader : n), new Promise(function(A, L) {
|
|
832
|
-
b.load(x(v, i.path), A, void 0, L);
|
|
833
|
-
});
|
|
834
|
-
}).then(function(v) {
|
|
835
|
-
_ === !0 && u.revokeObjectURL(d), v.flipY = !1, o.name && (v.name = o.name), e.mimeType in g && (v.format = g[e.mimeType]);
|
|
836
|
-
var b = (r.samplers || {})[o.sampler] || {};
|
|
837
|
-
return v.magFilter = ae[b.magFilter] || f.LinearFilter, v.minFilter = ae[b.minFilter] || f.LinearMipmapLinearFilter, v.wrapS = D[b.wrapS] || f.RepeatWrapping, v.wrapT = D[b.wrapT] || f.RepeatWrapping, a.associations.set(v, { type: "textures", index: t }), v;
|
|
838
|
-
});
|
|
839
|
-
}, G.prototype.assignTexture = function(t, e, a) {
|
|
840
|
-
var r = this;
|
|
841
|
-
return this.getDependency("texture", a.index).then(function(i) {
|
|
842
|
-
if (!i.isCompressedTexture)
|
|
843
|
-
switch (e) {
|
|
844
|
-
case "aoMap":
|
|
845
|
-
case "emissiveMap":
|
|
846
|
-
case "metalnessMap":
|
|
847
|
-
case "normalMap":
|
|
848
|
-
case "roughnessMap":
|
|
849
|
-
i.format = f.RGBFormat;
|
|
850
|
-
}
|
|
851
|
-
if (a.texCoord === void 0 || a.texCoord == 0 || e === "aoMap" && a.texCoord == 1 || console.warn("THREE.GLTFLoader: Custom UV set " + a.texCoord + " for texture " + e + " not yet supported."), r.extensions[l.KHR_TEXTURE_TRANSFORM]) {
|
|
852
|
-
var n = a.extensions !== void 0 ? a.extensions[l.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
853
|
-
if (n) {
|
|
854
|
-
var u = this.associations.get(i);
|
|
855
|
-
i = r.extensions[l.KHR_TEXTURE_TRANSFORM].extendTexture(i, n), this.associations.set(i, u);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
t[e] = i;
|
|
859
|
-
});
|
|
860
|
-
}, G.prototype.assignFinalMaterial = function(t) {
|
|
861
|
-
var e = t.geometry, a = t.material, r = e.attributes.tangent !== void 0, i = e.attributes.color !== void 0, n = e.attributes.normal === void 0, u = t.isSkinnedMesh === !0, o = Object.keys(e.morphAttributes).length > 0, h = o && e.morphAttributes.normal !== void 0;
|
|
862
|
-
if (t.isPoints) {
|
|
863
|
-
var d = "PointsMaterial:" + a.uuid, _ = this.cache.get(d);
|
|
864
|
-
_ || (_ = new f.PointsMaterial(), f.Material.prototype.copy.call(_, a), _.color.copy(a.color), _.map = a.map, _.sizeAttenuation = !1, this.cache.add(d, _)), a = _;
|
|
865
|
-
} else if (t.isLine) {
|
|
866
|
-
d = "LineBasicMaterial:" + a.uuid;
|
|
867
|
-
var v = this.cache.get(d);
|
|
868
|
-
v || (v = new f.LineBasicMaterial(), f.Material.prototype.copy.call(v, a), v.color.copy(a.color), this.cache.add(d, v)), a = v;
|
|
869
|
-
}
|
|
870
|
-
if (r || i || n || u || o) {
|
|
871
|
-
d = "ClonedMaterial:" + a.uuid + ":", a.isGLTFSpecularGlossinessMaterial && (d += "specular-glossiness:"), u && (d += "skinning:"), r && (d += "vertex-tangents:"), i && (d += "vertex-colors:"), n && (d += "flat-shading:"), o && (d += "morph-targets:"), h && (d += "morph-normals:");
|
|
872
|
-
var b = this.cache.get(d);
|
|
873
|
-
b || (b = a.clone(), u && (b.skinning = !0), r && (b.vertexTangents = !0), i && (b.vertexColors = !0), n && (b.flatShading = !0), o && (b.morphTargets = !0), h && (b.morphNormals = !0), this.cache.add(d, b), this.associations.set(b, this.associations.get(a))), a = b;
|
|
874
|
-
}
|
|
875
|
-
a.aoMap && e.attributes.uv2 === void 0 && e.attributes.uv !== void 0 && e.setAttribute("uv2", e.attributes.uv), a.normalScale && !r && (a.normalScale.y = -a.normalScale.y), a.clearcoatNormalScale && !r && (a.clearcoatNormalScale.y = -a.clearcoatNormalScale.y), t.material = a;
|
|
876
|
-
}, G.prototype.loadMaterial = function(t) {
|
|
877
|
-
var e, a = this, r = this.json, i = this.extensions, n = r.materials[t], u = {}, o = n.extensions || {}, h = [];
|
|
878
|
-
if (o[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) {
|
|
879
|
-
var d = i[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];
|
|
880
|
-
e = d.getMaterialType(), h.push(d.extendParams(u, n, a));
|
|
881
|
-
} else if (o[l.KHR_MATERIALS_UNLIT]) {
|
|
882
|
-
var _ = i[l.KHR_MATERIALS_UNLIT];
|
|
883
|
-
e = _.getMaterialType(), h.push(_.extendParams(u, n, a));
|
|
884
|
-
} else {
|
|
885
|
-
e = f.MeshStandardMaterial;
|
|
886
|
-
var v = n.pbrMetallicRoughness || {};
|
|
887
|
-
if (u.color = new f.Color(1, 1, 1), u.opacity = 1, Array.isArray(v.baseColorFactor)) {
|
|
888
|
-
var b = v.baseColorFactor;
|
|
889
|
-
u.color.fromArray(b), u.opacity = b[3];
|
|
890
|
-
}
|
|
891
|
-
v.baseColorTexture !== void 0 && h.push(a.assignTexture(u, "map", v.baseColorTexture)), u.metalness = v.metallicFactor !== void 0 ? v.metallicFactor : 1, u.roughness = v.roughnessFactor !== void 0 ? v.roughnessFactor : 1, v.metallicRoughnessTexture !== void 0 && (h.push(a.assignTexture(u, "metalnessMap", v.metallicRoughnessTexture)), h.push(a.assignTexture(u, "roughnessMap", v.metallicRoughnessTexture)));
|
|
892
|
-
}
|
|
893
|
-
n.doubleSided === !0 && (u.side = f.DoubleSide);
|
|
894
|
-
var A = n.alphaMode || p;
|
|
895
|
-
if (A === T ? (u.transparent = !0, u.depthWrite = !1) : (u.transparent = !1, A === m && (u.alphaTest = n.alphaCutoff !== void 0 ? n.alphaCutoff : 0.5)), n.normalTexture !== void 0 && e !== f.MeshBasicMaterial && (h.push(a.assignTexture(u, "normalMap", n.normalTexture)), u.normalScale = new f.Vector2(1, 1), n.normalTexture.scale !== void 0 && u.normalScale.set(n.normalTexture.scale, n.normalTexture.scale)), n.occlusionTexture !== void 0 && e !== f.MeshBasicMaterial && (h.push(a.assignTexture(u, "aoMap", n.occlusionTexture)), n.occlusionTexture.strength !== void 0 && (u.aoMapIntensity = n.occlusionTexture.strength)), n.emissiveFactor !== void 0 && e !== f.MeshBasicMaterial && (u.emissive = new f.Color().fromArray(n.emissiveFactor)), n.emissiveTexture !== void 0 && e !== f.MeshBasicMaterial && h.push(a.assignTexture(u, "emissiveMap", n.emissiveTexture)), o[l.KHR_MATERIALS_CLEARCOAT]) {
|
|
896
|
-
var L = i[l.KHR_MATERIALS_CLEARCOAT];
|
|
897
|
-
e = L.getMaterialType(), h.push(L.extendParams(u, { extensions: o }, a));
|
|
898
|
-
}
|
|
899
|
-
return Promise.all(h).then(function() {
|
|
900
|
-
var w;
|
|
901
|
-
return w = e === I ? i[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(u) : new e(u), n.name && (w.name = n.name), w.map && (w.map.encoding = f.sRGBEncoding), w.emissiveMap && (w.emissiveMap.encoding = f.sRGBEncoding), Y(w, n), a.associations.set(w, { type: "materials", index: t }), n.extensions && H(i, w, n), w;
|
|
902
|
-
});
|
|
903
|
-
}, G.prototype.loadGeometries = function(t) {
|
|
904
|
-
var e = this, a = this.extensions, r = this.primitiveCache;
|
|
905
|
-
function i(L) {
|
|
906
|
-
return a[l.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(L, e).then(function(w) {
|
|
907
|
-
return J(w, L, e);
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
for (var n, u, o = [], h = 0, d = t.length; h < d; h++) {
|
|
911
|
-
var _, v = t[h], b = (u = void 0, (u = (n = v).extensions && n.extensions[l.KHR_DRACO_MESH_COMPRESSION]) ? "draco:" + u.bufferView + ":" + u.indices + ":" + $(u.attributes) : n.indices + ":" + $(n.attributes) + ":" + n.mode), A = r[b];
|
|
912
|
-
A ? o.push(A.promise) : (_ = v.extensions && v.extensions[l.KHR_DRACO_MESH_COMPRESSION] ? i(v) : J(new f.BufferGeometry(), v, e), r[b] = { primitive: v, promise: _ }, o.push(_));
|
|
913
|
-
}
|
|
914
|
-
return Promise.all(o);
|
|
915
|
-
}, G.prototype.loadMesh = function(t) {
|
|
916
|
-
for (var e, a = this, r = this.json.meshes[t], i = r.primitives, n = [], u = 0, o = i.length; u < o; u++) {
|
|
917
|
-
var h = i[u].material === void 0 ? ((e = this.cache).DefaultMaterial === void 0 && (e.DefaultMaterial = new f.MeshStandardMaterial({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: !1, depthTest: !0, side: f.FrontSide })), e.DefaultMaterial) : this.getDependency("material", i[u].material);
|
|
918
|
-
n.push(h);
|
|
919
|
-
}
|
|
920
|
-
return n.push(a.loadGeometries(i)), Promise.all(n).then(function(d) {
|
|
921
|
-
for (var _ = d.slice(0, d.length - 1), v = d[d.length - 1], b = [], A = 0, L = v.length; A < L; A++) {
|
|
922
|
-
var w, j = v[A], k = i[A], F = _[A];
|
|
923
|
-
if (k.mode === le || k.mode === ce || k.mode === ue || k.mode === void 0)
|
|
924
|
-
(w = r.isSkinnedMesh === !0 ? new f.SkinnedMesh(j, F) : new f.Mesh(j, F)).isSkinnedMesh !== !0 || w.geometry.attributes.skinWeight.normalized || w.normalizeSkinWeights(), k.mode === ce ? w.geometry = me(w.geometry, f.TriangleStripDrawMode) : k.mode === ue && (w.geometry = me(w.geometry, f.TriangleFanDrawMode));
|
|
925
|
-
else if (k.mode === te)
|
|
926
|
-
w = new f.LineSegments(j, F);
|
|
927
|
-
else if (k.mode === he)
|
|
928
|
-
w = new f.Line(j, F);
|
|
929
|
-
else if (k.mode === re)
|
|
930
|
-
w = new f.LineLoop(j, F);
|
|
931
|
-
else {
|
|
932
|
-
if (k.mode !== W)
|
|
933
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + k.mode);
|
|
934
|
-
w = new f.Points(j, F);
|
|
935
|
-
}
|
|
936
|
-
Object.keys(w.geometry.morphAttributes).length > 0 && P(w, r), w.name = r.name || "mesh_" + t, v.length > 1 && (w.name += "_" + A), Y(w, r), a.assignFinalMaterial(w), b.push(w);
|
|
937
|
-
}
|
|
938
|
-
if (b.length === 1)
|
|
939
|
-
return b[0];
|
|
940
|
-
var X = new f.Group();
|
|
941
|
-
for (A = 0, L = b.length; A < L; A++)
|
|
942
|
-
X.add(b[A]);
|
|
943
|
-
return X;
|
|
944
|
-
});
|
|
945
|
-
}, G.prototype.loadCamera = function(t) {
|
|
946
|
-
var e, a = this.json.cameras[t], r = a[a.type];
|
|
947
|
-
if (r)
|
|
948
|
-
return a.type === "perspective" ? e = new f.PerspectiveCamera(f.MathUtils.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : a.type === "orthographic" && (e = new f.OrthographicCamera(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), a.name && (e.name = a.name), Y(e, a), Promise.resolve(e);
|
|
949
|
-
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
950
|
-
}, G.prototype.loadSkin = function(t) {
|
|
951
|
-
var e = this.json.skins[t], a = { joints: e.joints };
|
|
952
|
-
return e.inverseBindMatrices === void 0 ? Promise.resolve(a) : this.getDependency("accessor", e.inverseBindMatrices).then(function(r) {
|
|
953
|
-
return a.inverseBindMatrices = r, a;
|
|
954
|
-
});
|
|
955
|
-
}, G.prototype.loadAnimation = function(t) {
|
|
956
|
-
for (var e = this.json.animations[t], a = [], r = [], i = [], n = [], u = [], o = 0, h = e.channels.length; o < h; o++) {
|
|
957
|
-
var d = e.channels[o], _ = e.samplers[d.sampler], v = d.target, b = v.node !== void 0 ? v.node : v.id, A = e.parameters !== void 0 ? e.parameters[_.input] : _.input, L = e.parameters !== void 0 ? e.parameters[_.output] : _.output;
|
|
958
|
-
a.push(this.getDependency("node", b)), r.push(this.getDependency("accessor", A)), i.push(this.getDependency("accessor", L)), n.push(_), u.push(v);
|
|
959
|
-
}
|
|
960
|
-
return Promise.all([Promise.all(a), Promise.all(r), Promise.all(i), Promise.all(n), Promise.all(u)]).then(function(w) {
|
|
961
|
-
for (var j = w[0], k = w[1], F = w[2], X = w[3], fe = w[4], ie = [], ee = 0, pe = j.length; ee < pe; ee++) {
|
|
962
|
-
var de = j[ee], ve = k[ee], Se = F[ee], ye = X[ee], Le = fe[ee];
|
|
963
|
-
if (de !== void 0) {
|
|
964
|
-
var Re;
|
|
965
|
-
switch (de.updateMatrix(), de.matrixAutoUpdate = !0, s[Le.path]) {
|
|
966
|
-
case s.weights:
|
|
967
|
-
Re = f.NumberKeyframeTrack;
|
|
968
|
-
break;
|
|
969
|
-
case s.rotation:
|
|
970
|
-
Re = f.QuaternionKeyframeTrack;
|
|
971
|
-
break;
|
|
972
|
-
case s.position:
|
|
973
|
-
case s.scale:
|
|
974
|
-
default:
|
|
975
|
-
Re = f.VectorKeyframeTrack;
|
|
976
|
-
}
|
|
977
|
-
var Ge = de.name ? de.name : de.uuid, ke = ye.interpolation !== void 0 ? c[ye.interpolation] : f.InterpolateLinear, Me = [];
|
|
978
|
-
s[Le.path] === s.weights ? de.traverse(function(be) {
|
|
979
|
-
be.isMesh === !0 && be.morphTargetInfluences && Me.push(be.name ? be.name : be.uuid);
|
|
980
|
-
}) : Me.push(Ge);
|
|
981
|
-
var ge = Se.array;
|
|
982
|
-
if (Se.normalized) {
|
|
983
|
-
var we;
|
|
984
|
-
if (ge.constructor === Int8Array)
|
|
985
|
-
we = 1 / 127;
|
|
986
|
-
else if (ge.constructor === Uint8Array)
|
|
987
|
-
we = 1 / 255;
|
|
988
|
-
else if (ge.constructor == Int16Array)
|
|
989
|
-
we = 1 / 32767;
|
|
990
|
-
else {
|
|
991
|
-
if (ge.constructor !== Uint16Array)
|
|
992
|
-
throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");
|
|
993
|
-
we = 1 / 65535;
|
|
994
|
-
}
|
|
995
|
-
for (var Ce = new Float32Array(ge.length), _e = 0, Ee = ge.length; _e < Ee; _e++)
|
|
996
|
-
Ce[_e] = ge[_e] * we;
|
|
997
|
-
ge = Ce;
|
|
998
|
-
}
|
|
999
|
-
for (_e = 0, Ee = Me.length; _e < Ee; _e++) {
|
|
1000
|
-
var xe = new Re(Me[_e] + "." + s[Le.path], ve.array, ge, ke);
|
|
1001
|
-
ye.interpolation === "CUBICSPLINE" && (xe.createInterpolant = function(be) {
|
|
1002
|
-
return new q(this.times, this.values, this.getValueSize() / 3, be);
|
|
1003
|
-
}, xe.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), ie.push(xe);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
var Ne = e.name ? e.name : "animation_" + t;
|
|
1008
|
-
return new f.AnimationClip(Ne, void 0, ie);
|
|
1009
|
-
});
|
|
1010
|
-
}, G.prototype.loadNode = function(t) {
|
|
1011
|
-
var e, a = this.json, r = this.extensions, i = this, n = a.meshReferences, u = a.meshUses, o = a.nodes[t];
|
|
1012
|
-
return (e = [], o.mesh !== void 0 && e.push(i.getDependency("mesh", o.mesh).then(function(h) {
|
|
1013
|
-
var d;
|
|
1014
|
-
if (n[o.mesh] > 1) {
|
|
1015
|
-
var _ = u[o.mesh]++;
|
|
1016
|
-
(d = h.clone()).name += "_instance_" + _;
|
|
1017
|
-
} else
|
|
1018
|
-
d = h;
|
|
1019
|
-
return o.weights !== void 0 && d.traverse(function(v) {
|
|
1020
|
-
if (v.isMesh)
|
|
1021
|
-
for (var b = 0, A = o.weights.length; b < A; b++)
|
|
1022
|
-
v.morphTargetInfluences[b] = o.weights[b];
|
|
1023
|
-
}), d;
|
|
1024
|
-
})), o.camera !== void 0 && e.push(i.getDependency("camera", o.camera)), o.extensions && o.extensions[l.KHR_LIGHTS_PUNCTUAL] && o.extensions[l.KHR_LIGHTS_PUNCTUAL].light !== void 0 && e.push(i.getDependency("light", o.extensions[l.KHR_LIGHTS_PUNCTUAL].light)), Promise.all(e)).then(function(h) {
|
|
1025
|
-
var d;
|
|
1026
|
-
if ((d = o.isBone === !0 ? new f.Bone() : h.length > 1 ? new f.Group() : h.length === 1 ? h[0] : new f.Object3D()) !== h[0])
|
|
1027
|
-
for (var _ = 0, v = h.length; _ < v; _++)
|
|
1028
|
-
d.add(h[_]);
|
|
1029
|
-
if (o.name && (d.userData.name = o.name, d.name = f.PropertyBinding.sanitizeNodeName(o.name)), Y(d, o), o.extensions && H(r, d, o), o.matrix !== void 0) {
|
|
1030
|
-
var b = new f.Matrix4();
|
|
1031
|
-
b.fromArray(o.matrix), d.applyMatrix4(b);
|
|
1032
|
-
} else
|
|
1033
|
-
o.translation !== void 0 && d.position.fromArray(o.translation), o.rotation !== void 0 && d.quaternion.fromArray(o.rotation), o.scale !== void 0 && d.scale.fromArray(o.scale);
|
|
1034
|
-
return i.associations.set(d, { type: "nodes", index: t }), d;
|
|
1035
|
-
});
|
|
1036
|
-
}, G.prototype.loadScene = function() {
|
|
1037
|
-
function t(e, a, r, i) {
|
|
1038
|
-
var n = r.nodes[e];
|
|
1039
|
-
return i.getDependency("node", e).then(function(u) {
|
|
1040
|
-
return n.skin === void 0 ? u : i.getDependency("skin", n.skin).then(function(h) {
|
|
1041
|
-
for (var d = [], _ = 0, v = (o = h).joints.length; _ < v; _++)
|
|
1042
|
-
d.push(i.getDependency("node", o.joints[_]));
|
|
1043
|
-
return Promise.all(d);
|
|
1044
|
-
}).then(function(h) {
|
|
1045
|
-
return u.traverse(function(d) {
|
|
1046
|
-
if (d.isMesh) {
|
|
1047
|
-
for (var _ = [], v = [], b = 0, A = h.length; b < A; b++) {
|
|
1048
|
-
var L = h[b];
|
|
1049
|
-
if (L) {
|
|
1050
|
-
_.push(L);
|
|
1051
|
-
var w = new f.Matrix4();
|
|
1052
|
-
o.inverseBindMatrices !== void 0 && w.fromArray(o.inverseBindMatrices.array, 16 * b), v.push(w);
|
|
1053
|
-
} else
|
|
1054
|
-
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', o.joints[b]);
|
|
1055
|
-
}
|
|
1056
|
-
d.bind(new f.Skeleton(_, v), d.matrixWorld);
|
|
1057
|
-
}
|
|
1058
|
-
}), u;
|
|
1059
|
-
});
|
|
1060
|
-
var o;
|
|
1061
|
-
}).then(function(u) {
|
|
1062
|
-
a.add(u);
|
|
1063
|
-
var o = [];
|
|
1064
|
-
if (n.children)
|
|
1065
|
-
for (var h = n.children, d = 0, _ = h.length; d < _; d++) {
|
|
1066
|
-
var v = h[d];
|
|
1067
|
-
o.push(t(v, u, r, i));
|
|
1068
|
-
}
|
|
1069
|
-
return Promise.all(o);
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
return function(e) {
|
|
1073
|
-
var a = this.json, r = this.extensions, i = this.json.scenes[e], n = new f.Group();
|
|
1074
|
-
i.name && (n.name = i.name), Y(n, i), i.extensions && H(r, n, i);
|
|
1075
|
-
for (var u = i.nodes || [], o = [], h = 0, d = u.length; h < d; h++)
|
|
1076
|
-
o.push(t(u[h], n, a, this));
|
|
1077
|
-
return Promise.all(o).then(function() {
|
|
1078
|
-
return n;
|
|
1079
|
-
});
|
|
1080
|
-
};
|
|
1081
|
-
}(), y;
|
|
1082
|
-
}(), oe = function(y) {
|
|
1083
|
-
f.Loader.call(this, y), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = { position: "POSITION", normal: "NORMAL", color: "COLOR", uv: "TEX_COORD" }, this.defaultAttributeTypes = { position: "Float32Array", normal: "Float32Array", color: "Float32Array", uv: "Float32Array" };
|
|
1084
|
-
};
|
|
1085
|
-
oe.prototype = Object.assign(Object.create(f.Loader.prototype), { constructor: oe, setDecoderPath: function(y) {
|
|
1086
|
-
return this.decoderPath = y, this;
|
|
1087
|
-
}, setDecoderConfig: function(y) {
|
|
1088
|
-
return this.decoderConfig = y, this;
|
|
1089
|
-
}, setWorkerLimit: function(y) {
|
|
1090
|
-
return this.workerLimit = y, this;
|
|
1091
|
-
}, setVerbosity: function() {
|
|
1092
|
-
console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.");
|
|
1093
|
-
}, setDrawMode: function() {
|
|
1094
|
-
console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.");
|
|
1095
|
-
}, setSkipDequantization: function() {
|
|
1096
|
-
console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.");
|
|
1097
|
-
}, load: function(y, M, l, S) {
|
|
1098
|
-
var R = new f.FileLoader(this.manager);
|
|
1099
|
-
R.setPath(this.path), R.setResponseType("arraybuffer"), this.crossOrigin === "use-credentials" && R.setWithCredentials(!0), R.load(y, (O) => {
|
|
1100
|
-
var N = { attributeIDs: this.defaultAttributeIDs, attributeTypes: this.defaultAttributeTypes, useUniqueIDs: !1 };
|
|
1101
|
-
this.decodeGeometry(O, N).then(M).catch(S);
|
|
1102
|
-
}, l, S);
|
|
1103
|
-
}, decodeDracoFile: function(y, M, l, S) {
|
|
1104
|
-
var R = { attributeIDs: l || this.defaultAttributeIDs, attributeTypes: S || this.defaultAttributeTypes, useUniqueIDs: !!l };
|
|
1105
|
-
this.decodeGeometry(y, R).then(M);
|
|
1106
|
-
}, decodeGeometry: function(y, M) {
|
|
1107
|
-
for (var l in M.attributeTypes) {
|
|
1108
|
-
var S = M.attributeTypes[l];
|
|
1109
|
-
S.BYTES_PER_ELEMENT !== void 0 && (M.attributeTypes[l] = S.name);
|
|
1110
|
-
}
|
|
1111
|
-
var R, O = JSON.stringify(M);
|
|
1112
|
-
if (oe.taskCache.has(y)) {
|
|
1113
|
-
var N = oe.taskCache.get(y);
|
|
1114
|
-
if (N.key === O)
|
|
1115
|
-
return N.promise;
|
|
1116
|
-
if (y.byteLength === 0)
|
|
1117
|
-
throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.");
|
|
1118
|
-
}
|
|
1119
|
-
var B = this.workerNextTaskID++, U = y.byteLength, C = this._getWorker(B, U).then((E) => (R = E, new Promise((K, V) => {
|
|
1120
|
-
R._callbacks[B] = { resolve: K, reject: V }, R.postMessage({ type: "decode", id: B, taskConfig: M, buffer: y }, [y]);
|
|
1121
|
-
}))).then((E) => this._createGeometry(E.geometry));
|
|
1122
|
-
return C.catch(() => !0).then(() => {
|
|
1123
|
-
R && B && this._releaseTask(R, B);
|
|
1124
|
-
}), oe.taskCache.set(y, { key: O, promise: C }), C;
|
|
1125
|
-
}, _createGeometry: function(y) {
|
|
1126
|
-
var M = new f.BufferGeometry();
|
|
1127
|
-
y.index && M.setIndex(new f.BufferAttribute(y.index.array, 1));
|
|
1128
|
-
for (var l = 0; l < y.attributes.length; l++) {
|
|
1129
|
-
var S = y.attributes[l], R = S.name, O = S.array, N = S.itemSize;
|
|
1130
|
-
M.setAttribute(R, new f.BufferAttribute(O, N));
|
|
1131
|
-
}
|
|
1132
|
-
return M;
|
|
1133
|
-
}, _loadLibrary: function(y, M) {
|
|
1134
|
-
var l = new f.FileLoader(this.manager);
|
|
1135
|
-
return l.setPath(this.decoderPath), l.setResponseType(M), new Promise((S, R) => {
|
|
1136
|
-
l.load(y, S, void 0, R);
|
|
1137
|
-
});
|
|
1138
|
-
}, preload: function() {
|
|
1139
|
-
return this._initDecoder(), this;
|
|
1140
|
-
}, _initDecoder: function() {
|
|
1141
|
-
if (this.decoderPending)
|
|
1142
|
-
return this.decoderPending;
|
|
1143
|
-
var y = typeof WebAssembly != "object" || this.decoderConfig.type === "js", M = [];
|
|
1144
|
-
return y ? M.push(this._loadLibrary("draco_decoder.js", "text")) : (M.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), M.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(M).then((l) => {
|
|
1145
|
-
var S = l[0];
|
|
1146
|
-
y || (this.decoderConfig.wasmBinary = l[1]);
|
|
1147
|
-
var R = oe.DRACOWorker.toString(), O = ["/* draco decoder */", S, "", "/* worker */", R.substring(R.indexOf("{") + 1, R.lastIndexOf("}"))].join(`
|
|
1148
|
-
`);
|
|
1149
|
-
this.workerSourceURL = URL.createObjectURL(new Blob([O]));
|
|
1150
|
-
}), this.decoderPending;
|
|
1151
|
-
}, _getWorker: function(y, M) {
|
|
1152
|
-
return this._initDecoder().then(() => {
|
|
1153
|
-
var l;
|
|
1154
|
-
return this.workerPool.length < this.workerLimit ? ((l = new Worker(this.workerSourceURL))._callbacks = {}, l._taskCosts = {}, l._taskLoad = 0, l.postMessage({ type: "init", decoderConfig: this.decoderConfig }), l.onmessage = function(S) {
|
|
1155
|
-
var R = S.data;
|
|
1156
|
-
switch (R.type) {
|
|
1157
|
-
case "decode":
|
|
1158
|
-
l._callbacks[R.id].resolve(R);
|
|
1159
|
-
break;
|
|
1160
|
-
case "error":
|
|
1161
|
-
l._callbacks[R.id].reject(R);
|
|
1162
|
-
break;
|
|
1163
|
-
default:
|
|
1164
|
-
console.error('THREE.DRACOLoader: Unexpected message, "' + R.type + '"');
|
|
1165
|
-
}
|
|
1166
|
-
}, this.workerPool.push(l)) : this.workerPool.sort(function(S, R) {
|
|
1167
|
-
return S._taskLoad > R._taskLoad ? -1 : 1;
|
|
1168
|
-
}), (l = this.workerPool[this.workerPool.length - 1])._taskCosts[y] = M, l._taskLoad += M, l;
|
|
1169
|
-
});
|
|
1170
|
-
}, _releaseTask: function(y, M) {
|
|
1171
|
-
y._taskLoad -= y._taskCosts[M], delete y._callbacks[M], delete y._taskCosts[M];
|
|
1172
|
-
}, debug: function() {
|
|
1173
|
-
console.log("Task load: ", this.workerPool.map((y) => y._taskLoad));
|
|
1174
|
-
}, dispose: function() {
|
|
1175
|
-
for (var y = 0; y < this.workerPool.length; ++y)
|
|
1176
|
-
this.workerPool[y].terminate();
|
|
1177
|
-
return this.workerPool.length = 0, this;
|
|
1178
|
-
} }), oe.DRACOWorker = function() {
|
|
1179
|
-
var y, M;
|
|
1180
|
-
function l(S, R, O, N, B, U) {
|
|
1181
|
-
var C, E, K = U.num_components(), V = O.num_points() * K;
|
|
1182
|
-
switch (B) {
|
|
1183
|
-
case Float32Array:
|
|
1184
|
-
C = new S.DracoFloat32Array(), R.GetAttributeFloatForAllPoints(O, U, C), E = new Float32Array(V);
|
|
1185
|
-
break;
|
|
1186
|
-
case Int8Array:
|
|
1187
|
-
C = new S.DracoInt8Array(), R.GetAttributeInt8ForAllPoints(O, U, C), E = new Int8Array(V);
|
|
1188
|
-
break;
|
|
1189
|
-
case Int16Array:
|
|
1190
|
-
C = new S.DracoInt16Array(), R.GetAttributeInt16ForAllPoints(O, U, C), E = new Int16Array(V);
|
|
1191
|
-
break;
|
|
1192
|
-
case Int32Array:
|
|
1193
|
-
C = new S.DracoInt32Array(), R.GetAttributeInt32ForAllPoints(O, U, C), E = new Int32Array(V);
|
|
1194
|
-
break;
|
|
1195
|
-
case Uint8Array:
|
|
1196
|
-
C = new S.DracoUInt8Array(), R.GetAttributeUInt8ForAllPoints(O, U, C), E = new Uint8Array(V);
|
|
1197
|
-
break;
|
|
1198
|
-
case Uint16Array:
|
|
1199
|
-
C = new S.DracoUInt16Array(), R.GetAttributeUInt16ForAllPoints(O, U, C), E = new Uint16Array(V);
|
|
1200
|
-
break;
|
|
1201
|
-
case Uint32Array:
|
|
1202
|
-
C = new S.DracoUInt32Array(), R.GetAttributeUInt32ForAllPoints(O, U, C), E = new Uint32Array(V);
|
|
1203
|
-
break;
|
|
1204
|
-
default:
|
|
1205
|
-
throw new Error("THREE.DRACOLoader: Unexpected attribute type.");
|
|
1206
|
-
}
|
|
1207
|
-
for (var I = 0; I < V; I++)
|
|
1208
|
-
E[I] = C.GetValue(I);
|
|
1209
|
-
return S.destroy(C), { name: N, array: E, itemSize: K };
|
|
1210
|
-
}
|
|
1211
|
-
onmessage = function(S) {
|
|
1212
|
-
var R = S.data;
|
|
1213
|
-
switch (R.type) {
|
|
1214
|
-
case "init":
|
|
1215
|
-
y = R.decoderConfig, M = new Promise(function(B) {
|
|
1216
|
-
y.onModuleLoaded = function(U) {
|
|
1217
|
-
B({ draco: U });
|
|
1218
|
-
}, DracoDecoderModule(y);
|
|
1219
|
-
});
|
|
1220
|
-
break;
|
|
1221
|
-
case "decode":
|
|
1222
|
-
var O = R.buffer, N = R.taskConfig;
|
|
1223
|
-
M.then((B) => {
|
|
1224
|
-
var U = B.draco, C = new U.Decoder(), E = new U.DecoderBuffer();
|
|
1225
|
-
E.Init(new Int8Array(O), O.byteLength);
|
|
1226
|
-
try {
|
|
1227
|
-
var K = function(I, z, Z, q) {
|
|
1228
|
-
var W, te, re = q.attributeIDs, he = q.attributeTypes, le = z.GetEncodedGeometryType(Z);
|
|
1229
|
-
if (le === I.TRIANGULAR_MESH)
|
|
1230
|
-
W = new I.Mesh(), te = z.DecodeBufferToMesh(Z, W);
|
|
1231
|
-
else {
|
|
1232
|
-
if (le !== I.POINT_CLOUD)
|
|
1233
|
-
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
1234
|
-
W = new I.PointCloud(), te = z.DecodeBufferToPointCloud(Z, W);
|
|
1235
|
-
}
|
|
1236
|
-
if (!te.ok() || W.ptr === 0)
|
|
1237
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " + te.error_msg());
|
|
1238
|
-
var ce = { index: null, attributes: [] };
|
|
1239
|
-
for (var ue in re) {
|
|
1240
|
-
var Q, ae, D = self[he[ue]];
|
|
1241
|
-
if (q.useUniqueIDs)
|
|
1242
|
-
ae = re[ue], Q = z.GetAttributeByUniqueId(W, ae);
|
|
1243
|
-
else {
|
|
1244
|
-
if ((ae = z.GetAttributeId(W, I[re[ue]])) === -1)
|
|
1245
|
-
continue;
|
|
1246
|
-
Q = z.GetAttribute(W, ae);
|
|
1247
|
-
}
|
|
1248
|
-
ce.attributes.push(l(I, z, W, ue, D, Q));
|
|
1249
|
-
}
|
|
1250
|
-
if (le === I.TRIANGULAR_MESH) {
|
|
1251
|
-
for (var se = W.num_faces(), ne = new Uint32Array(3 * se), s = new I.DracoInt32Array(), c = 0; c < se; ++c) {
|
|
1252
|
-
z.GetFaceFromMesh(W, c, s);
|
|
1253
|
-
for (var p = 0; p < 3; ++p)
|
|
1254
|
-
ne[3 * c + p] = s.GetValue(p);
|
|
1255
|
-
}
|
|
1256
|
-
ce.index = { array: ne, itemSize: 1 }, I.destroy(s);
|
|
1257
|
-
}
|
|
1258
|
-
return I.destroy(W), ce;
|
|
1259
|
-
}(U, C, E, N), V = K.attributes.map((I) => I.array.buffer);
|
|
1260
|
-
K.index && V.push(K.index.array.buffer), self.postMessage({ type: "decode", id: R.id, geometry: K }, V);
|
|
1261
|
-
} catch (I) {
|
|
1262
|
-
console.error(I), self.postMessage({ type: "error", id: R.id, error: I.message });
|
|
1263
|
-
} finally {
|
|
1264
|
-
U.destroy(E), U.destroy(C);
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
}, oe.taskCache = /* @__PURE__ */ new WeakMap(), oe.setDecoderPath = function() {
|
|
1270
|
-
console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.");
|
|
1271
|
-
}, oe.setDecoderConfig = function() {
|
|
1272
|
-
console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.");
|
|
1273
|
-
}, oe.releaseDecoderModule = function() {
|
|
1274
|
-
console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.");
|
|
1275
|
-
}, oe.getDecoderModule = function() {
|
|
1276
|
-
console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.");
|
|
1277
|
-
};
|
|
1278
|
-
var Ae = function(y) {
|
|
1279
|
-
f.CompressedTextureLoader.call(this, y);
|
|
1280
|
-
};
|
|
1281
|
-
Ae.prototype = Object.assign(Object.create(f.CompressedTextureLoader.prototype), { constructor: Ae, parse: function(y, M) {
|
|
1282
|
-
var l = { mipmaps: [], width: 0, height: 0, format: null, mipmapCount: 1 };
|
|
1283
|
-
function S(Q) {
|
|
1284
|
-
return Q.charCodeAt(0) + (Q.charCodeAt(1) << 8) + (Q.charCodeAt(2) << 16) + (Q.charCodeAt(3) << 24);
|
|
1285
|
-
}
|
|
1286
|
-
function R(Q, ae, D, se) {
|
|
1287
|
-
for (var ne = D * se * 4, s = new Uint8Array(Q, ae, ne), c = new Uint8Array(ne), p = 0, m = 0, T = 0; T < se; T++)
|
|
1288
|
-
for (var g = 0; g < D; g++) {
|
|
1289
|
-
var x = s[m], H = s[++m], Y = s[++m], P = s[++m];
|
|
1290
|
-
m++, c[p] = Y, c[++p] = H, c[++p] = x, c[++p] = P, p++;
|
|
1291
|
-
}
|
|
1292
|
-
return c;
|
|
1293
|
-
}
|
|
1294
|
-
var O, N = S("DXT1"), B = S("DXT3"), U = S("DXT5"), C = S("ETC1"), E = new Int32Array(y, 0, 31);
|
|
1295
|
-
if (E[0] !== 542327876)
|
|
1296
|
-
return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."), l;
|
|
1297
|
-
if (4 & !E[20])
|
|
1298
|
-
return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."), l;
|
|
1299
|
-
var K, V = E[21], I = !1;
|
|
1300
|
-
switch (V) {
|
|
1301
|
-
case N:
|
|
1302
|
-
O = 8, l.format = f.RGB_S3TC_DXT1_Format;
|
|
1303
|
-
break;
|
|
1304
|
-
case B:
|
|
1305
|
-
O = 16, l.format = f.RGBA_S3TC_DXT3_Format;
|
|
1306
|
-
break;
|
|
1307
|
-
case U:
|
|
1308
|
-
O = 16, l.format = f.RGBA_S3TC_DXT5_Format;
|
|
1309
|
-
break;
|
|
1310
|
-
case C:
|
|
1311
|
-
O = 8, l.format = f.RGB_ETC1_Format;
|
|
1312
|
-
break;
|
|
1313
|
-
default:
|
|
1314
|
-
if (!(E[22] === 32 && 16711680 & E[23] && 65280 & E[24] && 255 & E[25] && 4278190080 & E[26]))
|
|
1315
|
-
return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ", (K = V, String.fromCharCode(255 & K, K >> 8 & 255, K >> 16 & 255, K >> 24 & 255))), l;
|
|
1316
|
-
I = !0, O = 64, l.format = f.RGBAFormat;
|
|
1317
|
-
}
|
|
1318
|
-
l.mipmapCount = 1, 131072 & E[2] && M !== !1 && (l.mipmapCount = Math.max(1, E[7]));
|
|
1319
|
-
var z = E[28];
|
|
1320
|
-
if (l.isCubemap = !!(512 & z), l.isCubemap && (!(1024 & z) || !(2048 & z) || !(4096 & z) || !(8192 & z) || !(16384 & z) || !(32768 & z)))
|
|
1321
|
-
return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"), l;
|
|
1322
|
-
l.width = E[4], l.height = E[3];
|
|
1323
|
-
for (var Z = E[1] + 4, q = l.isCubemap ? 6 : 1, W = 0; W < q; W++)
|
|
1324
|
-
for (var te = l.width, re = l.height, he = 0; he < l.mipmapCount; he++) {
|
|
1325
|
-
if (I)
|
|
1326
|
-
var le = (ce = R(y, Z, te, re)).length;
|
|
1327
|
-
else {
|
|
1328
|
-
le = Math.max(4, te) / 4 * Math.max(4, re) / 4 * O;
|
|
1329
|
-
var ce = new Uint8Array(y, Z, le);
|
|
1330
|
-
}
|
|
1331
|
-
var ue = { data: ce, width: te, height: re };
|
|
1332
|
-
l.mipmaps.push(ue), Z += le, te = Math.max(te >> 1, 1), re = Math.max(re >> 1, 1);
|
|
1333
|
-
}
|
|
1334
|
-
return l;
|
|
1335
|
-
} });
|
|
1336
|
-
var Pe = function(y) {
|
|
1337
|
-
function M(l) {
|
|
1338
|
-
var S = y.call(this) || this;
|
|
1339
|
-
return S.needsRender = !0, l && l.children.length && S.add.apply(S, l.children), S.mixer = new Oe.AnimationMixer(S), S;
|
|
1340
|
-
}
|
|
1341
|
-
return Ue.__extends(M, y), M.prototype.clone = function() {
|
|
1342
|
-
var l = y.prototype.clone.call(this, !0), S = new Oe.AnimationMixer(l);
|
|
1343
|
-
return l.mixer = S, l.needsRender = !0, l;
|
|
1344
|
-
}, M;
|
|
1345
|
-
}(Oe.Group), Ve = function(y) {
|
|
1346
|
-
function M(l) {
|
|
1347
|
-
var S = y.call(this, l) || this;
|
|
1348
|
-
return S.ddsLoader = new Ae(l), S.dracoLoader = new oe(l), S.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/gltf/"), S;
|
|
1349
|
-
}
|
|
1350
|
-
return Ue.__extends(M, y), Object.defineProperty(M, "version", { get: function() {
|
|
1351
|
-
return "5.0.0-alpha.149";
|
|
1352
|
-
}, enumerable: !1, configurable: !0 }), M.prototype.load = function(l, S, R, O) {
|
|
1353
|
-
return y.prototype.load.call(this, l, S, R, O);
|
|
1354
|
-
}, M.prototype.parse = function(l, S, R, O) {
|
|
1355
|
-
return y.prototype.parse.call(this, l, S, function(N) {
|
|
1356
|
-
var B = new Pe(N.scene), U = N.scenes.map(function(C) {
|
|
1357
|
-
return C === N.scene ? B : new Pe(C);
|
|
1358
|
-
});
|
|
1359
|
-
R(Object.assign(N, { scene: B, scenes: U }));
|
|
1360
|
-
}, O);
|
|
1361
|
-
}, M;
|
|
1362
|
-
}(He);
|
|
1363
|
-
Te.DDSLoader = Ae, Te.DRACOLoader = oe, Fe = Te.GLTFLoader = Ve, Te.GLTFObject = Pe, Te.THREEGLTFLoader = He;
|
|
1364
|
-
function ze(y, M) {
|
|
1365
|
-
const l = new je.Vector3(3.8058113175002797, -1.4285810796152072, -4.748098691966687), S = y.modelUrl, R = new Fe();
|
|
1366
|
-
return new Promise((O, N) => {
|
|
1367
|
-
R.load(S, function(U) {
|
|
1368
|
-
const C = U.scene;
|
|
1369
|
-
C.traverse((E) => {
|
|
1370
|
-
E.material && (E.material.envMapIntensity = 0.5);
|
|
1371
|
-
}), M.add(C), C.position.copy(l), C.needsRender = !0, O(C);
|
|
1372
|
-
});
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
export {
|
|
1376
|
-
ze as default
|
|
1377
|
-
};
|