@realsee/dnalogel 3.69.6-alpha.4 → 3.69.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -3
- package/dist/components/AreaLabel/Assets/roomLabelBg.d.ts +0 -2
- package/dist/index.cjs.js +61 -61
- package/dist/index.js +3172 -3185
- package/dist/index.umd.js +53 -53
- package/docs/classes/AreaMakerPluginType.AreaMakerController.html +2 -2
- package/docs/classes/AreaMakerPluginType.AreaMakerItem.html +2 -2
- package/docs/classes/CSS3DRender.html +2 -2
- package/docs/classes/GuideLineItem.GuideLineItem.html +2 -2
- package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +2 -2
- package/docs/classes/ModelMakerPluginInstance.html +2 -2
- package/docs/classes/ModelMakerPluginType.ModelMakerBoxItem.html +2 -2
- package/docs/classes/ModelMakerPluginType.ModelMakerPolygonItem.html +2 -2
- package/docs/classes/ModelMakerPluginType.ModelMakerPrismItem.html +2 -2
- package/docs/classes/ModelRoomLabelController.html +2 -2
- package/docs/classes/MoveController.html +2 -2
- package/docs/classes/Object3DHelperController.html +2 -2
- package/docs/classes/PaintBrush.html +2 -2
- package/docs/classes/PanoMeasurePluginLine.html +2 -2
- package/docs/classes/PanoMeasurePluginModel.html +2 -2
- package/docs/classes/PanoMeasurePluginPoint.html +2 -2
- package/docs/classes/PanoMeasurePluginPolyline.html +2 -2
- package/docs/classes/PanoTagPluginController.html +2 -2
- package/docs/classes/Sculpt.html +2 -2
- package/docs/classes/Util.BetterTween.html +2 -2
- package/docs/classes/Util.FiveDomEvents.html +2 -2
- package/docs/classes/Util.FivePuppet.html +2 -2
- package/docs/classes/Util.Interval.html +2 -2
- package/docs/classes/Util.LegacyPointHelper.html +2 -2
- package/docs/classes/Util.LightTag.html +2 -2
- package/docs/classes/Util.LineSegments.html +2 -2
- package/docs/classes/Util.Magnifier.html +2 -2
- package/docs/classes/Util.Object3D.html +2 -2
- package/docs/classes/Util.PointDomHelper.html +2 -2
- package/docs/classes/Util.PointHelper.html +2 -2
- package/docs/classes/Util.PointSelector.html +2 -2
- package/docs/classes/Util.PointSelectorHelper.html +2 -2
- package/docs/classes/Util.Rectangle.html +2 -2
- package/docs/classes/Util.sculpt.BaseEditor.html +2 -2
- package/docs/classes/Util.sculpt.BoxMesh.html +2 -2
- package/docs/classes/Util.sculpt.BoxMeshEditor.html +2 -2
- package/docs/classes/Util.sculpt.CircleMesh.html +2 -2
- package/docs/classes/Util.sculpt.CircleMeshEditor.html +2 -2
- package/docs/classes/Util.sculpt.CircleWithEdgeMesh.html +2 -2
- package/docs/classes/Util.sculpt.CylinderMesh.html +2 -2
- package/docs/classes/Util.sculpt.CylinderMeshEditor.html +2 -2
- package/docs/classes/Util.sculpt.LineMesh.html +2 -2
- package/docs/classes/Util.sculpt.PointMesh.html +2 -2
- package/docs/classes/Util.sculpt.PolygonMesh.html +2 -2
- package/docs/classes/Util.sculpt.PrismMesh.html +2 -2
- package/docs/classes/Util.sculpt.PrismMeshEditor.html +2 -2
- package/docs/classes/Util.sculpt.RectangleMesh.html +2 -2
- package/docs/classes/Util.sculpt.RectangleMeshEditor.html +2 -2
- package/docs/classes/Util.sculpt.RectangleWithEdgeMesh.html +2 -2
- package/docs/classes/WalkController.html +2 -2
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/ContentType.html +2 -2
- package/docs/enums/DIRECTION.html +2 -2
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +2 -2
- package/docs/enums/DimensionType.html +2 -2
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +2 -2
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +2 -2
- package/docs/enums/PaintBrushTypeEnum.html +2 -2
- package/docs/enums/PointType.html +2 -2
- package/docs/enums/Rotation.html +2 -2
- package/docs/functions/AreaMakerPlugin.html +1 -1
- package/docs/functions/CSS3DRenderPlugin.html +1 -1
- package/docs/functions/CameraMovementPlugin.html +2 -2
- package/docs/functions/CruisePlugin.html +1 -1
- package/docs/functions/CurrentPanoImagePlugin.html +1 -1
- package/docs/functions/GuideLinePlugin.html +1 -1
- package/docs/functions/ItemLabelPlugin.html +1 -1
- package/docs/functions/MapviewFloorplanPlugin.html +1 -1
- package/docs/functions/MeasurePlugin.html +1 -1
- package/docs/functions/ModelChassisCompassPlugin.html +2 -2
- package/docs/functions/ModelEntryDoorGuidePlugin.html +2 -2
- package/docs/functions/ModelFloorplanPlugin.html +1 -1
- package/docs/functions/ModelItemLabelPlugin.html +1 -1
- package/docs/functions/ModelMakerPlugin.html +1 -1
- package/docs/functions/ModelRoomLabelPlugin.html +1 -1
- package/docs/functions/ModelTVVideoPlugin.html +1 -1
- package/docs/functions/ModelViewPlugin.html +2 -2
- package/docs/functions/MovePlugin.html +1 -1
- package/docs/functions/Object3DHelperPlugin.html +1 -1
- package/docs/functions/PanoCompassPlugin.html +1 -1
- package/docs/functions/PanoCursorRaycasterPlugin.html +2 -2
- package/docs/functions/PanoDoorLabelPlugin.html +1 -1
- package/docs/functions/PanoFloorplanRadarPlugin.html +1 -1
- package/docs/functions/PanoMeasurePlugin.html +1 -1
- package/docs/functions/PanoRulerPlugin.html +2 -2
- package/docs/functions/PanoRulerProPlugin.html +2 -2
- package/docs/functions/PanoSpatialTagPlugin.html +2 -2
- package/docs/functions/PanoTagPlugin.html +1 -1
- package/docs/functions/PanoVideoPlugin.html +2 -2
- package/docs/functions/PipelinePlugin.html +1 -1
- package/docs/functions/SculptPlugin.html +2 -2
- package/docs/functions/SculptPluginForFive.html +2 -2
- package/docs/functions/TopviewFloorplanPlugin.html +1 -1
- package/docs/functions/Util.awaitNextFrame.html +1 -1
- package/docs/functions/Util.blink.html +2 -2
- package/docs/functions/Util.bounding.html +1 -1
- package/docs/functions/Util.boundingBox.html +1 -1
- package/docs/functions/Util.boundingSphere.html +1 -1
- package/docs/functions/Util.boxVertex.html +2 -2
- package/docs/functions/Util.boxVertexes.html +1 -1
- package/docs/functions/Util.checkFiveModelLoaded.html +2 -2
- package/docs/functions/Util.convexHull.html +2 -2
- package/docs/functions/Util.equal.html +2 -2
- package/docs/functions/Util.fiveModelIsLoaded.html +2 -2
- package/docs/functions/Util.getCoordsFromClient.html +1 -1
- package/docs/functions/Util.getCoordsFromElement.html +1 -1
- package/docs/functions/Util.getFrameTime.html +2 -2
- package/docs/functions/Util.getIntersectFromRelativePosition.html +1 -1
- package/docs/functions/Util.getRaycasterFromFivePointer.html +1 -1
- package/docs/functions/Util.initialCSS3DRender.html +1 -1
- package/docs/functions/Util.inside.html +1 -1
- package/docs/functions/Util.isModelLike.html +1 -1
- package/docs/functions/Util.isNil.html +2 -2
- package/docs/functions/Util.isPanoramaLike.html +1 -1
- package/docs/functions/Util.lookObject.html +2 -2
- package/docs/functions/Util.lookPoint.html +2 -2
- package/docs/functions/Util.nextFrame.html +1 -1
- package/docs/functions/Util.notNil.html +2 -2
- package/docs/functions/Util.reblink.html +2 -2
- package/docs/functions/Util.replaceStaticPrefix.html +2 -2
- package/docs/functions/Util.requestAnimationFrameInterval.html +2 -2
- package/docs/functions/Util.sculpt.createBox.html +1 -1
- package/docs/functions/Util.sculpt.createCircle.html +1 -1
- package/docs/functions/Util.sculpt.createCylinder.html +1 -1
- package/docs/functions/Util.sculpt.createLine.html +2 -2
- package/docs/functions/Util.sculpt.createPoint.html +1 -1
- package/docs/functions/Util.sculpt.createPolygon.html +1 -1
- package/docs/functions/Util.sculpt.createPrism.html +1 -1
- package/docs/functions/Util.sculpt.createRectangle.html +2 -2
- package/docs/functions/Util.tag.html +1 -1
- package/docs/functions/Util.tweenProgress.html +1 -1
- package/docs/functions/Util.uuid.html +2 -2
- package/docs/functions/Util.waitFiveModelLoaded.html +2 -2
- package/docs/functions/Util.worldBounding.html +1 -1
- package/docs/functions/Util.worldBoundingBox.html +1 -1
- package/docs/functions/Util.worldBoundingSphere.html +1 -1
- package/docs/functions/createPolyline.html +2 -2
- package/docs/functions/pluginFlag.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.AnimeOptions.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.Config.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.EventMap.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.Params.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItem.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItemV1.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.ServerDataV1.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.ServerDataV2.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.ShowHideOptions.html +2 -2
- package/docs/interfaces/AreaMakerPluginType.State.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/ContentTypeMapInterface.html +2 -2
- package/docs/interfaces/CruisePluginTypes.Config.html +2 -2
- package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +2 -2
- package/docs/interfaces/CruisePluginTypes.EventMap.html +2 -2
- package/docs/interfaces/CruisePluginTypes.GuildLineConfig.html +2 -2
- package/docs/interfaces/CruisePluginTypes.MoveAction.html +2 -2
- package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +2 -2
- package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +2 -2
- package/docs/interfaces/CruisePluginTypes.PluginData.html +2 -2
- package/docs/interfaces/CruisePluginTypes.PluginServerData.html +2 -2
- package/docs/interfaces/CruisePluginTypes.PluginState.html +2 -2
- package/docs/interfaces/CurrentPanoImagePluginType.Config.html +2 -2
- package/docs/interfaces/CurrentPanoImagePluginType.EventMap.html +2 -2
- package/docs/interfaces/CurrentPanoImagePluginType.Params.html +2 -2
- package/docs/interfaces/CurrentPanoImagePluginType.ShowHideOptions.html +2 -2
- package/docs/interfaces/CurrentPanoImagePluginType.State.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +2 -2
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +2 -2
- package/docs/interfaces/FloorplanExtraObject.html +2 -2
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +2 -2
- package/docs/interfaces/FloorplanRoomLabelItem.html +2 -2
- package/docs/interfaces/FloorplanServerBounding.html +2 -2
- package/docs/interfaces/FloorplanServerComputedData.html +2 -2
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerDoorItem.html +2 -2
- package/docs/interfaces/FloorplanServerDoorPosition.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +2 -2
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +2 -2
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +2 -2
- package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +2 -2
- package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +2 -2
- package/docs/interfaces/GuideLinePluginType.EventMap.html +2 -2
- package/docs/interfaces/GuideLinePluginType.ExtraRouteData.html +2 -2
- package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +2 -2
- package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +2 -2
- package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +2 -2
- package/docs/interfaces/GuideLinePluginType.GuideLineMeshStyle.html +2 -2
- package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +2 -2
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +2 -2
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +2 -2
- package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +2 -2
- package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +1 -1
- package/docs/interfaces/GuideLinePluginType.PluginServerData.html +2 -2
- package/docs/interfaces/GuideLinePluginType.PluginState.html +2 -2
- package/docs/interfaces/GuideLinePluginType.Route.html +2 -2
- package/docs/interfaces/HelperOffset.html +2 -2
- package/docs/interfaces/ImagePlaneGroup.html +2 -2
- package/docs/interfaces/ItemLabelPluginData.html +2 -2
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +2 -2
- package/docs/interfaces/ItemLabelPluginParametersType.html +2 -2
- package/docs/interfaces/MinMax.html +2 -2
- package/docs/interfaces/ModelChassisCompassPluginData.html +2 -2
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +2 -2
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +2 -2
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +2 -2
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginData.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.BoxItemObjectData.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.EventMap.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.PrismItemObjectData.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.ServerBaseItem.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.ServerBoxItem.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.ServerData.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.ServerPrismItem.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.ServerTrianglesItem.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.State.html +2 -2
- package/docs/interfaces/ModelMakerPluginType.TrianglesItemObjectData.html +2 -2
- package/docs/interfaces/ModelRoomLabelPluginData.html +2 -2
- package/docs/interfaces/ModelTVVideoPluginData.html +2 -2
- package/docs/interfaces/ModelTVVideoPluginExportType.html +2 -2
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +2 -2
- package/docs/interfaces/ModelViewPluginExportType.html +2 -2
- package/docs/interfaces/Object3DHelperState.html +2 -2
- package/docs/interfaces/ObjectHelperControllers.html +2 -2
- package/docs/interfaces/PaintBrushAction.html +2 -2
- package/docs/interfaces/PaintBrushConfigs.html +2 -2
- package/docs/interfaces/PaintBrushState.html +2 -2
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +2 -2
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +2 -2
- package/docs/interfaces/PanoMeasurePluginLineJson.html +2 -2
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +2 -2
- package/docs/interfaces/PanoMeasurePluginPointJson.html +2 -2
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +2 -2
- package/docs/interfaces/PanoRulerPluginExportType.html +2 -2
- package/docs/interfaces/PanoRulerPluginOptions.html +2 -2
- package/docs/interfaces/PanoRulerPluginParameterType.html +2 -2
- package/docs/interfaces/PanoRulerProPluginExportType.html +2 -2
- package/docs/interfaces/PanoRulerProPluginOptions.html +2 -2
- package/docs/interfaces/PanoRulerProPluginParameterType.html +2 -2
- package/docs/interfaces/PanoRulerProPluginState.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +2 -2
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +2 -2
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +2 -2
- package/docs/interfaces/PluginEventMap.html +2 -2
- package/docs/interfaces/Point.html +2 -2
- package/docs/interfaces/Room.html +2 -2
- package/docs/interfaces/RoomInfo.html +2 -2
- package/docs/interfaces/RoomLabel.html +2 -2
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/Scissor.html +2 -2
- package/docs/interfaces/SculptConfig.html +2 -2
- package/docs/interfaces/State.html +2 -2
- package/docs/interfaces/TagCacheInterface.html +2 -2
- package/docs/interfaces/TagConfig.html +2 -2
- package/docs/interfaces/TagGLTFObjectGroup.html +2 -2
- package/docs/interfaces/TagIconUrl.html +2 -2
- package/docs/interfaces/TagObjectGroup.html +2 -2
- package/docs/interfaces/TagState.html +2 -2
- package/docs/interfaces/TagStyle.html +2 -2
- package/docs/interfaces/Tags.html +2 -2
- package/docs/interfaces/TemporaryState.html +2 -2
- package/docs/interfaces/Util.AnimeInstance.html +2 -2
- package/docs/interfaces/Util.BlinkAnimeOptions.html +2 -2
- package/docs/interfaces/Util.EventHandlerConfig.html +2 -2
- package/docs/interfaces/Util.FiveDomEvent.html +2 -2
- package/docs/interfaces/Util.FiveDomEventMap.html +2 -2
- package/docs/interfaces/Util.LegacyMouseGroupParameter.html +2 -2
- package/docs/interfaces/Util.MagnifierParameter.html +2 -2
- package/docs/interfaces/Util.MouseGroupParameter.html +2 -2
- package/docs/interfaces/Util.PointIntersection.html +2 -2
- package/docs/interfaces/Util.PointSelectorHelperConfig.html +2 -2
- package/docs/interfaces/Util.ReBlinkAnimeOptions.html +2 -2
- package/docs/modules/AreaMakerPluginType.html +2 -2
- package/docs/modules/CruisePluginTypes.html +2 -2
- package/docs/modules/CurrentPanoImagePluginType.html +2 -2
- package/docs/modules/GuideLineItem.html +2 -2
- package/docs/modules/GuideLineModeItem.html +2 -2
- package/docs/modules/GuideLinePluginType.html +2 -2
- package/docs/modules/ModelMakerPluginType.html +2 -2
- package/docs/modules/PanoVideoPluginType.html +2 -2
- package/docs/modules/SculptData.html +2 -2
- package/docs/modules/SculptType.html +2 -2
- package/docs/modules/Util.html +2 -2
- package/docs/modules/Util.sculpt.html +2 -2
- package/docs/modules.html +2 -2
- package/docs/types/AddObject3DHelperConfig.html +2 -2
- package/docs/types/AreaMakerPluginType.AreaMakerItemEventMap.html +2 -2
- package/docs/types/AreaMakerPluginType.ItemRenderer.html +1 -1
- package/docs/types/AreaMakerPluginType.PluginData.html +2 -2
- package/docs/types/AreaMakerPluginType.ServerData.html +2 -2
- package/docs/types/ArrayPosition.html +1 -1
- package/docs/types/AudioAppearance.html +1 -1
- package/docs/types/CSS3DRenderExportType.html +1 -1
- package/docs/types/CSS3DRenderPluginExportType.html +1 -1
- package/docs/types/CSS3DRenderPluginParameterType.html +1 -1
- package/docs/types/ClassFunctionParameters.html +1 -1
- package/docs/types/Color.html +1 -1
- package/docs/types/ContentTypeConfigKey.html +1 -1
- package/docs/types/ContentTypeConfigKeySplit.html +1 -1
- package/docs/types/ContentTypeMap.html +1 -1
- package/docs/types/Create3DDomContainerReturnType.html +1 -1
- package/docs/types/Create3DElementReturnType.html +1 -1
- package/docs/types/CruisePluginExportType.html +1 -1
- package/docs/types/CruisePluginTypes.CruiseData.html +2 -2
- package/docs/types/CruisePluginTypes.MoveEffect.html +1 -1
- package/docs/types/CurrentPanoImagePluginExportType.html +1 -1
- package/docs/types/DeprecatedMediaPlaneProperty.html +2 -2
- package/docs/types/DeprecatedTagProperty.html +2 -2
- package/docs/types/Direction-1.html +1 -1
- package/docs/types/Direction4.html +1 -1
- package/docs/types/ElementRenderer.html +2 -2
- package/docs/types/FloorplanRuleLabels.html +2 -2
- package/docs/types/FloorplanServerRuleLabels.html +1 -1
- package/docs/types/GuideLinePluginExportType.html +1 -1
- package/docs/types/GuideLinePluginType.GuideLineItem.html +2 -2
- package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +1 -1
- package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +1 -1
- package/docs/types/GuideLinePluginType.GuideLineStyle.html +2 -2
- package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +2 -2
- package/docs/types/GuideLinePluginType.PathItem.html +2 -2
- package/docs/types/GuideLinePluginType.PluginData.html +2 -2
- package/docs/types/GuideLinePluginType.RouteConfig.html +2 -2
- package/docs/types/HelperEventMap.html +1 -1
- package/docs/types/InternalHelperEventMap.html +1 -1
- package/docs/types/MapviewFloorplanPluginParameterType.html +1 -1
- package/docs/types/MapviewFloorplanPluginReturnType.html +1 -1
- package/docs/types/MeasureEndReason.html +1 -1
- package/docs/types/MeasurePluginConfig.html +2 -2
- package/docs/types/MediaData.html +2 -2
- package/docs/types/MediaStore.html +1 -1
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +1 -1
- package/docs/types/ModelFloorplanPluginParameterType.html +1 -1
- package/docs/types/ModelFloorplanPluginReturnType.html +1 -1
- package/docs/types/ModelId.html +1 -1
- package/docs/types/ModelMakerPluginType.ElementRenderer.html +1 -1
- package/docs/types/ModelMakerPluginType.ItemType.html +2 -2
- package/docs/types/ModelMakerPluginType.MarkerItem.html +1 -1
- package/docs/types/ModelMakerPluginType.ServerItem.html +2 -2
- package/docs/types/ModelRoomLabelPluginParameters.html +1 -1
- package/docs/types/ModelRoomLabelPluginReturnType.html +1 -1
- package/docs/types/MoveArgs.html +2 -2
- package/docs/types/MoveOpts.html +2 -2
- package/docs/types/Object3DHelperEventMap.html +1 -1
- package/docs/types/ObjectFit.html +1 -1
- package/docs/types/PaintBrushEventMap.html +1 -1
- package/docs/types/PanoCompassPluginData.html +1 -1
- package/docs/types/PanoCompassPluginExportType.html +1 -1
- package/docs/types/PanoCompassPluginParameterType.html +1 -1
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +1 -1
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +1 -1
- package/docs/types/PanoIndex.html +1 -1
- package/docs/types/PanoMeasurePluginEvent.html +1 -1
- package/docs/types/PanoMeasureReturnType.html +1 -1
- package/docs/types/PanoSpatialTagPluginId.html +1 -1
- package/docs/types/PanoTagPluginExportInterface.html +1 -1
- package/docs/types/PanoTagPluginParamsInterface.html +1 -1
- package/docs/types/PanoVideoPluginParameterType.html +1 -1
- package/docs/types/PanoVideoPluginReturnType.html +1 -1
- package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +2 -2
- package/docs/types/PipelinePluginParameterType.html +1 -1
- package/docs/types/PipelinePluginReturnType.html +1 -1
- package/docs/types/PlaneTag.html +2 -2
- package/docs/types/Point2DTag.html +2 -2
- package/docs/types/Point3DTag.html +2 -2
- package/docs/types/PointTagInstance.html +1 -1
- package/docs/types/Position.html +1 -1
- package/docs/types/PositionFrom.html +1 -1
- package/docs/types/RotateArgs.html +2 -2
- package/docs/types/RotateOpts.html +2 -2
- package/docs/types/RuleLabelsKey.html +1 -1
- package/docs/types/RuleLabelsValue.html +1 -1
- package/docs/types/ScaleCallback.html +1 -1
- package/docs/types/ScalePosition.html +2 -2
- package/docs/types/SculptData.BoxData.html +1 -1
- package/docs/types/SculptData.CircleData.html +1 -1
- package/docs/types/SculptData.CylinderData.html +1 -1
- package/docs/types/SculptData.PointData.html +1 -1
- package/docs/types/SculptData.PolygonData.html +1 -1
- package/docs/types/SculptData.PolylineData.html +1 -1
- package/docs/types/SculptData.PrismData.html +1 -1
- package/docs/types/SculptData.RectangleData.html +1 -1
- package/docs/types/SculptType.Theme.html +2 -2
- package/docs/types/StickType.html +1 -1
- package/docs/types/Tag.html +2 -2
- package/docs/types/Tag2D.html +2 -2
- package/docs/types/Tag3D.html +2 -2
- package/docs/types/TagClickParams.html +1 -1
- package/docs/types/TagConfigByKey.html +1 -1
- package/docs/types/TagContentType.html +1 -1
- package/docs/types/TagContentTypeMapping.html +1 -1
- package/docs/types/TagDimensionType.html +1 -1
- package/docs/types/TagElement.html +2 -2
- package/docs/types/TagEvents.html +1 -1
- package/docs/types/TagGLTFObject.html +1 -1
- package/docs/types/TagHooks.html +1 -1
- package/docs/types/TagId.html +1 -1
- package/docs/types/TagInstance.html +1 -1
- package/docs/types/TagPlacement.html +2 -2
- package/docs/types/TagPointType.html +2 -2
- package/docs/types/TagRendererMap.html +1 -1
- package/docs/types/TopviewFloorplanPluginParameterType.html +1 -1
- package/docs/types/TopviewFloorplanPluginReturnType.html +1 -1
- package/docs/types/Util.ActionIfNoIntersection.html +1 -1
- package/docs/types/Util.AdherePoint.html +2 -2
- package/docs/types/Util.PointSelectorConfig.html +1 -1
- package/docs/types/WorkCode.html +1 -1
- package/docs/variables/FLOOR_TYPE_MAP.html +2 -2
- package/docs/variables/PLUGIN.html +1 -1
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +2 -2
- package/docs/variables/ROOM_TYPE_MAP.html +2 -2
- package/docs/variables/Util.CURRENT_PANO_IMAGE_DEFAULT_IMAGE.html +2 -2
- package/docs/variables/Util.DEFAULT_STATIC_PREFIX.html +2 -2
- package/docs/variables/Util.DNALOGEL_DEFAULT_ASSETS.html +2 -2
- package/docs/variables/Util.ENTRY_DOOR_DEFAULT_IMAGE.html +2 -2
- package/docs/variables/Util.FLOORPLAN_DEFAULT_IMAGE.html +2 -2
- package/docs/variables/Util.GUIDELINE_DEFAULT_ARROW_TEXTURE.html +2 -2
- package/docs/variables/Util.GUIDELINE_WHITE_ARROW_TEXTURE.html +2 -2
- package/docs/variables/Util.MODEL_CHASSIS_COMPASS_DEFAULT_MODEL.html +2 -2
- package/docs/variables/Util.MODEL_ENTRY_DOOR_GUIDE_PLUGIN_DEFAULT_MODEL.html +2 -2
- package/docs/variables/Util.PANO_COMPASS_DEFAULT_IMAGE.html +2 -2
- package/docs/variables/Util.PANO_SPATIAL_TAG_BLUR_IMAGE.html +2 -2
- package/docs/variables/Util.PANO_TAG_DEFAULT_LINK_ICON.html +2 -2
- package/docs/variables/Util.animeMap.html +1 -1
- package/docs/variables/defaultGlobalConfig.html +1 -1
- package/docs/variables/itemLabelPluginServerParams.html +1 -1
- package/docs/variables/modelItemLabelPluginServerParams.html +1 -1
- package/docs/variables/modelRoomLabelPluginServerParams.html +1 -1
- package/libs/DigitalPerformancePlugin/controller/index.d.ts +224 -0
- package/libs/DigitalPerformancePlugin/controller/index.js +865 -0
- package/libs/DigitalPerformancePlugin/core/DigitalHuman.d.ts +41 -0
- package/libs/DigitalPerformancePlugin/core/DigitalHuman.js +174 -0
- package/libs/DigitalPerformancePlugin/core/DigitalPlayground.d.ts +33 -0
- package/libs/DigitalPerformancePlugin/core/DigitalPlayground.js +155 -0
- package/libs/DigitalPerformancePlugin/core/DigitalStateMachine.d.ts +143 -0
- package/libs/DigitalPerformancePlugin/core/DigitalStateMachine.js +153 -0
- package/libs/DigitalPerformancePlugin/core/Trace.d.ts +9 -0
- package/libs/DigitalPerformancePlugin/core/Trace.js +23 -0
- package/libs/DigitalPerformancePlugin/index.d.ts +11 -0
- package/libs/DigitalPerformancePlugin/index.js +17 -0
- package/libs/DigitalPerformancePlugin/mock.d.ts +70 -0
- package/libs/DigitalPerformancePlugin/mock.js +371 -0
- package/libs/DigitalPerformancePlugin/typings/index.d.ts +79 -0
- package/libs/DigitalPerformancePlugin/typings/index.js +1 -0
- package/libs/base/BasePlugin.js +1 -1
- package/libs/components/AreaLabel/Assets/roomLabelBg.d.ts +0 -2
- package/libs/components/AreaLabel/Assets/roomLabelBg.js +2 -3
- package/libs/components/AreaLabel/LabelItem.js +148 -161
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
var D = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var H = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var S = Object.getOwnPropertySymbols;
|
|
4
|
+
var I = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var v = (f, t, e) => t in f ? D(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e, E = (f, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
I.call(t, e) && v(f, e, t[e]);
|
|
8
|
+
if (S)
|
|
9
|
+
for (var e of S(t))
|
|
10
|
+
U.call(t, e) && v(f, e, t[e]);
|
|
11
|
+
return f;
|
|
12
|
+
}, x = (f, t) => k(f, H(t));
|
|
13
|
+
var P = (f, t, e) => (v(f, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var p = (f, t, e) => new Promise((i, s) => {
|
|
15
|
+
var o = (r) => {
|
|
16
|
+
try {
|
|
17
|
+
n(e.next(r));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
s(l);
|
|
20
|
+
}
|
|
21
|
+
}, a = (r) => {
|
|
22
|
+
try {
|
|
23
|
+
n(e.throw(r));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
s(l);
|
|
26
|
+
}
|
|
27
|
+
}, n = (r) => r.done ? i(r.value) : Promise.resolve(r.value).then(o, a);
|
|
28
|
+
n((e = e.apply(f, t)).next());
|
|
29
|
+
});
|
|
30
|
+
import { DigitalPlayground as R } from "../core/DigitalPlayground.js";
|
|
31
|
+
import { Vector3 as N } from "three";
|
|
32
|
+
import { convertMockToPlayer as z } from "../mock.js";
|
|
33
|
+
import { transformPosition as w } from "../../shared-utils/five/transformPosition.js";
|
|
34
|
+
import "@realsee/five/gltf-loader";
|
|
35
|
+
import "../core/DigitalHuman.js";
|
|
36
|
+
import "../core/DigitalStateMachine.js";
|
|
37
|
+
import "../core/Trace.js";
|
|
38
|
+
const L = "Dnalogel-DigitalPerformancePlugin";
|
|
39
|
+
class J {
|
|
40
|
+
constructor(t, e = {}) {
|
|
41
|
+
P(this, "five");
|
|
42
|
+
P(this, "playground");
|
|
43
|
+
P(this, "config");
|
|
44
|
+
P(this, "state");
|
|
45
|
+
P(this, "NAME");
|
|
46
|
+
// 全局进度条相关属性
|
|
47
|
+
P(this, "totalDurationCache", null);
|
|
48
|
+
P(this, "chapterTimeMapCache", null);
|
|
49
|
+
P(this, "progressListeners", /* @__PURE__ */ new Set());
|
|
50
|
+
P(this, "progressUpdateInterval", 100);
|
|
51
|
+
// 默认100ms更新一次
|
|
52
|
+
P(this, "progressUpdateTimer", null);
|
|
53
|
+
P(this, "_autoPlayOnNaturalEnd", !1);
|
|
54
|
+
// 新增:playing-players-changed 事件监听集合
|
|
55
|
+
P(this, "playingPlayersListeners", /* @__PURE__ */ new Set());
|
|
56
|
+
this.five = t, this.config = E({
|
|
57
|
+
autoPlay: !1,
|
|
58
|
+
loop: !1,
|
|
59
|
+
debug: !1
|
|
60
|
+
}, e), this.playground = new R(this.config.debug), this.state = {
|
|
61
|
+
enabled: !0,
|
|
62
|
+
playing: !1,
|
|
63
|
+
currentChapter: null,
|
|
64
|
+
currentScript: null,
|
|
65
|
+
continuousPlaying: !1,
|
|
66
|
+
playMode: "single"
|
|
67
|
+
}, this.NAME = L, this.config.debug, this.init();
|
|
68
|
+
}
|
|
69
|
+
init() {
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 加载剧本数据
|
|
73
|
+
*/
|
|
74
|
+
loadScript(t) {
|
|
75
|
+
return p(this, null, function* () {
|
|
76
|
+
try {
|
|
77
|
+
if (this.state.currentScript = t, this.playground.setScript(t), this.clearProgressCache(), this.config.debug, yield this.preloadResources(t), this.five && this.five.scene) {
|
|
78
|
+
yield new Promise((i) => requestAnimationFrame(i));
|
|
79
|
+
let e = 0;
|
|
80
|
+
if (t.chapters.forEach((i) => {
|
|
81
|
+
i.players.forEach((s) => {
|
|
82
|
+
if (s.type === "model") {
|
|
83
|
+
const o = this.getDigitalHuman(s.model, s.id);
|
|
84
|
+
o != null && o.model && (this.five.scene.add(o.model), e++);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}), e === 0)
|
|
88
|
+
throw new Error("没有模型被添加到场景中");
|
|
89
|
+
}
|
|
90
|
+
this.config.autoPlay && t.chapters.length > 0 && (yield this.playChapter(t.chapters[0]));
|
|
91
|
+
} catch (e) {
|
|
92
|
+
throw console.error(`${this.NAME} failed to load script:`, e), e;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 预加载资源
|
|
98
|
+
*/
|
|
99
|
+
preloadResources(t) {
|
|
100
|
+
return p(this, null, function* () {
|
|
101
|
+
const e = [], i = [], s = /* @__PURE__ */ new Set();
|
|
102
|
+
t.chapters.forEach((o) => {
|
|
103
|
+
o.players.forEach((a) => {
|
|
104
|
+
if (a.type === "model") {
|
|
105
|
+
const n = a;
|
|
106
|
+
e.push(n.model), i.push(a.id), n.keyframes.forEach((r) => {
|
|
107
|
+
r.animation && s.add(r.animation.url);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}), yield Promise.all([
|
|
112
|
+
this.playground.loadModels(e, i),
|
|
113
|
+
this.playground.loadAnimations(Array.from(s))
|
|
114
|
+
]), this.config.debug;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 播放指定章节
|
|
119
|
+
*/
|
|
120
|
+
playChapter(t) {
|
|
121
|
+
return p(this, null, function* () {
|
|
122
|
+
this.emitPlayingPlayersChanged();
|
|
123
|
+
try {
|
|
124
|
+
this.state.currentChapter = t, this.state.playing = !0, this.state.playMode = "single", this.config.debug, yield this.playground.playByChapter(t), this.state.playing = !1, this.config.debug;
|
|
125
|
+
} catch (e) {
|
|
126
|
+
throw console.error(`${this.NAME} failed to play chapter:`, e), this.state.playing = !1, e;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 播放指定章节(内部方法,用于连续播放)
|
|
132
|
+
*/
|
|
133
|
+
playChapterForContinuous(t) {
|
|
134
|
+
return p(this, null, function* () {
|
|
135
|
+
this.emitPlayingPlayersChanged();
|
|
136
|
+
try {
|
|
137
|
+
this.state.currentChapter = t, this.state.playing = !0, this.config.debug, yield this.playground.playByChapter(t), this.state.continuousPlaying && (this.state.playing = !0), yield new Promise((e) => setTimeout(e, 100)), this.config.debug;
|
|
138
|
+
} catch (e) {
|
|
139
|
+
throw console.error(`${this.NAME} failed to play chapter for continuous:`, e), this.state.playing = !1, e;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 播放指定章节(通过索引)
|
|
145
|
+
*/
|
|
146
|
+
playChapterByIndex(t) {
|
|
147
|
+
return p(this, null, function* () {
|
|
148
|
+
if (!this.state.currentScript)
|
|
149
|
+
throw new Error("No script loaded");
|
|
150
|
+
if (t < 0 || t >= this.state.currentScript.chapters.length)
|
|
151
|
+
throw new Error("Invalid chapter index");
|
|
152
|
+
yield this.playChapter(this.state.currentScript.chapters[t]);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 暂停播放
|
|
157
|
+
*/
|
|
158
|
+
pause() {
|
|
159
|
+
this.playground.pause(), this.state.playing = !1, this.state.continuousPlaying = !1, this.config.debug && console.log(`${this.NAME} paused in ${this.state.playMode} mode`);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* 继续播放
|
|
163
|
+
*/
|
|
164
|
+
continue() {
|
|
165
|
+
return p(this, null, function* () {
|
|
166
|
+
this._autoPlayOnNaturalEnd = !0;
|
|
167
|
+
try {
|
|
168
|
+
this.config.debug && console.log(`${this.NAME} continuing in ${this.state.playMode} mode`), this.state.playMode === "continuous" ? yield this.continueAllRemaining() : (this.state.currentChapter && this.state.currentChapter.players.forEach((t) => {
|
|
169
|
+
if (t.type === "model") {
|
|
170
|
+
const e = this.playground.getDigitalHuman(t.model, t.id);
|
|
171
|
+
e && e.continueAnimation();
|
|
172
|
+
}
|
|
173
|
+
}), this.state.playing = !0, this.config.debug && console.log(`${this.NAME} continued single chapter successfully`));
|
|
174
|
+
} catch (t) {
|
|
175
|
+
throw console.error(`${this.NAME} failed to continue:`, t), this.state.playing = !1, t;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 连续播放模式下的继续播放(从暂停位置继续播放所有剩余章节)
|
|
181
|
+
*/
|
|
182
|
+
continueAllRemaining() {
|
|
183
|
+
return p(this, null, function* () {
|
|
184
|
+
if (!this.state.currentScript || !this.state.currentChapter)
|
|
185
|
+
throw new Error("No script or chapter loaded");
|
|
186
|
+
const t = this.state.currentScript.chapters, e = t.findIndex((i) => i.name === this.state.currentChapter.name);
|
|
187
|
+
if (e === -1)
|
|
188
|
+
throw new Error("Current chapter not found in script");
|
|
189
|
+
this.state.continuousPlaying = !0;
|
|
190
|
+
try {
|
|
191
|
+
this.config.debug;
|
|
192
|
+
let i = this.getProgress();
|
|
193
|
+
console.log(`${this.NAME} [continueAllRemaining] current progress:`, i), this.emitPlayingPlayersChanged();
|
|
194
|
+
const s = i && i.currentTime >= 26e3 && i.currentTime <= 27e3, o = i && i.currentTime >= i.totalTime;
|
|
195
|
+
console.log(`${this.NAME} [continueAllRemaining] pause analysis:`, {
|
|
196
|
+
currentTime: i == null ? void 0 : i.currentTime,
|
|
197
|
+
totalTime: i == null ? void 0 : i.totalTime,
|
|
198
|
+
isCompleted: o,
|
|
199
|
+
isNearHardcodedPause: s
|
|
200
|
+
}), o ? (console.log(`${this.NAME} [continueAllRemaining] chapter already completed, restarting`), yield this.playChapterForContinuous(this.state.currentChapter), i = this.getProgress(), console.log(`${this.NAME} [continueAllRemaining] progress after restart:`, i)) : s ? (console.log(`${this.NAME} [continueAllRemaining] detected hardcoded pause, skipping to 27500ms`), this.state.currentChapter.players.filter((n) => n.type === "model").forEach((n) => {
|
|
201
|
+
const r = this.playground.getDigitalHuman(n.model, n.id);
|
|
202
|
+
r && (r.state.currentTime = 27500);
|
|
203
|
+
}), this.state.currentChapter.players.forEach((n) => {
|
|
204
|
+
if (n.type === "model") {
|
|
205
|
+
const r = this.playground.getDigitalHuman(n.model, n.id);
|
|
206
|
+
r && r.continueAnimation();
|
|
207
|
+
}
|
|
208
|
+
}), this.state.playing = !0, console.log(`${this.NAME} [continueAllRemaining] after hardcoded pause skip - playing:`, this.state.playing)) : (console.log(`${this.NAME} [continueAllRemaining] continuing from paused position`), this.state.currentChapter.players.forEach((a) => {
|
|
209
|
+
if (a.type === "model") {
|
|
210
|
+
const n = this.playground.getDigitalHuman(a.model, a.id);
|
|
211
|
+
n && n.continueAnimation();
|
|
212
|
+
}
|
|
213
|
+
}), this.state.playing = !0, console.log(`${this.NAME} [continueAllRemaining] after continue - playing:`, this.state.playing)), i = this.getProgress(), console.log(`${this.NAME} [continueAllRemaining] updated progress before wait:`, i, "playing:", this.state.playing), i && i.currentTime < i.totalTime ? yield new Promise((a) => {
|
|
214
|
+
let n = (i == null ? void 0 : i.currentTime) || 0, r = 0;
|
|
215
|
+
const l = 15, m = () => {
|
|
216
|
+
var g;
|
|
217
|
+
if (!((g = this.state) != null && g.continuousPlaying)) {
|
|
218
|
+
console.log(`${this.NAME} [continueAllRemaining] stopped by user`), a();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const h = this.getProgress();
|
|
222
|
+
if (this.config.debug, h && h.currentTime >= h.totalTime) {
|
|
223
|
+
a();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (h && h.currentTime < 0) {
|
|
227
|
+
console.warn(`${this.NAME} [continueAllRemaining] detected negative time, skipping wait`), a();
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (h && h.currentTime === n) {
|
|
231
|
+
if (r++, r >= l) {
|
|
232
|
+
console.warn(`${this.NAME} [continueAllRemaining] progress stagnant for 3s, assuming chapter completed`), a();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
} else
|
|
236
|
+
r = 0, n = (h == null ? void 0 : h.currentTime) || 0;
|
|
237
|
+
setTimeout(m, 200);
|
|
238
|
+
};
|
|
239
|
+
m();
|
|
240
|
+
}) : console.log(`${this.NAME} [continueAllRemaining] chapter already completed or restarted, skipping wait`), console.log(
|
|
241
|
+
`${this.NAME} [continueAllRemaining] starting to play remaining chapters from index ${e + 1} to ${t.length - 1}`
|
|
242
|
+
), this.emitPlayingPlayersChanged();
|
|
243
|
+
for (let a = e + 1; a < t.length; a++) {
|
|
244
|
+
if (!this.state.continuousPlaying) {
|
|
245
|
+
this.config.debug && console.log(`${this.NAME} continuous playback stopped by user at chapter ${a + 1}`);
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
const n = t[a];
|
|
249
|
+
this.config.debug;
|
|
250
|
+
try {
|
|
251
|
+
n.players.filter((h) => h.type === "model").forEach((h) => {
|
|
252
|
+
const g = this.playground.getDigitalHuman(h.model, h.id);
|
|
253
|
+
g && (g.state.currentTime = 0);
|
|
254
|
+
});
|
|
255
|
+
const l = Date.now();
|
|
256
|
+
yield this.playChapterForContinuous(n);
|
|
257
|
+
const m = Date.now() - l;
|
|
258
|
+
if (this.config.debug, !this.state.continuousPlaying) {
|
|
259
|
+
this.config.debug && console.log(`${this.NAME} continuous playback stopped after chapter ${a + 1}`);
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
a < t.length - 1 && (yield new Promise((h) => setTimeout(h, 1e3)));
|
|
263
|
+
} catch (r) {
|
|
264
|
+
console.error(`${this.NAME} failed to play chapter ${n.name}:`, r), this.state.continuousPlaying = !1;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
this.config.debug;
|
|
269
|
+
} catch (i) {
|
|
270
|
+
throw console.error(`${this.NAME} failed during continuous continue:`, i), this.emitPlayingPlayersChanged(), this.state.playing = !1, this.state.continuousPlaying = !1, i;
|
|
271
|
+
} finally {
|
|
272
|
+
this.state.playing = !1, this.state.continuousPlaying = !1;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 从当前章节播放到最后一个章节(连续自动播放)
|
|
278
|
+
*/
|
|
279
|
+
playAllRemaining() {
|
|
280
|
+
return p(this, null, function* () {
|
|
281
|
+
if (this._autoPlayOnNaturalEnd = !0, !this.state.currentScript)
|
|
282
|
+
throw new Error("No script loaded");
|
|
283
|
+
const t = this.state.currentScript.chapters;
|
|
284
|
+
if (t.length === 0)
|
|
285
|
+
throw new Error("No chapters to play");
|
|
286
|
+
let e = 0;
|
|
287
|
+
this.state.currentChapter && (e = t.findIndex((i) => i.name === this.state.currentChapter.name), e === -1 && (e = 0)), this.state.continuousPlaying = !0, this.state.playMode = "continuous";
|
|
288
|
+
try {
|
|
289
|
+
this.config.debug;
|
|
290
|
+
const i = !this.state.playing && this.state.currentChapter !== null, s = this.getProgress();
|
|
291
|
+
if (i) {
|
|
292
|
+
const o = s && s.currentTime >= 26e3 && s.currentTime <= 27e3, a = s && s.totalTime > 0 && s.currentTime >= s.totalTime;
|
|
293
|
+
if (console.log(`${this.NAME} [playAllRemaining] pause analysis:`, {
|
|
294
|
+
hasProgress: !!s,
|
|
295
|
+
currentTime: s == null ? void 0 : s.currentTime,
|
|
296
|
+
totalTime: s == null ? void 0 : s.totalTime,
|
|
297
|
+
isCompleted: a,
|
|
298
|
+
isNearHardcodedPause: o,
|
|
299
|
+
shouldContinueFromPause: !a || o
|
|
300
|
+
}), this.emitPlayingPlayersChanged(), !a || o) {
|
|
301
|
+
this.config.debug, yield this.continue();
|
|
302
|
+
return;
|
|
303
|
+
} else if (this.config.debug, e += 1, e >= t.length) {
|
|
304
|
+
this.config.debug, this.state.playing = !1, this.emitPlayingPlayersChanged && this.emitPlayingPlayersChanged();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
for (let o = e; o < t.length; o++) {
|
|
309
|
+
if (!this.state.continuousPlaying) {
|
|
310
|
+
this.config.debug && console.log(`${this.NAME} continuous playback stopped by user at chapter ${o + 1}`), this.emitPlayingPlayersChanged();
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
const a = t[o];
|
|
314
|
+
this.config.debug;
|
|
315
|
+
try {
|
|
316
|
+
const n = this.state.currentChapter && this.state.currentChapter.name === a.name, r = i && n && o === e;
|
|
317
|
+
if (!n || r) {
|
|
318
|
+
const h = a.players.filter((g) => g.type === "model");
|
|
319
|
+
if (r) {
|
|
320
|
+
const g = this.getProgress();
|
|
321
|
+
g && g.currentTime >= 26e3 && g.currentTime <= 27e3 ? (h.forEach((b) => {
|
|
322
|
+
const M = this.playground.getDigitalHuman(b.model);
|
|
323
|
+
M && (M.state.currentTime = 27500);
|
|
324
|
+
}), this.config.debug && console.log(`${this.NAME} skipped hardcoded pause for chapter: ${a.name}`)) : this.config.debug && console.log(`${this.NAME} continuing current chapter from existing position: ${a.name}`);
|
|
325
|
+
} else
|
|
326
|
+
h.forEach((g) => {
|
|
327
|
+
const T = this.playground.getDigitalHuman(g.model, g.id);
|
|
328
|
+
T && (T.state.currentTime = 0);
|
|
329
|
+
}), this.config.debug && console.log(`${this.NAME} reset time for new chapter: ${a.name}`);
|
|
330
|
+
} else
|
|
331
|
+
this.config.debug;
|
|
332
|
+
const l = Date.now();
|
|
333
|
+
yield this.playChapterForContinuous(a);
|
|
334
|
+
const m = Date.now() - l;
|
|
335
|
+
if (this.config.debug, this.state.continuousPlaying && !this.state.playing && (console.warn(`${this.NAME} [playAllRemaining] chapter completed but playing state is false, fixing...`), this.state.playing = !0), !this.state.continuousPlaying) {
|
|
336
|
+
this.config.debug && console.log(`${this.NAME} continuous playback stopped after chapter ${o + 1}`), this.emitPlayingPlayersChanged();
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
o < t.length - 1, o < t.length - 1 && (yield new Promise((h) => setTimeout(h, 1e3)));
|
|
340
|
+
} catch (n) {
|
|
341
|
+
console.error(`${this.NAME} failed to play chapter ${a.name}:`, n), this.emitPlayingPlayersChanged(), this.state.continuousPlaying = !1;
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
this.stopAllPlayers(), this.state.playing = !1, this.emitPlayingPlayersChanged && this.emitPlayingPlayersChanged(), this.config.debug;
|
|
346
|
+
} catch (i) {
|
|
347
|
+
throw console.error(`${this.NAME} failed during continuous playback:`, i), this.emitPlayingPlayersChanged(), this.state.playing = !1, this.state.continuousPlaying = !1, i;
|
|
348
|
+
} finally {
|
|
349
|
+
this.state.playing = !1, this.state.continuousPlaying = !1;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* 重置播放
|
|
355
|
+
*/
|
|
356
|
+
reset() {
|
|
357
|
+
this.playground.reset(), this.state.playing = !1, this.state.continuousPlaying = !1, this.state.currentChapter = null, this.state.playMode = "single", this.config.debug && console.log(`${this.NAME} reset`);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* 设置时间线
|
|
361
|
+
*/
|
|
362
|
+
setTimelineTo(t) {
|
|
363
|
+
this.playground.setTimelineTo(t), this.config.debug && console.log(`${this.NAME} timeline set to:`, t);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 启用插件
|
|
367
|
+
*/
|
|
368
|
+
enable() {
|
|
369
|
+
this.state.enabled = !0, this.config.debug && console.log(`${this.NAME} enabled`);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* 禁用插件
|
|
373
|
+
*/
|
|
374
|
+
disable() {
|
|
375
|
+
this.state.enabled = !1, this.pause(), this.config.debug && console.log(`${this.NAME} disabled`);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* 重置并清理(完全重置插件状态,包括对 five 的操作和 DigitalHuman)
|
|
379
|
+
*/
|
|
380
|
+
resetAndCleanup() {
|
|
381
|
+
this.stopAllPlayers(), this.playground && (typeof this.playground.dispose == "function" && this.playground.dispose(), this.playground = new this.playground.constructor(this.config.debug || !1)), this.state.playing = !1, this.state.continuousPlaying = !1, this.state.currentChapter = null, this.state.currentScript = null, this.state.enabled = !1, this.state.playMode = "single", this.stopProgressUpdateTimer(), this.progressListeners.clear(), this.playingPlayersListeners.clear(), this.clearProgressCache(), this.totalDurationCache = null, this.chapterTimeMapCache = null, this.five && (this.five.models.filter((e) => e.name && (e.name.includes("animation") || e.name.includes("digital"))).forEach((e) => {
|
|
382
|
+
this.five.scene.remove(e);
|
|
383
|
+
}), this.five.refresh(), this.five.getCurrentState && this.five.getCurrentState()), this._autoPlayOnNaturalEnd = !1, this.config.debug && console.log(`${this.NAME} resetAndCleanup - 完全重置完成(包括 DigitalHuman)`);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* 销毁插件(彻底释放资源)
|
|
387
|
+
*/
|
|
388
|
+
dispose() {
|
|
389
|
+
this.resetAndCleanup(), this.playground && typeof this.playground.dispose == "function" && this.playground.dispose(), this.playingPlayersListeners.clear(), this.state = void 0, this.playground = void 0, this.five = void 0, this.config = void 0, typeof window != "undefined" && window.console && console.log(`${this.NAME} disposed (彻底销毁)`);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* 获取当前状态
|
|
393
|
+
*/
|
|
394
|
+
getState() {
|
|
395
|
+
return E({}, this.state);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* 获取可用章节列表
|
|
399
|
+
*/
|
|
400
|
+
getChapters() {
|
|
401
|
+
var t;
|
|
402
|
+
return ((t = this.state.currentScript) == null ? void 0 : t.chapters) || [];
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* 获取数字人实例
|
|
406
|
+
*/
|
|
407
|
+
getDigitalHuman(t, e) {
|
|
408
|
+
return this.playground.getDigitalHuman(t, e);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* 获取当前播放进度信息
|
|
412
|
+
*/
|
|
413
|
+
getProgress() {
|
|
414
|
+
if (!this.state.currentChapter)
|
|
415
|
+
return null;
|
|
416
|
+
let t = 0, e = 0;
|
|
417
|
+
return this.state.currentChapter.players.forEach((i) => {
|
|
418
|
+
if (i.type === "model") {
|
|
419
|
+
const s = i, o = s.keyframes[s.keyframes.length - 1];
|
|
420
|
+
o && (t = Math.max(t, o.timeStamp));
|
|
421
|
+
const a = this.playground.getDigitalHuman(s.model, s.id);
|
|
422
|
+
a && (e = Math.max(e, a.state.currentTime || 0));
|
|
423
|
+
}
|
|
424
|
+
}), { currentTime: e, totalTime: t };
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* 对原始 res 数据进行 transformPosition 处理和章节分组,返回完整结构
|
|
428
|
+
* @param res 原始数据
|
|
429
|
+
* @param work 可选,存在时才做transformPosition
|
|
430
|
+
* @param totalDelay 可选,默认0
|
|
431
|
+
*/
|
|
432
|
+
transformScriptData(t, e, i = 0) {
|
|
433
|
+
var n, r;
|
|
434
|
+
if (!t || !t.players || !Array.isArray(t.players))
|
|
435
|
+
return t;
|
|
436
|
+
const s = (n = t.players[0]) != null && n.fiveState ? E({}, t.players[0].fiveState) : void 0;
|
|
437
|
+
if (s && s.offset && e) {
|
|
438
|
+
const l = new N(s.offset.x, s.offset.y, s.offset.z), m = w(l, e == null ? void 0 : e.transform);
|
|
439
|
+
s.offset = { x: m.x, y: m.y, z: m.z };
|
|
440
|
+
}
|
|
441
|
+
const o = [
|
|
442
|
+
{
|
|
443
|
+
id: 0,
|
|
444
|
+
name: ((r = t.players[0]) == null ? void 0 : r.chapterName) || "Chapter 1",
|
|
445
|
+
players: []
|
|
446
|
+
}
|
|
447
|
+
];
|
|
448
|
+
let a = 0;
|
|
449
|
+
return t.players.forEach((l, m) => {
|
|
450
|
+
var T, b, M;
|
|
451
|
+
let h = E({}, l);
|
|
452
|
+
if (e && ((T = h.track) != null && T.path && Array.isArray(h.track.path) && (h.track.path = h.track.path.map((y) => {
|
|
453
|
+
const d = w(new N(y.x, y.y, y.z), e == null ? void 0 : e.transform);
|
|
454
|
+
return {
|
|
455
|
+
x: d.x,
|
|
456
|
+
y: d.y,
|
|
457
|
+
z: d.z
|
|
458
|
+
};
|
|
459
|
+
})), (b = h.track) != null && b.points && Array.isArray(h.track.points) && (h.track.points = h.track.points.map((y) => {
|
|
460
|
+
if (y.point) {
|
|
461
|
+
const d = w(
|
|
462
|
+
new N(y.point.x, y.point.y, y.point.z),
|
|
463
|
+
e == null ? void 0 : e.transform
|
|
464
|
+
);
|
|
465
|
+
return x(E({}, y), {
|
|
466
|
+
point: {
|
|
467
|
+
x: d.x,
|
|
468
|
+
y: d.y,
|
|
469
|
+
z: d.z
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
return y;
|
|
474
|
+
})), h.matrix && Array.isArray(h.matrix) && h.matrix.length >= 16)) {
|
|
475
|
+
const y = new N(h.matrix[12], h.matrix[13], h.matrix[14]), d = w(y, e == null ? void 0 : e.transform);
|
|
476
|
+
h.matrix[12] = d.x, h.matrix[13] = d.y, h.matrix[14] = d.z;
|
|
477
|
+
}
|
|
478
|
+
const g = z(h, i);
|
|
479
|
+
((M = l.config) == null ? void 0 : M.type) === "simultaneous" || m > 0 && a++, o[a] || o.push({
|
|
480
|
+
id: a,
|
|
481
|
+
name: l.chapterName || `Chapter ${a + 1}`,
|
|
482
|
+
players: []
|
|
483
|
+
}), o[a].players.push(g);
|
|
484
|
+
}), {
|
|
485
|
+
id: t.id,
|
|
486
|
+
name: t.name,
|
|
487
|
+
fiveState: s,
|
|
488
|
+
chapters: o
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
// ===================== 全局进度条功能 =====================
|
|
492
|
+
/**
|
|
493
|
+
* 清理进度缓存
|
|
494
|
+
*/
|
|
495
|
+
clearProgressCache() {
|
|
496
|
+
this.totalDurationCache = null, this.chapterTimeMapCache = null, this.config.debug && console.log(`${this.NAME} progress cache cleared`);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* 计算单个章节的时长
|
|
500
|
+
*/
|
|
501
|
+
calculateChapterDuration(t) {
|
|
502
|
+
let e = 0;
|
|
503
|
+
return t.players.forEach((i) => {
|
|
504
|
+
if (i.type === "model") {
|
|
505
|
+
const s = i, o = s.keyframes[s.keyframes.length - 1];
|
|
506
|
+
o && (e = Math.max(e, o.timeStamp));
|
|
507
|
+
}
|
|
508
|
+
}), e;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* 获取所有章节的总时长(毫秒)
|
|
512
|
+
*/
|
|
513
|
+
getTotalDuration() {
|
|
514
|
+
if (this.totalDurationCache !== null)
|
|
515
|
+
return this.totalDurationCache;
|
|
516
|
+
if (!this.state.currentScript)
|
|
517
|
+
return 0;
|
|
518
|
+
let t = 0;
|
|
519
|
+
return this.state.currentScript.chapters.forEach((e) => {
|
|
520
|
+
t += this.calculateChapterDuration(e);
|
|
521
|
+
}), this.totalDurationCache = t, this.config.debug && console.log(`${this.NAME} calculated total duration: ${t}ms`), t;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* 获取章节时间映射信息
|
|
525
|
+
*/
|
|
526
|
+
getChapterTimeMap() {
|
|
527
|
+
if (this.chapterTimeMapCache !== null)
|
|
528
|
+
return this.chapterTimeMapCache;
|
|
529
|
+
if (!this.state.currentScript)
|
|
530
|
+
return [];
|
|
531
|
+
const t = [];
|
|
532
|
+
let e = 0;
|
|
533
|
+
return this.state.currentScript.chapters.forEach((i, s) => {
|
|
534
|
+
const o = this.calculateChapterDuration(i), a = e + o;
|
|
535
|
+
t.push({
|
|
536
|
+
chapterIndex: s,
|
|
537
|
+
chapterName: i.name,
|
|
538
|
+
startTime: e,
|
|
539
|
+
duration: o,
|
|
540
|
+
endTime: a,
|
|
541
|
+
chapter: i
|
|
542
|
+
}), e = a;
|
|
543
|
+
}), this.chapterTimeMapCache = t, this.config.debug && console.log(`${this.NAME} generated chapter time map:`, t), t;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* 获取当前全局播放时间(毫秒)
|
|
547
|
+
*
|
|
548
|
+
* @deprecated 建议使用 getGlobalProgress().currentTime 获取更完整的信息
|
|
549
|
+
* @returns 当前全局时间(毫秒)
|
|
550
|
+
*/
|
|
551
|
+
getCurrentGlobalTime() {
|
|
552
|
+
return this.getGlobalProgress().currentTime;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* 获取全局进度信息
|
|
556
|
+
*/
|
|
557
|
+
getGlobalProgress() {
|
|
558
|
+
let t = 0, e = 0, i = 0;
|
|
559
|
+
if (this.state.currentChapter) {
|
|
560
|
+
const n = this.getChapterTimeMap().find((r) => r.chapter.name === this.state.currentChapter.name);
|
|
561
|
+
if (n) {
|
|
562
|
+
e = n.chapterIndex;
|
|
563
|
+
const r = this.getProgress();
|
|
564
|
+
i = (r == null ? void 0 : r.currentTime) || 0, t = n.startTime + i;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
const s = this.getTotalDuration(), o = s > 0 ? t / s * 100 : 0;
|
|
568
|
+
return {
|
|
569
|
+
currentTime: t,
|
|
570
|
+
totalTime: s,
|
|
571
|
+
percentage: Math.min(100, Math.max(0, o)),
|
|
572
|
+
currentChapterIndex: e,
|
|
573
|
+
currentChapterTime: i,
|
|
574
|
+
currentChapter: this.state.currentChapter || void 0
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* 根据全局时间获取对应的章节信息
|
|
579
|
+
*/
|
|
580
|
+
getChapterByGlobalTime(t) {
|
|
581
|
+
const e = this.getChapterTimeMap();
|
|
582
|
+
if (e.length === 0)
|
|
583
|
+
return null;
|
|
584
|
+
const s = e.find((a) => t >= a.startTime && t < a.endTime) || (t >= e[e.length - 1].startTime ? e[e.length - 1] : null);
|
|
585
|
+
if (!s)
|
|
586
|
+
return null;
|
|
587
|
+
const o = t - s.startTime;
|
|
588
|
+
return {
|
|
589
|
+
chapterIndex: s.chapterIndex,
|
|
590
|
+
chapterTime: Math.max(0, o),
|
|
591
|
+
chapter: s.chapter
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* 跳转到指定的全局时间
|
|
596
|
+
*/
|
|
597
|
+
seekToGlobalTime(t, e) {
|
|
598
|
+
return p(this, null, function* () {
|
|
599
|
+
var i;
|
|
600
|
+
this._autoPlayOnNaturalEnd = !!e;
|
|
601
|
+
try {
|
|
602
|
+
if (!this.state.currentScript)
|
|
603
|
+
throw new Error("No script loaded");
|
|
604
|
+
const s = this.getTotalDuration(), o = Math.max(0, Math.min(t, s));
|
|
605
|
+
this.config.debug, this.emit("seek-started", o);
|
|
606
|
+
const a = this.getChapterByGlobalTime(o);
|
|
607
|
+
if (!a)
|
|
608
|
+
throw new Error("Unable to locate chapter for the specified time");
|
|
609
|
+
const { chapterIndex: n, chapterTime: r, chapter: l } = a, m = this.state.playing;
|
|
610
|
+
this.state.playing && this.pause(), (!this.state.currentChapter || this.state.currentChapter.name !== l.name) && (this.config.debug && console.log(`${this.NAME} switching to chapter ${n}: ${l.name}`), yield this.initializeChapterForSeek(l, r), this.state.currentChapter = l, this.emit("chapter-changed", n, l)), this.setTimelineTo(r), r === 0 && this.state.currentScript.chapters.forEach((u) => {
|
|
611
|
+
u.players.forEach((C) => {
|
|
612
|
+
if (C.type === "model") {
|
|
613
|
+
const A = this.playground.getDigitalHuman(C.model, C.id);
|
|
614
|
+
A && A.stopAnimation();
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
const T = this.getChapterTimeMap().find((u) => u.chapter.name === l.name), b = (i = T == null ? void 0 : T.chapterIndex) != null ? i : 0;
|
|
619
|
+
this.state.currentScript.chapters.forEach((u, C) => {
|
|
620
|
+
u.players.forEach((A) => {
|
|
621
|
+
if (A.type === "model") {
|
|
622
|
+
const c = this.playground.getDigitalHuman(A.model, A.id);
|
|
623
|
+
if (!c)
|
|
624
|
+
return;
|
|
625
|
+
if (C < b)
|
|
626
|
+
c.model.visible = !1, c.container.visible = !1, c.state.currentTime = 0, c.pauseAnimation && c.pauseAnimation();
|
|
627
|
+
else if (C === b) {
|
|
628
|
+
if (c.play({
|
|
629
|
+
keyframes: A.keyframes,
|
|
630
|
+
items: A.items,
|
|
631
|
+
effects: A.effects
|
|
632
|
+
}), c.state.currentTime = r, c.model.visible = !0, c.container.visible = !0, c.state.currentTime = r, c.keyframesManager && c.keyframes) {
|
|
633
|
+
const $ = c.keyframesManager.getStateByTime(r, c.keyframes, "model");
|
|
634
|
+
$ && (c.model.position.copy($.translation), c.model.quaternion.copy($.quaternion), c.model.scale.copy($.scale), c.model.visible = $.visible);
|
|
635
|
+
}
|
|
636
|
+
e ? c.continueAnimation() : c.pauseAnimation && c.pauseAnimation();
|
|
637
|
+
} else
|
|
638
|
+
c.model.visible = !1, c.container.visible = !1, c.state.currentTime = 0, c.pauseAnimation && c.pauseAnimation();
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}), (e !== void 0 ? e : m) && (this.state.playing = !0, l.players.forEach((u) => {
|
|
642
|
+
if (u.type === "model") {
|
|
643
|
+
const C = this.playground.getDigitalHuman(u.model, u.id);
|
|
644
|
+
C && (C.play({
|
|
645
|
+
keyframes: u.keyframes,
|
|
646
|
+
items: u.items,
|
|
647
|
+
effects: u.effects
|
|
648
|
+
}), C.state.currentTime = r, C.continueAnimation());
|
|
649
|
+
}
|
|
650
|
+
}), this.emit("playback-started", o)), this.emit("seek-completed", o);
|
|
651
|
+
const d = this.getChapterTimeMap().find((u) => u.chapter.name === l.name);
|
|
652
|
+
if (d && Math.abs(r - d.duration) < 1 && // 允许1ms误差
|
|
653
|
+
e) {
|
|
654
|
+
const u = this.state.currentScript.chapters[n + 1];
|
|
655
|
+
u && (this.config.debug && console.log(`${this.NAME} seekToGlobalTime: auto switch to next chapter:`, u.name), yield this.playChapter(u));
|
|
656
|
+
}
|
|
657
|
+
this.config.debug;
|
|
658
|
+
} catch (s) {
|
|
659
|
+
throw console.error(`${this.NAME} failed to seek to global time ${t}:`, s), s;
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* 初始化章节用于跳转(不自动播放)
|
|
665
|
+
*/
|
|
666
|
+
initializeChapterForSeek(t, e = 0) {
|
|
667
|
+
return p(this, null, function* () {
|
|
668
|
+
this.emitPlayingPlayersChanged();
|
|
669
|
+
try {
|
|
670
|
+
this.config.debug && console.log(`${this.NAME} initializing chapter for seek: ${t.name}`), this.playground.reset();
|
|
671
|
+
const i = t.players.filter((a) => a.type === "model"), s = [];
|
|
672
|
+
i.forEach((a) => {
|
|
673
|
+
const n = a;
|
|
674
|
+
n.keyframes && Array.isArray(n.keyframes) && n.keyframes.forEach((r) => {
|
|
675
|
+
r.animation && r.animation.url && s.push(r.animation.url);
|
|
676
|
+
});
|
|
677
|
+
}), s.length > 0 && (yield this.playground.loadAnimations(s)), yield Promise.all(
|
|
678
|
+
i.map((a) => p(this, null, function* () {
|
|
679
|
+
const n = a;
|
|
680
|
+
let r = this.playground.getDigitalHuman(n.model, n.id);
|
|
681
|
+
if (r || (yield this.playground.loadModels([n.model], [n.id]), r = this.playground.getDigitalHuman(n.model, n.id)), r && n.keyframes.length > 0) {
|
|
682
|
+
r.state.currentTime = e, r.state.currentAnimation = null, r.keyframes = n.keyframes;
|
|
683
|
+
const l = n.keyframes[0];
|
|
684
|
+
r.model.position.set(l.position[0], l.position[1], l.position[2]), r.model.quaternion.set(
|
|
685
|
+
l.quaternion[0],
|
|
686
|
+
l.quaternion[1],
|
|
687
|
+
l.quaternion[2],
|
|
688
|
+
l.quaternion[3]
|
|
689
|
+
), r.model.scale.set(l.scale[0], l.scale[1], l.scale[2]), r.model.visible = l.visible, r.play({
|
|
690
|
+
keyframes: n.keyframes,
|
|
691
|
+
items: n.items,
|
|
692
|
+
effects: n.effects
|
|
693
|
+
}), r.state.currentTime = e, r.continueAnimation();
|
|
694
|
+
}
|
|
695
|
+
}))
|
|
696
|
+
), t.players.filter((a) => a.type === "camera").length > 0 && this.config.debug, this.config.debug;
|
|
697
|
+
} catch (i) {
|
|
698
|
+
throw console.error(`${this.NAME} failed to initialize chapter for seek:`, i), i;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* 跳转到指定百分比位置
|
|
704
|
+
*/
|
|
705
|
+
seekToPercentage(t, e) {
|
|
706
|
+
return p(this, null, function* () {
|
|
707
|
+
const i = Math.max(0, Math.min(100, t)), o = this.getTotalDuration() * i / 100;
|
|
708
|
+
this.config.debug && console.log(`${this.NAME} seeking to ${i}% (${o}ms)`), yield this.seekToGlobalTime(o, e);
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* 跳转到指定章节的指定时间
|
|
713
|
+
*/
|
|
714
|
+
seekToChapter(t, e = 0, i) {
|
|
715
|
+
return p(this, null, function* () {
|
|
716
|
+
if (!this.state.currentScript)
|
|
717
|
+
throw new Error("No script loaded");
|
|
718
|
+
if (t < 0 || t >= this.state.currentScript.chapters.length)
|
|
719
|
+
throw new Error("Invalid chapter index");
|
|
720
|
+
const a = this.getChapterTimeMap()[t].startTime + Math.max(0, e);
|
|
721
|
+
this.config.debug && console.log(`${this.NAME} seeking to chapter ${t} at ${e}ms (global: ${a}ms)`), yield this.seekToGlobalTime(a, i);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* 从指定全局时间开始播放所有剩余内容
|
|
726
|
+
*/
|
|
727
|
+
playFromGlobalTime(t) {
|
|
728
|
+
return p(this, null, function* () {
|
|
729
|
+
yield this.seekToGlobalTime(t, !0), yield this.playAllRemaining();
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* 注册进度变化监听器
|
|
734
|
+
*/
|
|
735
|
+
onProgressChanged(t) {
|
|
736
|
+
const e = (i) => p(this, null, function* () {
|
|
737
|
+
var r;
|
|
738
|
+
t(i);
|
|
739
|
+
const s = ((r = this.state.currentScript) == null ? void 0 : r.chapters) || [], o = this.state.currentChapter ? s.findIndex((l) => l.name === this.state.currentChapter.name) : -1, n = this.getChapterTimeMap().find((l) => {
|
|
740
|
+
var m;
|
|
741
|
+
return l.chapter.name === ((m = this.state.currentChapter) == null ? void 0 : m.name);
|
|
742
|
+
});
|
|
743
|
+
if (this.state.playing && this.state.currentChapter && n && i.currentChapterTime >= n.duration - 10 && // 允许10ms误差,比较章节内时间
|
|
744
|
+
this._autoPlayOnNaturalEnd) {
|
|
745
|
+
const l = s[o + 1];
|
|
746
|
+
l ? yield this.playChapter(l) : (this.stopAllPlayers(), this.state.playing = !1, this.five.refresh(), this.emitPlayingPlayersChanged && this.emitPlayingPlayersChanged());
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
return this.progressListeners.add(e), this.startProgressUpdateTimer(), this.config.debug && console.log(`${this.NAME} progress listener added, total: ${this.progressListeners.size}`), () => {
|
|
750
|
+
this.progressListeners.delete(e), this.progressListeners.size === 0 && this.stopProgressUpdateTimer(), this.config.debug && console.log(`${this.NAME} progress listener removed, remaining: ${this.progressListeners.size}`);
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* 移除进度监听器
|
|
755
|
+
*/
|
|
756
|
+
offProgressChanged(t) {
|
|
757
|
+
this.progressListeners.delete(t), this.progressListeners.size === 0 && this.stopProgressUpdateTimer(), this.config.debug && console.log(`${this.NAME} progress listener removed via off method, remaining: ${this.progressListeners.size}`);
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* 设置进度回调频率(毫秒)
|
|
761
|
+
*/
|
|
762
|
+
setProgressUpdateInterval(t) {
|
|
763
|
+
const e = this.progressUpdateInterval;
|
|
764
|
+
this.progressUpdateInterval = Math.max(50, t), this.config.debug && console.log(`${this.NAME} progress update interval changed from ${e}ms to ${this.progressUpdateInterval}ms`), this.progressUpdateTimer !== null && (this.stopProgressUpdateTimer(), this.startProgressUpdateTimer());
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* 启动进度更新定时器
|
|
768
|
+
*/
|
|
769
|
+
startProgressUpdateTimer() {
|
|
770
|
+
this.progressUpdateTimer === null && (this.progressUpdateTimer = window.setInterval(() => {
|
|
771
|
+
if (this.progressListeners.size > 0) {
|
|
772
|
+
const t = this.getGlobalProgress();
|
|
773
|
+
this.emit("progress-changed", t);
|
|
774
|
+
}
|
|
775
|
+
}, this.progressUpdateInterval), this.config.debug && console.log(`${this.NAME} progress update timer started with ${this.progressUpdateInterval}ms interval`));
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* 停止进度更新定时器
|
|
779
|
+
*/
|
|
780
|
+
stopProgressUpdateTimer() {
|
|
781
|
+
this.progressUpdateTimer !== null && (clearInterval(this.progressUpdateTimer), this.progressUpdateTimer = null, this.config.debug && console.log(`${this.NAME} progress update timer stopped`));
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* 播放完整的所有章节(从头开始)
|
|
785
|
+
*/
|
|
786
|
+
playAllChapters() {
|
|
787
|
+
return p(this, null, function* () {
|
|
788
|
+
if (!this.state.currentScript || this.state.currentScript.chapters.length === 0)
|
|
789
|
+
throw new Error("No script or chapters loaded");
|
|
790
|
+
this.config.debug, yield this.seekToGlobalTime(0, !0), yield this.playAllRemaining();
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* 获取播放范围信息
|
|
795
|
+
*/
|
|
796
|
+
getPlaybackRange() {
|
|
797
|
+
const t = this.getCurrentGlobalTime(), e = this.getTotalDuration();
|
|
798
|
+
return {
|
|
799
|
+
startTime: t,
|
|
800
|
+
endTime: e,
|
|
801
|
+
estimatedDuration: e - t
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* 停止所有 player 的播放状态
|
|
806
|
+
*/
|
|
807
|
+
stopAllPlayers() {
|
|
808
|
+
this.state.currentScript && this.state.currentScript.chapters.forEach((t) => {
|
|
809
|
+
t.players.forEach((e) => {
|
|
810
|
+
if (e.type === "model") {
|
|
811
|
+
const i = this.playground.getDigitalHuman(e.model, e.id);
|
|
812
|
+
i && (i.pauseAnimation && i.pauseAnimation(), i.state.playing = !1);
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
// 简单的事件发射器实现
|
|
818
|
+
emit(t, ...e) {
|
|
819
|
+
if (this.config.debug, t === "progress-changed" && e.length > 0) {
|
|
820
|
+
const i = e[0];
|
|
821
|
+
this.progressListeners.forEach((s) => {
|
|
822
|
+
try {
|
|
823
|
+
s(i);
|
|
824
|
+
} catch (o) {
|
|
825
|
+
console.error(`${this.NAME} progress listener error:`, o);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* 注册监听当前正在播放的所有player变化
|
|
832
|
+
*/
|
|
833
|
+
onPlayingPlayersChanged(t) {
|
|
834
|
+
return this.playingPlayersListeners.add(t), () => this.playingPlayersListeners.delete(t);
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* 获取当前正在播放的所有player(数组)
|
|
838
|
+
*/
|
|
839
|
+
getCurrentPlayingPlayers() {
|
|
840
|
+
const e = this.getGlobalProgress().currentTime, s = this.getChapterTimeMap().find((o) => e >= o.startTime && e < o.endTime);
|
|
841
|
+
return s ? this.getPlayingPlayersFromChapter(s.chapter) : [];
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* 从指定章节获取正在播放的players
|
|
845
|
+
*/
|
|
846
|
+
getPlayingPlayersFromChapter(t) {
|
|
847
|
+
return t.players.filter((e) => {
|
|
848
|
+
if (e.type === "model") {
|
|
849
|
+
const i = this.playground.getDigitalHuman(e.model, e.id);
|
|
850
|
+
return !(!i || !i.state);
|
|
851
|
+
}
|
|
852
|
+
return !1;
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* 触发 playing-players-changed 事件
|
|
857
|
+
*/
|
|
858
|
+
emitPlayingPlayersChanged() {
|
|
859
|
+
const t = this.getCurrentPlayingPlayers();
|
|
860
|
+
this.playingPlayersListeners.forEach((e) => e(t));
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
export {
|
|
864
|
+
J as default
|
|
865
|
+
};
|