@realsee/dnalogel 3.59.13 → 3.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +1 -1
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +1 -1
- package/dist/index.cjs.js +82 -76
- package/dist/index.js +17048 -12726
- package/dist/index.umd.js +75 -69
- package/dist/shared-utils/CSS3DRender/CSS3DObject.d.ts +1 -1
- package/dist/shared-utils/CSS3DRender/CSS3DRenderer.d.ts +1 -1
- package/dist/shared-utils/Object3DHelper/Controller/CSS3DScaleController.d.ts +1 -1
- 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/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.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.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/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/TopviewFloorplanPlugin.html +1 -1
- package/docs/functions/Util.absoluteUrl.html +2 -2
- 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.inside.html +1 -1
- package/docs/functions/Util.isAbsoluteURL.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.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.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/GuideLinePluginType.RouteConfig.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.EventMap.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/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/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/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.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/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/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/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 +1 -1
- 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/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/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.ActionIfNoModelUnderMouse.html +1 -1
- 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.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/AreaMakerPlugin/Controller.js +5 -6
- package/libs/AreaMakerPlugin/index.js +5 -6
- package/libs/AreaMakerPlugin/utils/Item.js +5 -6
- package/libs/CSS3DRenderPlugin/Controller.js +5 -6
- package/libs/CSS3DRenderPlugin/index.js +8 -9
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +1 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +13 -14
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +5 -6
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +1 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +1 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.js +6 -5
- package/libs/CruisePlugin/BaseController.js +7 -8
- package/libs/CruisePlugin/Move.js +5 -6
- package/libs/CruisePlugin/Work.js +5 -6
- package/libs/CruisePlugin/index.js +9 -10
- package/libs/CurrentPanoImagePlugin/Controller.js +5 -6
- package/libs/CurrentPanoImagePlugin/index.js +6 -7
- package/libs/GuideLinePlugin/Controller.js +7 -8
- package/libs/GuideLinePlugin/GuideLineItem.js +5 -6
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +2 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +5 -6
- package/libs/GuideLinePlugin/index.js +9 -10
- package/libs/ModelChassisCompassPlugin/Plugin.js +45 -42
- package/libs/ModelChassisCompassPlugin/index.js +4 -1
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +23 -20
- package/libs/ModelEntryDoorGuidePlugin/index.js +4 -1
- package/libs/ModelMakerPlugin/Controller.js +6 -7
- package/libs/ModelMakerPlugin/index.js +6 -7
- package/libs/ModelMakerPlugin/item/prismItem.js +5 -6
- package/libs/ModelTVVideoPlugin/Plugin.js +6 -7
- package/libs/ModelTVVideoPlugin/index.js +5 -6
- package/libs/Object3DHelperPlugin/Controller.js +18 -19
- package/libs/Object3DHelperPlugin/index.js +8 -9
- package/libs/PanoCompassPlugin/Controller.js +5 -6
- package/libs/PanoCompassPlugin/index.js +6 -7
- package/libs/PanoDoorLabelPlugin/Controller.js +5 -6
- package/libs/PanoDoorLabelPlugin/index.js +6 -7
- package/libs/PanoMeasurePlugin/Components/Controller0.js +6 -7
- package/libs/PanoMeasurePlugin/Components/Controller1.js +6 -7
- package/libs/PanoMeasurePlugin/Controller/EditController.js +6 -7
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +16 -17
- package/libs/PanoMeasurePlugin/Controller/index.js +6 -7
- package/libs/PanoMeasurePlugin/Model/area.js +6 -7
- package/libs/PanoMeasurePlugin/Model/polygon.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +3 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +13 -14
- package/libs/PanoMeasurePlugin/index.js +17 -18
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +5 -6
- package/libs/PanoRulerProPlugin/Controller.js +16 -17
- package/libs/PanoRulerProPlugin/RulerItems.js +5 -6
- package/libs/PanoRulerProPlugin/index.js +6 -7
- package/libs/PanoSpatialTagPlugin/Plugin.js +66 -67
- package/libs/PanoSpatialTagPlugin/index.js +3 -4
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +5 -6
- package/libs/PanoTagPlugin/Components/Common/Text/FlyMText.js +1 -1
- package/libs/PanoTagPlugin/Components/Common/Text/FlyText.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/AudioTag/AudioTag.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/AudioTag/index.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +5 -6
- package/libs/PanoTagPlugin/Components/Tag/TextTag/TextTag.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/TextTag/index.js +1 -1
- package/libs/PanoTagPlugin/Components/Tag/index.js +60 -61
- package/libs/PanoTagPlugin/Components/TagContainer.js +5 -6
- package/libs/PanoTagPlugin/Components/TagItem.js +5 -6
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +5 -6
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +5 -6
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +18 -19
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +5 -6
- package/libs/PanoTagPlugin/controller/TagRender.js +5 -6
- package/libs/PanoTagPlugin/controller/TagUtil.js +5 -6
- package/libs/PanoTagPlugin/controller/index.js +43 -44
- package/libs/PanoTagPlugin/index.js +14 -15
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +5 -6
- package/libs/PanoVideoPlugin/Controller.js +5 -6
- package/libs/PanoVideoPlugin/VideoMeshController.js +9 -10
- package/libs/PanoVideoPlugin/index.js +8 -9
- package/libs/PipelinePlugin/Controller.js +19 -20
- package/libs/PipelinePlugin/index.js +6 -7
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +5 -6
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +5 -6
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +3 -4
- package/libs/Sculpt/Meshes/Circle.js +3 -3
- package/libs/Sculpt/Meshes/Cylinder.js +3 -3
- package/libs/Sculpt/Meshes/Line.js +3 -3
- package/libs/Sculpt/Meshes/LineWithDots.js +3 -3
- package/libs/Sculpt/Meshes/Point.js +3 -3
- package/libs/Sculpt/Meshes/Polygon.js +3 -3
- package/libs/Sculpt/Meshes/Rectangle.js +3 -3
- package/libs/Sculpt/Objects/Line/Editor.js +3 -3
- package/libs/Sculpt/index.js +3 -3
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -3
- package/libs/base/BasePlugin.js +4 -4
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +5 -6
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +6 -7
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +18 -19
- package/libs/floorplan/ModelFloorplanPlugin/index.js +6 -7
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +14 -15
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +6 -7
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +5 -6
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +6 -7
- package/libs/floorplan/index.js +3 -3
- package/libs/index.js +151 -149
- package/libs/shared-utils/CSS3DRender/CSS3DObject.d.ts +1 -1
- package/libs/shared-utils/CSS3DRender/CSS3DObject.js +8 -8
- package/libs/shared-utils/CSS3DRender/CSS3DRenderer.d.ts +1 -1
- package/libs/shared-utils/CSS3DRender/CSS3DRenderer.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.d.ts +1 -1
- package/libs/shared-utils/five/index.js +3 -3
- package/libs/shared-utils/five/lookObject.js +3 -3
- package/libs/shared-utils/index.js +3 -3
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/CSS3DRenderer/index.js +90 -0
- package/libs/shared-utils/three/FBXLoader/index.js +1493 -0
- package/libs/shared-utils/three/Magnifier.js +5 -5
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +1 -1
- package/libs/shared-utils/three/blink.js +1 -1
- package/libs/shared-utils/three/earcut3D.js +3 -3
- package/libs/shared-utils/three/index.js +3 -3
- package/libs/shared-utils/three/libs/NURBSCurve.js +22 -0
- package/libs/shared-utils/three/libs/NURBSUtils.js +212 -0
- package/libs/shared-utils/three/libs/inflate.js +282 -0
- package/libs/vendor/animejs/lib/anime.es.js +863 -0
- package/libs/vendor/earcut/src/earcut.js +280 -0
- package/libs/vendor/hammerjs/hammer.js +1189 -0
- package/package.json +5 -5
- package/libs/shared-utils/CSS3DRender/THREEJS_CSS3DRenderer/index.js +0 -74
|
@@ -0,0 +1,1493 @@
|
|
|
1
|
+
import { Loader as oe, LoaderUtils as J, FileLoader as Le, TextureLoader as Ie, RepeatWrapping as ue, ClampToEdgeWrapping as le, Texture as fe, MeshPhongMaterial as N, MeshLambertMaterial as Pe, Color as F, sRGBEncoding as U, EquirectangularReflectionMapping as Fe, Matrix4 as m, Group as pe, Bone as ce, PropertyBinding as X, Object3D as ee, OrthographicCamera as Me, PerspectiveCamera as Se, PointLight as ve, MathUtils as x, SpotLight as Re, DirectionalLight as Oe, SkinnedMesh as Be, Mesh as be, LineBasicMaterial as ke, Line as De, Vector3 as G, Skeleton as Ce, AmbientLight as Ue, BufferGeometry as V, Float32BufferAttribute as O, Uint16BufferAttribute as Xe, Matrix3 as Ge, Vector4 as Ve, BufferAttribute as je, AnimationClip as ze, Quaternion as j, Euler as B, VectorKeyframeTrack as He, QuaternionKeyframeTrack as _e, NumberKeyframeTrack as Ke } from "three";
|
|
2
|
+
import { Zlib as he } from "../libs/inflate.js";
|
|
3
|
+
import { NURBSCurve as me } from "../libs/NURBSCurve.js";
|
|
4
|
+
var qe = function() {
|
|
5
|
+
var v, y, T;
|
|
6
|
+
function z(e) {
|
|
7
|
+
oe.call(this, e);
|
|
8
|
+
}
|
|
9
|
+
z.prototype = Object.assign(Object.create(oe.prototype), {
|
|
10
|
+
constructor: z,
|
|
11
|
+
load: function(e, t, r, n) {
|
|
12
|
+
var a = this, i = a.path === "" ? J.extractUrlBase(e) : a.path, s = new Le(this.manager);
|
|
13
|
+
s.setPath(a.path), s.setResponseType("arraybuffer"), s.load(
|
|
14
|
+
e,
|
|
15
|
+
function(o) {
|
|
16
|
+
try {
|
|
17
|
+
t(a.parse(o, i));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
n ? n(l) : console.error(l), a.manager.itemError(e);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
r,
|
|
23
|
+
n
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
parse: function(e, t) {
|
|
27
|
+
if (ge(e))
|
|
28
|
+
v = new Y().parse(e);
|
|
29
|
+
else {
|
|
30
|
+
var r = ne(e);
|
|
31
|
+
if (!ye(r))
|
|
32
|
+
throw new Error("THREE.FBXLoader: Unknown format.");
|
|
33
|
+
if (te(r) < 7e3)
|
|
34
|
+
throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + te(r));
|
|
35
|
+
v = new W().parse(r);
|
|
36
|
+
}
|
|
37
|
+
var n = new Ie(this.manager).setPath(this.resourcePath || t).setCrossOrigin(this.crossOrigin);
|
|
38
|
+
return new H(n, this.manager).parse(v);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
function H(e, t) {
|
|
42
|
+
this.textureLoader = e, this.manager = t;
|
|
43
|
+
}
|
|
44
|
+
H.prototype = {
|
|
45
|
+
constructor: H,
|
|
46
|
+
parse: function() {
|
|
47
|
+
y = this.parseConnections();
|
|
48
|
+
var e = this.parseImages(), t = this.parseTextures(e), r = this.parseMaterials(t), n = this.parseDeformers(), a = new _().parse(n);
|
|
49
|
+
return this.parseScene(n, a, r), T;
|
|
50
|
+
},
|
|
51
|
+
// Parses FBXTree.Connections which holds parent-child connections between objects (e.g. material -> texture, model->geometry )
|
|
52
|
+
// and details the connection type
|
|
53
|
+
parseConnections: function() {
|
|
54
|
+
var e = /* @__PURE__ */ new Map();
|
|
55
|
+
if ("Connections" in v) {
|
|
56
|
+
var t = v.Connections.connections;
|
|
57
|
+
t.forEach(function(r) {
|
|
58
|
+
var n = r[0], a = r[1], i = r[2];
|
|
59
|
+
e.has(n) || e.set(n, {
|
|
60
|
+
parents: [],
|
|
61
|
+
children: []
|
|
62
|
+
});
|
|
63
|
+
var s = { ID: a, relationship: i };
|
|
64
|
+
e.get(n).parents.push(s), e.has(a) || e.set(a, {
|
|
65
|
+
parents: [],
|
|
66
|
+
children: []
|
|
67
|
+
});
|
|
68
|
+
var o = { ID: n, relationship: i };
|
|
69
|
+
e.get(a).children.push(o);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return e;
|
|
73
|
+
},
|
|
74
|
+
// Parse FBXTree.Objects.Video for embedded image data
|
|
75
|
+
// These images are connected to textures in FBXTree.Objects.Textures
|
|
76
|
+
// via FBXTree.Connections.
|
|
77
|
+
parseImages: function() {
|
|
78
|
+
var e = {}, t = {};
|
|
79
|
+
if ("Video" in v.Objects) {
|
|
80
|
+
var r = v.Objects.Video;
|
|
81
|
+
for (var n in r) {
|
|
82
|
+
var a = r[n], i = parseInt(n);
|
|
83
|
+
if (e[i] = a.RelativeFilename || a.Filename, "Content" in a) {
|
|
84
|
+
var s = a.Content instanceof ArrayBuffer && a.Content.byteLength > 0, o = typeof a.Content == "string" && a.Content !== "";
|
|
85
|
+
if (s || o) {
|
|
86
|
+
var l = this.parseImage(r[n]);
|
|
87
|
+
t[a.RelativeFilename || a.Filename] = l;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (var i in e) {
|
|
93
|
+
var f = e[i];
|
|
94
|
+
t[f] !== void 0 ? e[i] = t[f] : e[i] = e[i].split("\\").pop();
|
|
95
|
+
}
|
|
96
|
+
return e;
|
|
97
|
+
},
|
|
98
|
+
// Parse embedded image data in FBXTree.Video.Content
|
|
99
|
+
parseImage: function(e) {
|
|
100
|
+
var t = e.Content, r = e.RelativeFilename || e.Filename, n = r.slice(r.lastIndexOf(".") + 1).toLowerCase(), a;
|
|
101
|
+
switch (n) {
|
|
102
|
+
case "bmp":
|
|
103
|
+
a = "image/bmp";
|
|
104
|
+
break;
|
|
105
|
+
case "jpg":
|
|
106
|
+
case "jpeg":
|
|
107
|
+
a = "image/jpeg";
|
|
108
|
+
break;
|
|
109
|
+
case "png":
|
|
110
|
+
a = "image/png";
|
|
111
|
+
break;
|
|
112
|
+
case "tif":
|
|
113
|
+
a = "image/tiff";
|
|
114
|
+
break;
|
|
115
|
+
case "tga":
|
|
116
|
+
this.manager.getHandler(".tga") === null && console.warn("FBXLoader: TGA loader not found, skipping ", r), a = "image/tga";
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
console.warn('FBXLoader: Image type "' + n + '" is not supported.');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (typeof t == "string")
|
|
123
|
+
return "data:" + a + ";base64," + t;
|
|
124
|
+
var i = new Uint8Array(t);
|
|
125
|
+
return window.URL.createObjectURL(new Blob([i], { type: a }));
|
|
126
|
+
},
|
|
127
|
+
// Parse nodes in FBXTree.Objects.Texture
|
|
128
|
+
// These contain details such as UV scaling, cropping, rotation etc and are connected
|
|
129
|
+
// to images in FBXTree.Objects.Video
|
|
130
|
+
parseTextures: function(e) {
|
|
131
|
+
var t = /* @__PURE__ */ new Map();
|
|
132
|
+
if ("Texture" in v.Objects) {
|
|
133
|
+
var r = v.Objects.Texture;
|
|
134
|
+
for (var n in r) {
|
|
135
|
+
var a = this.parseTexture(r[n], e);
|
|
136
|
+
t.set(parseInt(n), a);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
},
|
|
141
|
+
// Parse individual node in FBXTree.Objects.Texture
|
|
142
|
+
parseTexture: function(e, t) {
|
|
143
|
+
var r = this.loadTexture(e, t);
|
|
144
|
+
r.ID = e.id, r.name = e.attrName;
|
|
145
|
+
var n = e.WrapModeU, a = e.WrapModeV, i = n !== void 0 ? n.value : 0, s = a !== void 0 ? a.value : 0;
|
|
146
|
+
if (r.wrapS = i === 0 ? ue : le, r.wrapT = s === 0 ? ue : le, "Scaling" in e) {
|
|
147
|
+
var o = e.Scaling.value;
|
|
148
|
+
r.repeat.x = o[0], r.repeat.y = o[1];
|
|
149
|
+
}
|
|
150
|
+
return r;
|
|
151
|
+
},
|
|
152
|
+
// load a texture specified as a blob or data URI, or via an external URL using TextureLoader
|
|
153
|
+
loadTexture: function(e, t) {
|
|
154
|
+
var r, n = this.textureLoader.path, a = y.get(e.id).children;
|
|
155
|
+
a !== void 0 && a.length > 0 && t[a[0].ID] !== void 0 && (r = t[a[0].ID], (r.indexOf("blob:") === 0 || r.indexOf("data:") === 0) && this.textureLoader.setPath(void 0));
|
|
156
|
+
var i, s = e.FileName.slice(-3).toLowerCase();
|
|
157
|
+
if (s === "tga") {
|
|
158
|
+
var o = this.manager.getHandler(".tga");
|
|
159
|
+
o === null ? (console.warn("FBXLoader: TGA loader not found, creating placeholder texture for", e.RelativeFilename), i = new fe()) : i = o.load(r);
|
|
160
|
+
} else
|
|
161
|
+
s === "psd" ? (console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for", e.RelativeFilename), i = new fe()) : i = this.textureLoader.load(r);
|
|
162
|
+
return this.textureLoader.setPath(n), i;
|
|
163
|
+
},
|
|
164
|
+
// Parse nodes in FBXTree.Objects.Material
|
|
165
|
+
parseMaterials: function(e) {
|
|
166
|
+
var t = /* @__PURE__ */ new Map();
|
|
167
|
+
if ("Material" in v.Objects) {
|
|
168
|
+
var r = v.Objects.Material;
|
|
169
|
+
for (var n in r) {
|
|
170
|
+
var a = this.parseMaterial(r[n], e);
|
|
171
|
+
a !== null && t.set(parseInt(n), a);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return t;
|
|
175
|
+
},
|
|
176
|
+
// Parse single node in FBXTree.Objects.Material
|
|
177
|
+
// Materials are connected to texture maps in FBXTree.Objects.Textures
|
|
178
|
+
// FBX format currently only supports Lambert and Phong shading models
|
|
179
|
+
parseMaterial: function(e, t) {
|
|
180
|
+
var r = e.id, n = e.attrName, a = e.ShadingModel;
|
|
181
|
+
if (typeof a == "object" && (a = a.value), !y.has(r))
|
|
182
|
+
return null;
|
|
183
|
+
var i = this.parseParameters(e, t, r), s;
|
|
184
|
+
switch (a.toLowerCase()) {
|
|
185
|
+
case "phong":
|
|
186
|
+
s = new N();
|
|
187
|
+
break;
|
|
188
|
+
case "lambert":
|
|
189
|
+
s = new Pe();
|
|
190
|
+
break;
|
|
191
|
+
default:
|
|
192
|
+
console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.', a), s = new N();
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
return s.setValues(i), s.name = n, s;
|
|
196
|
+
},
|
|
197
|
+
// Parse FBX material and return parameters suitable for a three.js material
|
|
198
|
+
// Also parse the texture map and return any textures associated with the material
|
|
199
|
+
parseParameters: function(e, t, r) {
|
|
200
|
+
var n = {};
|
|
201
|
+
e.BumpFactor && (n.bumpScale = e.BumpFactor.value), e.Diffuse ? n.color = new F().fromArray(e.Diffuse.value) : e.DiffuseColor && e.DiffuseColor.type === "Color" && (n.color = new F().fromArray(e.DiffuseColor.value)), e.DisplacementFactor && (n.displacementScale = e.DisplacementFactor.value), e.Emissive ? n.emissive = new F().fromArray(e.Emissive.value) : e.EmissiveColor && e.EmissiveColor.type === "Color" && (n.emissive = new F().fromArray(e.EmissiveColor.value)), e.EmissiveFactor && (n.emissiveIntensity = parseFloat(e.EmissiveFactor.value)), e.Opacity && (n.opacity = parseFloat(e.Opacity.value)), n.opacity < 1 && (n.transparent = !0), e.ReflectionFactor && (n.reflectivity = e.ReflectionFactor.value), e.Shininess && (n.shininess = e.Shininess.value), e.Specular ? n.specular = new F().fromArray(e.Specular.value) : e.SpecularColor && e.SpecularColor.type === "Color" && (n.specular = new F().fromArray(e.SpecularColor.value));
|
|
202
|
+
var a = this;
|
|
203
|
+
return y.get(r).children.forEach(function(i) {
|
|
204
|
+
var s = i.relationship;
|
|
205
|
+
switch (s) {
|
|
206
|
+
case "Bump":
|
|
207
|
+
n.bumpMap = a.getTexture(t, i.ID);
|
|
208
|
+
break;
|
|
209
|
+
case "Maya|TEX_ao_map":
|
|
210
|
+
n.aoMap = a.getTexture(t, i.ID);
|
|
211
|
+
break;
|
|
212
|
+
case "DiffuseColor":
|
|
213
|
+
case "Maya|TEX_color_map":
|
|
214
|
+
n.map = a.getTexture(t, i.ID), n.map.encoding = U;
|
|
215
|
+
break;
|
|
216
|
+
case "DisplacementColor":
|
|
217
|
+
n.displacementMap = a.getTexture(t, i.ID);
|
|
218
|
+
break;
|
|
219
|
+
case "EmissiveColor":
|
|
220
|
+
n.emissiveMap = a.getTexture(t, i.ID), n.emissiveMap.encoding = U;
|
|
221
|
+
break;
|
|
222
|
+
case "NormalMap":
|
|
223
|
+
case "Maya|TEX_normal_map":
|
|
224
|
+
n.normalMap = a.getTexture(t, i.ID);
|
|
225
|
+
break;
|
|
226
|
+
case "ReflectionColor":
|
|
227
|
+
n.envMap = a.getTexture(t, i.ID), n.envMap.mapping = Fe, n.envMap.encoding = U;
|
|
228
|
+
break;
|
|
229
|
+
case "SpecularColor":
|
|
230
|
+
n.specularMap = a.getTexture(t, i.ID), n.specularMap.encoding = U;
|
|
231
|
+
break;
|
|
232
|
+
case "TransparentColor":
|
|
233
|
+
case "TransparencyFactor":
|
|
234
|
+
n.alphaMap = a.getTexture(t, i.ID), n.transparent = !0;
|
|
235
|
+
break;
|
|
236
|
+
case "AmbientColor":
|
|
237
|
+
case "ShininessExponent":
|
|
238
|
+
case "SpecularFactor":
|
|
239
|
+
case "VectorDisplacementColor":
|
|
240
|
+
default:
|
|
241
|
+
console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.", s);
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}), n;
|
|
245
|
+
},
|
|
246
|
+
// get a texture from the textureMap for use by a material.
|
|
247
|
+
getTexture: function(e, t) {
|
|
248
|
+
return "LayeredTexture" in v.Objects && t in v.Objects.LayeredTexture && (console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."), t = y.get(t).children[0].ID), e.get(t);
|
|
249
|
+
},
|
|
250
|
+
// Parse nodes in FBXTree.Objects.Deformer
|
|
251
|
+
// Deformer node can contain skinning or Vertex Cache animation data, however only skinning is supported here
|
|
252
|
+
// Generates map of Skeleton-like objects for use later when generating and binding skeletons.
|
|
253
|
+
parseDeformers: function() {
|
|
254
|
+
var e = {}, t = {};
|
|
255
|
+
if ("Deformer" in v.Objects) {
|
|
256
|
+
var r = v.Objects.Deformer;
|
|
257
|
+
for (var n in r) {
|
|
258
|
+
var a = r[n], i = y.get(parseInt(n));
|
|
259
|
+
if (a.attrType === "Skin") {
|
|
260
|
+
var s = this.parseSkeleton(i, r);
|
|
261
|
+
s.ID = n, i.parents.length > 1 && console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."), s.geometryID = i.parents[0].ID, e[n] = s;
|
|
262
|
+
} else if (a.attrType === "BlendShape") {
|
|
263
|
+
var o = {
|
|
264
|
+
id: n
|
|
265
|
+
};
|
|
266
|
+
o.rawTargets = this.parseMorphTargets(i, r), o.id = n, i.parents.length > 1 && console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."), t[n] = o;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
skeletons: e,
|
|
272
|
+
morphTargets: t
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
// Parse single nodes in FBXTree.Objects.Deformer
|
|
276
|
+
// The top level skeleton node has type 'Skin' and sub nodes have type 'Cluster'
|
|
277
|
+
// Each skin node represents a skeleton and each cluster node represents a bone
|
|
278
|
+
parseSkeleton: function(e, t) {
|
|
279
|
+
var r = [];
|
|
280
|
+
return e.children.forEach(function(n) {
|
|
281
|
+
var a = t[n.ID];
|
|
282
|
+
if (a.attrType === "Cluster") {
|
|
283
|
+
var i = {
|
|
284
|
+
ID: n.ID,
|
|
285
|
+
indices: [],
|
|
286
|
+
weights: [],
|
|
287
|
+
transformLink: new m().fromArray(a.TransformLink.a)
|
|
288
|
+
// transform: new Matrix4().fromArray( boneNode.Transform.a ),
|
|
289
|
+
// linkMode: boneNode.Mode,
|
|
290
|
+
};
|
|
291
|
+
"Indexes" in a && (i.indices = a.Indexes.a, i.weights = a.Weights.a), r.push(i);
|
|
292
|
+
}
|
|
293
|
+
}), {
|
|
294
|
+
rawBones: r,
|
|
295
|
+
bones: []
|
|
296
|
+
};
|
|
297
|
+
},
|
|
298
|
+
// The top level morph deformer node has type "BlendShape" and sub nodes have type "BlendShapeChannel"
|
|
299
|
+
parseMorphTargets: function(e, t) {
|
|
300
|
+
for (var r = [], n = 0; n < e.children.length; n++) {
|
|
301
|
+
var a = e.children[n], i = t[a.ID], s = {
|
|
302
|
+
name: i.attrName,
|
|
303
|
+
initialWeight: i.DeformPercent,
|
|
304
|
+
id: i.id,
|
|
305
|
+
fullWeights: i.FullWeights.a
|
|
306
|
+
};
|
|
307
|
+
if (i.attrType !== "BlendShapeChannel")
|
|
308
|
+
return;
|
|
309
|
+
s.geoID = y.get(parseInt(a.ID)).children.filter(function(o) {
|
|
310
|
+
return o.relationship === void 0;
|
|
311
|
+
})[0].ID, r.push(s);
|
|
312
|
+
}
|
|
313
|
+
return r;
|
|
314
|
+
},
|
|
315
|
+
// create the main Group() to be returned by the loader
|
|
316
|
+
parseScene: function(e, t, r) {
|
|
317
|
+
T = new pe();
|
|
318
|
+
var n = this.parseModels(e.skeletons, t, r), a = v.Objects.Model, i = this;
|
|
319
|
+
n.forEach(function(o) {
|
|
320
|
+
var l = a[o.ID];
|
|
321
|
+
i.setLookAtProperties(o, l);
|
|
322
|
+
var f = y.get(o.ID).parents;
|
|
323
|
+
f.forEach(function(u) {
|
|
324
|
+
var p = n.get(u.ID);
|
|
325
|
+
p !== void 0 && p.add(o);
|
|
326
|
+
}), o.parent === null && T.add(o);
|
|
327
|
+
}), this.bindSkeleton(e.skeletons, t, n), this.createAmbientLight(), this.setupMorphMaterials(), T.traverse(function(o) {
|
|
328
|
+
if (o.userData.transformData) {
|
|
329
|
+
o.parent && (o.userData.transformData.parentMatrixWorld = o.parent.matrix);
|
|
330
|
+
var l = re(o.userData.transformData);
|
|
331
|
+
o.applyMatrix4(l);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
var s = new K().parse();
|
|
335
|
+
T.children.length === 1 && T.children[0].isGroup && (T.children[0].animations = s, T = T.children[0]), T.animations = s;
|
|
336
|
+
},
|
|
337
|
+
// parse nodes in FBXTree.Objects.Model
|
|
338
|
+
parseModels: function(e, t, r) {
|
|
339
|
+
var n = /* @__PURE__ */ new Map(), a = v.Objects.Model;
|
|
340
|
+
for (var i in a) {
|
|
341
|
+
var s = parseInt(i), o = a[i], l = y.get(s), f = this.buildSkeleton(l, e, s, o.attrName);
|
|
342
|
+
if (!f) {
|
|
343
|
+
switch (o.attrType) {
|
|
344
|
+
case "Camera":
|
|
345
|
+
f = this.createCamera(l);
|
|
346
|
+
break;
|
|
347
|
+
case "Light":
|
|
348
|
+
f = this.createLight(l);
|
|
349
|
+
break;
|
|
350
|
+
case "Mesh":
|
|
351
|
+
f = this.createMesh(l, t, r);
|
|
352
|
+
break;
|
|
353
|
+
case "NurbsCurve":
|
|
354
|
+
f = this.createCurve(l, t);
|
|
355
|
+
break;
|
|
356
|
+
case "LimbNode":
|
|
357
|
+
case "Root":
|
|
358
|
+
f = new ce();
|
|
359
|
+
break;
|
|
360
|
+
case "Null":
|
|
361
|
+
default:
|
|
362
|
+
f = new pe();
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
f.name = o.attrName ? X.sanitizeNodeName(o.attrName) : "", f.ID = s;
|
|
366
|
+
}
|
|
367
|
+
this.getTransformData(f, o), n.set(s, f);
|
|
368
|
+
}
|
|
369
|
+
return n;
|
|
370
|
+
},
|
|
371
|
+
buildSkeleton: function(e, t, r, n) {
|
|
372
|
+
var a = null;
|
|
373
|
+
return e.parents.forEach(function(i) {
|
|
374
|
+
for (var s in t) {
|
|
375
|
+
var o = t[s];
|
|
376
|
+
o.rawBones.forEach(function(l, f) {
|
|
377
|
+
if (l.ID === i.ID) {
|
|
378
|
+
var u = a;
|
|
379
|
+
a = new ce(), a.matrixWorld.copy(l.transformLink), a.name = n ? X.sanitizeNodeName(n) : "", a.ID = r, o.bones[f] = a, u !== null && a.add(u);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}), a;
|
|
384
|
+
},
|
|
385
|
+
// create a PerspectiveCamera or OrthographicCamera
|
|
386
|
+
createCamera: function(e) {
|
|
387
|
+
var t, r;
|
|
388
|
+
if (e.children.forEach(function(p) {
|
|
389
|
+
var c = v.Objects.NodeAttribute[p.ID];
|
|
390
|
+
c !== void 0 && (r = c);
|
|
391
|
+
}), r === void 0)
|
|
392
|
+
t = new ee();
|
|
393
|
+
else {
|
|
394
|
+
var n = 0;
|
|
395
|
+
r.CameraProjectionType !== void 0 && r.CameraProjectionType.value === 1 && (n = 1);
|
|
396
|
+
var a = 1;
|
|
397
|
+
r.NearPlane !== void 0 && (a = r.NearPlane.value / 1e3);
|
|
398
|
+
var i = 1e3;
|
|
399
|
+
r.FarPlane !== void 0 && (i = r.FarPlane.value / 1e3);
|
|
400
|
+
var s = window.innerWidth, o = window.innerHeight;
|
|
401
|
+
r.AspectWidth !== void 0 && r.AspectHeight !== void 0 && (s = r.AspectWidth.value, o = r.AspectHeight.value);
|
|
402
|
+
var l = s / o, f = 45;
|
|
403
|
+
r.FieldOfView !== void 0 && (f = r.FieldOfView.value);
|
|
404
|
+
var u = r.FocalLength ? r.FocalLength.value : null;
|
|
405
|
+
switch (n) {
|
|
406
|
+
case 0:
|
|
407
|
+
t = new Se(f, l, a, i), u !== null && t.setFocalLength(u);
|
|
408
|
+
break;
|
|
409
|
+
case 1:
|
|
410
|
+
t = new Me(-s / 2, s / 2, o / 2, -o / 2, a, i);
|
|
411
|
+
break;
|
|
412
|
+
default:
|
|
413
|
+
console.warn("THREE.FBXLoader: Unknown camera type " + n + "."), t = new ee();
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return t;
|
|
418
|
+
},
|
|
419
|
+
// Create a DirectionalLight, PointLight or SpotLight
|
|
420
|
+
createLight: function(e) {
|
|
421
|
+
var t, r;
|
|
422
|
+
if (e.children.forEach(function(u) {
|
|
423
|
+
var p = v.Objects.NodeAttribute[u.ID];
|
|
424
|
+
p !== void 0 && (r = p);
|
|
425
|
+
}), r === void 0)
|
|
426
|
+
t = new ee();
|
|
427
|
+
else {
|
|
428
|
+
var n;
|
|
429
|
+
r.LightType === void 0 ? n = 0 : n = r.LightType.value;
|
|
430
|
+
var a = 16777215;
|
|
431
|
+
r.Color !== void 0 && (a = new F().fromArray(r.Color.value));
|
|
432
|
+
var i = r.Intensity === void 0 ? 1 : r.Intensity.value / 100;
|
|
433
|
+
r.CastLightOnObject !== void 0 && r.CastLightOnObject.value === 0 && (i = 0);
|
|
434
|
+
var s = 0;
|
|
435
|
+
r.FarAttenuationEnd !== void 0 && (r.EnableFarAttenuation !== void 0 && r.EnableFarAttenuation.value === 0 ? s = 0 : s = r.FarAttenuationEnd.value);
|
|
436
|
+
var o = 1;
|
|
437
|
+
switch (n) {
|
|
438
|
+
case 0:
|
|
439
|
+
t = new ve(a, i, s, o);
|
|
440
|
+
break;
|
|
441
|
+
case 1:
|
|
442
|
+
t = new Oe(a, i);
|
|
443
|
+
break;
|
|
444
|
+
case 2:
|
|
445
|
+
var l = Math.PI / 3;
|
|
446
|
+
r.InnerAngle !== void 0 && (l = x.degToRad(r.InnerAngle.value));
|
|
447
|
+
var f = 0;
|
|
448
|
+
r.OuterAngle !== void 0 && (f = x.degToRad(r.OuterAngle.value), f = Math.max(f, 1)), t = new Re(a, i, s, l, f, o);
|
|
449
|
+
break;
|
|
450
|
+
default:
|
|
451
|
+
console.warn("THREE.FBXLoader: Unknown light type " + r.LightType.value + ", defaulting to a PointLight."), t = new ve(a, i);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
r.CastShadows !== void 0 && r.CastShadows.value === 1 && (t.castShadow = !0);
|
|
455
|
+
}
|
|
456
|
+
return t;
|
|
457
|
+
},
|
|
458
|
+
createMesh: function(e, t, r) {
|
|
459
|
+
var n, a = null, i = null, s = [];
|
|
460
|
+
return e.children.forEach(function(o) {
|
|
461
|
+
t.has(o.ID) && (a = t.get(o.ID)), r.has(o.ID) && s.push(r.get(o.ID));
|
|
462
|
+
}), s.length > 1 ? i = s : s.length > 0 ? i = s[0] : (i = new N({ color: 13421772 }), s.push(i)), "color" in a.attributes && s.forEach(function(o) {
|
|
463
|
+
o.vertexColors = !0;
|
|
464
|
+
}), a.FBX_Deformer ? (s.forEach(function(o) {
|
|
465
|
+
o.skinning = !0;
|
|
466
|
+
}), n = new Be(a, i), n.normalizeSkinWeights()) : n = new be(a, i), n;
|
|
467
|
+
},
|
|
468
|
+
createCurve: function(e, t) {
|
|
469
|
+
var r = e.children.reduce(function(a, i) {
|
|
470
|
+
return t.has(i.ID) && (a = t.get(i.ID)), a;
|
|
471
|
+
}, null), n = new ke({ color: 3342591, linewidth: 1 });
|
|
472
|
+
return new De(r, n);
|
|
473
|
+
},
|
|
474
|
+
// parse the model node for transform data
|
|
475
|
+
getTransformData: function(e, t) {
|
|
476
|
+
var r = {};
|
|
477
|
+
"InheritType" in t && (r.inheritType = parseInt(t.InheritType.value)), "RotationOrder" in t ? r.eulerOrder = ae(t.RotationOrder.value) : r.eulerOrder = "ZYX", "Lcl_Translation" in t && (r.translation = t.Lcl_Translation.value), "PreRotation" in t && (r.preRotation = t.PreRotation.value), "Lcl_Rotation" in t && (r.rotation = t.Lcl_Rotation.value), "PostRotation" in t && (r.postRotation = t.PostRotation.value), "Lcl_Scaling" in t && (r.scale = t.Lcl_Scaling.value), "ScalingOffset" in t && (r.scalingOffset = t.ScalingOffset.value), "ScalingPivot" in t && (r.scalingPivot = t.ScalingPivot.value), "RotationOffset" in t && (r.rotationOffset = t.RotationOffset.value), "RotationPivot" in t && (r.rotationPivot = t.RotationPivot.value), e.userData.transformData = r;
|
|
478
|
+
},
|
|
479
|
+
setLookAtProperties: function(e, t) {
|
|
480
|
+
if ("LookAtProperty" in t) {
|
|
481
|
+
var r = y.get(e.ID).children;
|
|
482
|
+
r.forEach(function(n) {
|
|
483
|
+
if (n.relationship === "LookAtProperty") {
|
|
484
|
+
var a = v.Objects.Model[n.ID];
|
|
485
|
+
if ("Lcl_Translation" in a) {
|
|
486
|
+
var i = a.Lcl_Translation.value;
|
|
487
|
+
e.target !== void 0 ? (e.target.position.fromArray(i), T.add(e.target)) : e.lookAt(new G().fromArray(i));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
bindSkeleton: function(e, t, r) {
|
|
494
|
+
var n = this.parsePoseNodes();
|
|
495
|
+
for (var a in e) {
|
|
496
|
+
var i = e[a], s = y.get(parseInt(i.ID)).parents;
|
|
497
|
+
s.forEach(function(o) {
|
|
498
|
+
if (t.has(o.ID)) {
|
|
499
|
+
var l = o.ID, f = y.get(l);
|
|
500
|
+
f.parents.forEach(function(u) {
|
|
501
|
+
if (r.has(u.ID)) {
|
|
502
|
+
var p = r.get(u.ID);
|
|
503
|
+
p.bind(new Ce(i.bones), n[u.ID]);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
parsePoseNodes: function() {
|
|
511
|
+
var e = {};
|
|
512
|
+
if ("Pose" in v.Objects) {
|
|
513
|
+
var t = v.Objects.Pose;
|
|
514
|
+
for (var r in t)
|
|
515
|
+
if (t[r].attrType === "BindPose") {
|
|
516
|
+
var n = t[r].PoseNode;
|
|
517
|
+
Array.isArray(n) ? n.forEach(function(a) {
|
|
518
|
+
e[a.Node] = new m().fromArray(a.Matrix.a);
|
|
519
|
+
}) : e[n.Node] = new m().fromArray(n.Matrix.a);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return e;
|
|
523
|
+
},
|
|
524
|
+
// Parse ambient color in FBXTree.GlobalSettings - if it's not set to black (default), create an ambient light
|
|
525
|
+
createAmbientLight: function() {
|
|
526
|
+
if ("GlobalSettings" in v && "AmbientColor" in v.GlobalSettings) {
|
|
527
|
+
var e = v.GlobalSettings.AmbientColor.value, t = e[0], r = e[1], n = e[2];
|
|
528
|
+
if (t !== 0 || r !== 0 || n !== 0) {
|
|
529
|
+
var a = new F(t, r, n);
|
|
530
|
+
T.add(new Ue(a, 1));
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
setupMorphMaterials: function() {
|
|
535
|
+
var e = this;
|
|
536
|
+
T.traverse(function(t) {
|
|
537
|
+
t.isMesh && t.geometry.morphAttributes.position && t.geometry.morphAttributes.position.length && (Array.isArray(t.material) ? t.material.forEach(function(r, n) {
|
|
538
|
+
e.setupMorphMaterial(t, r, n);
|
|
539
|
+
}) : e.setupMorphMaterial(t, t.material));
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
setupMorphMaterial: function(e, t, r) {
|
|
543
|
+
var n = e.uuid, a = t.uuid, i = !1;
|
|
544
|
+
if (T.traverse(function(o) {
|
|
545
|
+
o.isMesh && (Array.isArray(o.material) ? o.material.forEach(function(l) {
|
|
546
|
+
l.uuid === a && o.uuid !== n && (i = !0);
|
|
547
|
+
}) : o.material.uuid === a && o.uuid !== n && (i = !0));
|
|
548
|
+
}), i === !0) {
|
|
549
|
+
var s = t.clone();
|
|
550
|
+
s.morphTargets = !0, r === void 0 ? e.material = s : e.material[r] = s;
|
|
551
|
+
} else
|
|
552
|
+
t.morphTargets = !0;
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
function _() {
|
|
556
|
+
}
|
|
557
|
+
_.prototype = {
|
|
558
|
+
constructor: _,
|
|
559
|
+
// Parse nodes in FBXTree.Objects.Geometry
|
|
560
|
+
parse: function(e) {
|
|
561
|
+
var t = /* @__PURE__ */ new Map();
|
|
562
|
+
if ("Geometry" in v.Objects) {
|
|
563
|
+
var r = v.Objects.Geometry;
|
|
564
|
+
for (var n in r) {
|
|
565
|
+
var a = y.get(parseInt(n)), i = this.parseGeometry(a, r[n], e);
|
|
566
|
+
t.set(parseInt(n), i);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return t;
|
|
570
|
+
},
|
|
571
|
+
// Parse single node in FBXTree.Objects.Geometry
|
|
572
|
+
parseGeometry: function(e, t, r) {
|
|
573
|
+
switch (t.attrType) {
|
|
574
|
+
case "Mesh":
|
|
575
|
+
return this.parseMeshGeometry(e, t, r);
|
|
576
|
+
case "NurbsCurve":
|
|
577
|
+
return this.parseNurbsGeometry(t);
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
// Parse single node mesh geometry in FBXTree.Objects.Geometry
|
|
581
|
+
parseMeshGeometry: function(e, t, r) {
|
|
582
|
+
var n = r.skeletons, a = [], i = e.parents.map(function(u) {
|
|
583
|
+
return v.Objects.Model[u.ID];
|
|
584
|
+
});
|
|
585
|
+
if (i.length !== 0) {
|
|
586
|
+
var s = e.children.reduce(function(u, p) {
|
|
587
|
+
return n[p.ID] !== void 0 && (u = n[p.ID]), u;
|
|
588
|
+
}, null);
|
|
589
|
+
e.children.forEach(function(u) {
|
|
590
|
+
r.morphTargets[u.ID] !== void 0 && a.push(r.morphTargets[u.ID]);
|
|
591
|
+
});
|
|
592
|
+
var o = i[0], l = {};
|
|
593
|
+
"RotationOrder" in o && (l.eulerOrder = ae(o.RotationOrder.value)), "InheritType" in o && (l.inheritType = parseInt(o.InheritType.value)), "GeometricTranslation" in o && (l.translation = o.GeometricTranslation.value), "GeometricRotation" in o && (l.rotation = o.GeometricRotation.value), "GeometricScaling" in o && (l.scale = o.GeometricScaling.value);
|
|
594
|
+
var f = re(l);
|
|
595
|
+
return this.genGeometry(t, s, a, f);
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
// Generate a BufferGeometry from a node in FBXTree.Objects.Geometry
|
|
599
|
+
genGeometry: function(e, t, r, n) {
|
|
600
|
+
var a = new V();
|
|
601
|
+
e.attrName && (a.name = e.attrName);
|
|
602
|
+
var i = this.parseGeoNode(e, t), s = this.genBuffers(i), o = new O(s.vertex, 3);
|
|
603
|
+
if (o.applyMatrix4(n), a.setAttribute("position", o), s.colors.length > 0 && a.setAttribute("color", new O(s.colors, 3)), t && (a.setAttribute("skinIndex", new Xe(s.weightsIndices, 4)), a.setAttribute("skinWeight", new O(s.vertexWeights, 4)), a.FBX_Deformer = t), s.normal.length > 0) {
|
|
604
|
+
var l = new Ge().getNormalMatrix(n), f = new O(s.normal, 3);
|
|
605
|
+
f.applyNormalMatrix(l), a.setAttribute("normal", f);
|
|
606
|
+
}
|
|
607
|
+
if (s.uvs.forEach(function(w, g) {
|
|
608
|
+
var d = "uv" + (g + 1).toString();
|
|
609
|
+
g === 0 && (d = "uv"), a.setAttribute(d, new O(s.uvs[g], 2));
|
|
610
|
+
}), i.material && i.material.mappingType !== "AllSame") {
|
|
611
|
+
var u = s.materialIndex[0], p = 0;
|
|
612
|
+
if (s.materialIndex.forEach(function(w, g) {
|
|
613
|
+
w !== u && (a.addGroup(p, g - p, u), u = w, p = g);
|
|
614
|
+
}), a.groups.length > 0) {
|
|
615
|
+
var c = a.groups[a.groups.length - 1], h = c.start + c.count;
|
|
616
|
+
h !== s.materialIndex.length && a.addGroup(h, s.materialIndex.length - h, u);
|
|
617
|
+
}
|
|
618
|
+
a.groups.length === 0 && a.addGroup(0, s.materialIndex.length, s.materialIndex[0]);
|
|
619
|
+
}
|
|
620
|
+
return this.addMorphTargets(a, e, r, n), a;
|
|
621
|
+
},
|
|
622
|
+
parseGeoNode: function(e, t) {
|
|
623
|
+
var r = {};
|
|
624
|
+
if (r.vertexPositions = e.Vertices !== void 0 ? e.Vertices.a : [], r.vertexIndices = e.PolygonVertexIndex !== void 0 ? e.PolygonVertexIndex.a : [], e.LayerElementColor && (r.color = this.parseVertexColors(e.LayerElementColor[0])), e.LayerElementMaterial && (r.material = this.parseMaterialIndices(e.LayerElementMaterial[0])), e.LayerElementNormal && (r.normal = this.parseNormals(e.LayerElementNormal[0])), e.LayerElementUV) {
|
|
625
|
+
r.uv = [];
|
|
626
|
+
for (var n = 0; e.LayerElementUV[n]; )
|
|
627
|
+
r.uv.push(this.parseUVs(e.LayerElementUV[n])), n++;
|
|
628
|
+
}
|
|
629
|
+
return r.weightTable = {}, t !== null && (r.skeleton = t, t.rawBones.forEach(function(a, i) {
|
|
630
|
+
a.indices.forEach(function(s, o) {
|
|
631
|
+
r.weightTable[s] === void 0 && (r.weightTable[s] = []), r.weightTable[s].push({
|
|
632
|
+
id: i,
|
|
633
|
+
weight: a.weights[o]
|
|
634
|
+
});
|
|
635
|
+
});
|
|
636
|
+
})), r;
|
|
637
|
+
},
|
|
638
|
+
genBuffers: function(e) {
|
|
639
|
+
var t = {
|
|
640
|
+
vertex: [],
|
|
641
|
+
normal: [],
|
|
642
|
+
colors: [],
|
|
643
|
+
uvs: [],
|
|
644
|
+
materialIndex: [],
|
|
645
|
+
vertexWeights: [],
|
|
646
|
+
weightsIndices: []
|
|
647
|
+
}, r = 0, n = 0, a = !1, i = [], s = [], o = [], l = [], f = [], u = [], p = this;
|
|
648
|
+
return e.vertexIndices.forEach(function(c, h) {
|
|
649
|
+
var w = !1;
|
|
650
|
+
c < 0 && (c = c ^ -1, w = !0);
|
|
651
|
+
var g = [], d = [];
|
|
652
|
+
if (i.push(c * 3, c * 3 + 1, c * 3 + 2), e.color) {
|
|
653
|
+
var A = D(h, r, c, e.color);
|
|
654
|
+
o.push(A[0], A[1], A[2]);
|
|
655
|
+
}
|
|
656
|
+
if (e.skeleton) {
|
|
657
|
+
if (e.weightTable[c] !== void 0 && e.weightTable[c].forEach(function(I) {
|
|
658
|
+
d.push(I.weight), g.push(I.id);
|
|
659
|
+
}), d.length > 4) {
|
|
660
|
+
a || (console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."), a = !0);
|
|
661
|
+
var L = [0, 0, 0, 0], S = [0, 0, 0, 0];
|
|
662
|
+
d.forEach(function(I, E) {
|
|
663
|
+
var P = I, C = g[E];
|
|
664
|
+
S.forEach(function(se, Q, Ee) {
|
|
665
|
+
if (P > se) {
|
|
666
|
+
Ee[Q] = P, P = se;
|
|
667
|
+
var xe = L[Q];
|
|
668
|
+
L[Q] = C, C = xe;
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
}), g = L, d = S;
|
|
672
|
+
}
|
|
673
|
+
for (; d.length < 4; )
|
|
674
|
+
d.push(0), g.push(0);
|
|
675
|
+
for (var R = 0; R < 4; ++R)
|
|
676
|
+
f.push(d[R]), u.push(g[R]);
|
|
677
|
+
}
|
|
678
|
+
if (e.normal) {
|
|
679
|
+
var A = D(h, r, c, e.normal);
|
|
680
|
+
s.push(A[0], A[1], A[2]);
|
|
681
|
+
}
|
|
682
|
+
if (e.material && e.material.mappingType !== "AllSame")
|
|
683
|
+
var $ = D(h, r, c, e.material)[0];
|
|
684
|
+
e.uv && e.uv.forEach(function(I, E) {
|
|
685
|
+
var P = D(h, r, c, I);
|
|
686
|
+
l[E] === void 0 && (l[E] = []), l[E].push(P[0]), l[E].push(P[1]);
|
|
687
|
+
}), n++, w && (p.genFace(
|
|
688
|
+
t,
|
|
689
|
+
e,
|
|
690
|
+
i,
|
|
691
|
+
$,
|
|
692
|
+
s,
|
|
693
|
+
o,
|
|
694
|
+
l,
|
|
695
|
+
f,
|
|
696
|
+
u,
|
|
697
|
+
n
|
|
698
|
+
), r++, n = 0, i = [], s = [], o = [], l = [], f = [], u = []);
|
|
699
|
+
}), t;
|
|
700
|
+
},
|
|
701
|
+
// Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris
|
|
702
|
+
genFace: function(e, t, r, n, a, i, s, o, l, f) {
|
|
703
|
+
for (var u = 2; u < f; u++)
|
|
704
|
+
e.vertex.push(t.vertexPositions[r[0]]), e.vertex.push(t.vertexPositions[r[1]]), e.vertex.push(t.vertexPositions[r[2]]), e.vertex.push(t.vertexPositions[r[(u - 1) * 3]]), e.vertex.push(t.vertexPositions[r[(u - 1) * 3 + 1]]), e.vertex.push(t.vertexPositions[r[(u - 1) * 3 + 2]]), e.vertex.push(t.vertexPositions[r[u * 3]]), e.vertex.push(t.vertexPositions[r[u * 3 + 1]]), e.vertex.push(t.vertexPositions[r[u * 3 + 2]]), t.skeleton && (e.vertexWeights.push(o[0]), e.vertexWeights.push(o[1]), e.vertexWeights.push(o[2]), e.vertexWeights.push(o[3]), e.vertexWeights.push(o[(u - 1) * 4]), e.vertexWeights.push(o[(u - 1) * 4 + 1]), e.vertexWeights.push(o[(u - 1) * 4 + 2]), e.vertexWeights.push(o[(u - 1) * 4 + 3]), e.vertexWeights.push(o[u * 4]), e.vertexWeights.push(o[u * 4 + 1]), e.vertexWeights.push(o[u * 4 + 2]), e.vertexWeights.push(o[u * 4 + 3]), e.weightsIndices.push(l[0]), e.weightsIndices.push(l[1]), e.weightsIndices.push(l[2]), e.weightsIndices.push(l[3]), e.weightsIndices.push(l[(u - 1) * 4]), e.weightsIndices.push(l[(u - 1) * 4 + 1]), e.weightsIndices.push(l[(u - 1) * 4 + 2]), e.weightsIndices.push(l[(u - 1) * 4 + 3]), e.weightsIndices.push(l[u * 4]), e.weightsIndices.push(l[u * 4 + 1]), e.weightsIndices.push(l[u * 4 + 2]), e.weightsIndices.push(l[u * 4 + 3])), t.color && (e.colors.push(i[0]), e.colors.push(i[1]), e.colors.push(i[2]), e.colors.push(i[(u - 1) * 3]), e.colors.push(i[(u - 1) * 3 + 1]), e.colors.push(i[(u - 1) * 3 + 2]), e.colors.push(i[u * 3]), e.colors.push(i[u * 3 + 1]), e.colors.push(i[u * 3 + 2])), t.material && t.material.mappingType !== "AllSame" && (e.materialIndex.push(n), e.materialIndex.push(n), e.materialIndex.push(n)), t.normal && (e.normal.push(a[0]), e.normal.push(a[1]), e.normal.push(a[2]), e.normal.push(a[(u - 1) * 3]), e.normal.push(a[(u - 1) * 3 + 1]), e.normal.push(a[(u - 1) * 3 + 2]), e.normal.push(a[u * 3]), e.normal.push(a[u * 3 + 1]), e.normal.push(a[u * 3 + 2])), t.uv && t.uv.forEach(function(p, c) {
|
|
705
|
+
e.uvs[c] === void 0 && (e.uvs[c] = []), e.uvs[c].push(s[c][0]), e.uvs[c].push(s[c][1]), e.uvs[c].push(s[c][(u - 1) * 2]), e.uvs[c].push(s[c][(u - 1) * 2 + 1]), e.uvs[c].push(s[c][u * 2]), e.uvs[c].push(s[c][u * 2 + 1]);
|
|
706
|
+
});
|
|
707
|
+
},
|
|
708
|
+
addMorphTargets: function(e, t, r, n) {
|
|
709
|
+
if (r.length !== 0) {
|
|
710
|
+
e.morphTargetsRelative = !0, e.morphAttributes.position = [];
|
|
711
|
+
var a = this;
|
|
712
|
+
r.forEach(function(i) {
|
|
713
|
+
i.rawTargets.forEach(function(s) {
|
|
714
|
+
var o = v.Objects.Geometry[s.geoID];
|
|
715
|
+
o !== void 0 && a.genMorphGeometry(e, t, o, n, s.name);
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
// a morph geometry node is similar to a standard node, and the node is also contained
|
|
721
|
+
// in FBXTree.Objects.Geometry, however it can only have attributes for position, normal
|
|
722
|
+
// and a special attribute Index defining which vertices of the original geometry are affected
|
|
723
|
+
// Normal and position attributes only have data for the vertices that are affected by the morph
|
|
724
|
+
genMorphGeometry: function(e, t, r, n, a) {
|
|
725
|
+
for (var i = t.PolygonVertexIndex !== void 0 ? t.PolygonVertexIndex.a : [], s = r.Vertices !== void 0 ? r.Vertices.a : [], o = r.Indexes !== void 0 ? r.Indexes.a : [], l = e.attributes.position.count * 3, f = new Float32Array(l), u = 0; u < o.length; u++) {
|
|
726
|
+
var p = o[u] * 3;
|
|
727
|
+
f[p] = s[u * 3], f[p + 1] = s[u * 3 + 1], f[p + 2] = s[u * 3 + 2];
|
|
728
|
+
}
|
|
729
|
+
var c = {
|
|
730
|
+
vertexIndices: i,
|
|
731
|
+
vertexPositions: f
|
|
732
|
+
}, h = this.genBuffers(c), w = new O(h.vertex, 3);
|
|
733
|
+
w.name = a || r.attrName, w.applyMatrix4(n), e.morphAttributes.position.push(w);
|
|
734
|
+
},
|
|
735
|
+
// Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists
|
|
736
|
+
parseNormals: function(e) {
|
|
737
|
+
var t = e.MappingInformationType, r = e.ReferenceInformationType, n = e.Normals.a, a = [];
|
|
738
|
+
return r === "IndexToDirect" && ("NormalIndex" in e ? a = e.NormalIndex.a : "NormalsIndex" in e && (a = e.NormalsIndex.a)), {
|
|
739
|
+
dataSize: 3,
|
|
740
|
+
buffer: n,
|
|
741
|
+
indices: a,
|
|
742
|
+
mappingType: t,
|
|
743
|
+
referenceType: r
|
|
744
|
+
};
|
|
745
|
+
},
|
|
746
|
+
// Parse UVs from FBXTree.Objects.Geometry.LayerElementUV if it exists
|
|
747
|
+
parseUVs: function(e) {
|
|
748
|
+
var t = e.MappingInformationType, r = e.ReferenceInformationType, n = e.UV.a, a = [];
|
|
749
|
+
return r === "IndexToDirect" && (a = e.UVIndex.a), {
|
|
750
|
+
dataSize: 2,
|
|
751
|
+
buffer: n,
|
|
752
|
+
indices: a,
|
|
753
|
+
mappingType: t,
|
|
754
|
+
referenceType: r
|
|
755
|
+
};
|
|
756
|
+
},
|
|
757
|
+
// Parse Vertex Colors from FBXTree.Objects.Geometry.LayerElementColor if it exists
|
|
758
|
+
parseVertexColors: function(e) {
|
|
759
|
+
var t = e.MappingInformationType, r = e.ReferenceInformationType, n = e.Colors.a, a = [];
|
|
760
|
+
return r === "IndexToDirect" && (a = e.ColorIndex.a), {
|
|
761
|
+
dataSize: 4,
|
|
762
|
+
buffer: n,
|
|
763
|
+
indices: a,
|
|
764
|
+
mappingType: t,
|
|
765
|
+
referenceType: r
|
|
766
|
+
};
|
|
767
|
+
},
|
|
768
|
+
// Parse mapping and material data in FBXTree.Objects.Geometry.LayerElementMaterial if it exists
|
|
769
|
+
parseMaterialIndices: function(e) {
|
|
770
|
+
var t = e.MappingInformationType, r = e.ReferenceInformationType;
|
|
771
|
+
if (t === "NoMappingInformation")
|
|
772
|
+
return {
|
|
773
|
+
dataSize: 1,
|
|
774
|
+
buffer: [0],
|
|
775
|
+
indices: [0],
|
|
776
|
+
mappingType: "AllSame",
|
|
777
|
+
referenceType: r
|
|
778
|
+
};
|
|
779
|
+
for (var n = e.Materials.a, a = [], i = 0; i < n.length; ++i)
|
|
780
|
+
a.push(i);
|
|
781
|
+
return {
|
|
782
|
+
dataSize: 1,
|
|
783
|
+
buffer: n,
|
|
784
|
+
indices: a,
|
|
785
|
+
mappingType: t,
|
|
786
|
+
referenceType: r
|
|
787
|
+
};
|
|
788
|
+
},
|
|
789
|
+
// Generate a NurbGeometry from a node in FBXTree.Objects.Geometry
|
|
790
|
+
parseNurbsGeometry: function(e) {
|
|
791
|
+
if (me === void 0)
|
|
792
|
+
return console.error(
|
|
793
|
+
"THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."
|
|
794
|
+
), new V();
|
|
795
|
+
var t = parseInt(e.Order);
|
|
796
|
+
if (isNaN(t))
|
|
797
|
+
return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s", e.Order, e.id), new V();
|
|
798
|
+
for (var r = t - 1, n = e.KnotVector.a, a = [], i = e.Points.a, s = 0, o = i.length; s < o; s += 4)
|
|
799
|
+
a.push(new Ve().fromArray(i, s));
|
|
800
|
+
var l, f;
|
|
801
|
+
if (e.Form === "Closed")
|
|
802
|
+
a.push(a[0]);
|
|
803
|
+
else if (e.Form === "Periodic") {
|
|
804
|
+
l = r, f = n.length - 1 - l;
|
|
805
|
+
for (var s = 0; s < r; ++s)
|
|
806
|
+
a.push(a[s]);
|
|
807
|
+
}
|
|
808
|
+
var u = new me(r, n, a, l, f), p = u.getPoints(a.length * 7), c = new Float32Array(p.length * 3);
|
|
809
|
+
p.forEach(function(w, g) {
|
|
810
|
+
w.toArray(c, g * 3);
|
|
811
|
+
});
|
|
812
|
+
var h = new V();
|
|
813
|
+
return h.setAttribute("position", new je(c, 3)), h;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
function K() {
|
|
817
|
+
}
|
|
818
|
+
K.prototype = {
|
|
819
|
+
constructor: K,
|
|
820
|
+
// take raw animation clips and turn them into three.js animation clips
|
|
821
|
+
parse: function() {
|
|
822
|
+
var e = [], t = this.parseClips();
|
|
823
|
+
if (t !== void 0)
|
|
824
|
+
for (var r in t) {
|
|
825
|
+
var n = t[r], a = this.addClip(n);
|
|
826
|
+
e.push(a);
|
|
827
|
+
}
|
|
828
|
+
return e;
|
|
829
|
+
},
|
|
830
|
+
parseClips: function() {
|
|
831
|
+
if (v.Objects.AnimationCurve !== void 0) {
|
|
832
|
+
var e = this.parseAnimationCurveNodes();
|
|
833
|
+
this.parseAnimationCurves(e);
|
|
834
|
+
var t = this.parseAnimationLayers(e), r = this.parseAnimStacks(t);
|
|
835
|
+
return r;
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
// parse nodes in FBXTree.Objects.AnimationCurveNode
|
|
839
|
+
// each AnimationCurveNode holds data for an animation transform for a model (e.g. left arm rotation )
|
|
840
|
+
// and is referenced by an AnimationLayer
|
|
841
|
+
parseAnimationCurveNodes: function() {
|
|
842
|
+
var e = v.Objects.AnimationCurveNode, t = /* @__PURE__ */ new Map();
|
|
843
|
+
for (var r in e) {
|
|
844
|
+
var n = e[r];
|
|
845
|
+
if (n.attrName.match(/S|R|T|DeformPercent/) !== null) {
|
|
846
|
+
var a = {
|
|
847
|
+
id: n.id,
|
|
848
|
+
attr: n.attrName,
|
|
849
|
+
curves: {}
|
|
850
|
+
};
|
|
851
|
+
t.set(a.id, a);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return t;
|
|
855
|
+
},
|
|
856
|
+
// parse nodes in FBXTree.Objects.AnimationCurve and connect them up to
|
|
857
|
+
// previously parsed AnimationCurveNodes. Each AnimationCurve holds data for a single animated
|
|
858
|
+
// axis ( e.g. times and values of x rotation)
|
|
859
|
+
parseAnimationCurves: function(e) {
|
|
860
|
+
var t = v.Objects.AnimationCurve;
|
|
861
|
+
for (var r in t) {
|
|
862
|
+
var n = {
|
|
863
|
+
id: t[r].id,
|
|
864
|
+
times: t[r].KeyTime.a.map(de),
|
|
865
|
+
values: t[r].KeyValueFloat.a
|
|
866
|
+
}, a = y.get(n.id);
|
|
867
|
+
if (a !== void 0) {
|
|
868
|
+
var i = a.parents[0].ID, s = a.parents[0].relationship;
|
|
869
|
+
s.match(/X/) ? e.get(i).curves.x = n : s.match(/Y/) ? e.get(i).curves.y = n : s.match(/Z/) ? e.get(i).curves.z = n : s.match(/d|DeformPercent/) && e.has(i) && (e.get(i).curves.morph = n);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
// parse nodes in FBXTree.Objects.AnimationLayer. Each layers holds references
|
|
874
|
+
// to various AnimationCurveNodes and is referenced by an AnimationStack node
|
|
875
|
+
// note: theoretically a stack can have multiple layers, however in practice there always seems to be one per stack
|
|
876
|
+
parseAnimationLayers: function(e) {
|
|
877
|
+
var t = v.Objects.AnimationLayer, r = /* @__PURE__ */ new Map();
|
|
878
|
+
for (var n in t) {
|
|
879
|
+
var a = [], i = y.get(parseInt(n));
|
|
880
|
+
if (i !== void 0) {
|
|
881
|
+
var s = i.children;
|
|
882
|
+
s.forEach(function(o, l) {
|
|
883
|
+
if (e.has(o.ID)) {
|
|
884
|
+
var f = e.get(o.ID);
|
|
885
|
+
if (f.curves.x !== void 0 || f.curves.y !== void 0 || f.curves.z !== void 0) {
|
|
886
|
+
if (a[l] === void 0) {
|
|
887
|
+
var u = y.get(o.ID).parents.filter(function(d) {
|
|
888
|
+
return d.relationship !== void 0;
|
|
889
|
+
})[0].ID;
|
|
890
|
+
if (u !== void 0) {
|
|
891
|
+
var p = v.Objects.Model[u.toString()];
|
|
892
|
+
if (p === void 0) {
|
|
893
|
+
console.warn("THREE.FBXLoader: Encountered a unused curve.", o);
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
var c = {
|
|
897
|
+
modelName: p.attrName ? X.sanitizeNodeName(p.attrName) : "",
|
|
898
|
+
ID: p.id,
|
|
899
|
+
initialPosition: [0, 0, 0],
|
|
900
|
+
initialRotation: [0, 0, 0],
|
|
901
|
+
initialScale: [1, 1, 1]
|
|
902
|
+
};
|
|
903
|
+
T.traverse(function(d) {
|
|
904
|
+
d.ID === p.id && (c.transform = d.matrix, d.userData.transformData && (c.eulerOrder = d.userData.transformData.eulerOrder));
|
|
905
|
+
}), c.transform || (c.transform = new m()), "PreRotation" in p && (c.preRotation = p.PreRotation.value), "PostRotation" in p && (c.postRotation = p.PostRotation.value), a[l] = c;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
a[l] && (a[l][f.attr] = f);
|
|
909
|
+
} else if (f.curves.morph !== void 0) {
|
|
910
|
+
if (a[l] === void 0) {
|
|
911
|
+
var h = y.get(o.ID).parents.filter(function(S) {
|
|
912
|
+
return S.relationship !== void 0;
|
|
913
|
+
})[0].ID, w = y.get(h).parents[0].ID, g = y.get(w).parents[0].ID, u = y.get(g).parents[0].ID, p = v.Objects.Model[u], c = {
|
|
914
|
+
modelName: p.attrName ? X.sanitizeNodeName(p.attrName) : "",
|
|
915
|
+
morphName: v.Objects.Deformer[h].attrName
|
|
916
|
+
};
|
|
917
|
+
a[l] = c;
|
|
918
|
+
}
|
|
919
|
+
a[l][f.attr] = f;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}), r.set(parseInt(n), a);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return r;
|
|
926
|
+
},
|
|
927
|
+
// parse nodes in FBXTree.Objects.AnimationStack. These are the top level node in the animation
|
|
928
|
+
// hierarchy. Each Stack node will be used to create a AnimationClip
|
|
929
|
+
parseAnimStacks: function(e) {
|
|
930
|
+
var t = v.Objects.AnimationStack, r = {};
|
|
931
|
+
for (var n in t) {
|
|
932
|
+
var a = y.get(parseInt(n)).children;
|
|
933
|
+
a.length > 1 && console.warn(
|
|
934
|
+
"THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers."
|
|
935
|
+
);
|
|
936
|
+
var i = e.get(a[0].ID);
|
|
937
|
+
r[n] = {
|
|
938
|
+
name: t[n].attrName,
|
|
939
|
+
layer: i
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
return r;
|
|
943
|
+
},
|
|
944
|
+
addClip: function(e) {
|
|
945
|
+
var t = [], r = this;
|
|
946
|
+
return e.layer.forEach(function(n) {
|
|
947
|
+
t = t.concat(r.generateTracks(n));
|
|
948
|
+
}), new ze(e.name, -1, t);
|
|
949
|
+
},
|
|
950
|
+
generateTracks: function(e) {
|
|
951
|
+
var t = [], r = new G(), n = new j(), a = new G();
|
|
952
|
+
if (e.transform && e.transform.decompose(r, n, a), r = r.toArray(), n = new B().setFromQuaternion(n, e.eulerOrder).toArray(), a = a.toArray(), e.T !== void 0 && Object.keys(e.T.curves).length > 0) {
|
|
953
|
+
var i = this.generateVectorTrack(e.modelName, e.T.curves, r, "position");
|
|
954
|
+
i !== void 0 && t.push(i);
|
|
955
|
+
}
|
|
956
|
+
if (e.R !== void 0 && Object.keys(e.R.curves).length > 0) {
|
|
957
|
+
var s = this.generateRotationTrack(
|
|
958
|
+
e.modelName,
|
|
959
|
+
e.R.curves,
|
|
960
|
+
n,
|
|
961
|
+
e.preRotation,
|
|
962
|
+
e.postRotation,
|
|
963
|
+
e.eulerOrder
|
|
964
|
+
);
|
|
965
|
+
s !== void 0 && t.push(s);
|
|
966
|
+
}
|
|
967
|
+
if (e.S !== void 0 && Object.keys(e.S.curves).length > 0) {
|
|
968
|
+
var o = this.generateVectorTrack(e.modelName, e.S.curves, a, "scale");
|
|
969
|
+
o !== void 0 && t.push(o);
|
|
970
|
+
}
|
|
971
|
+
if (e.DeformPercent !== void 0) {
|
|
972
|
+
var l = this.generateMorphTrack(e);
|
|
973
|
+
l !== void 0 && t.push(l);
|
|
974
|
+
}
|
|
975
|
+
return t;
|
|
976
|
+
},
|
|
977
|
+
generateVectorTrack: function(e, t, r, n) {
|
|
978
|
+
var a = this.getTimesForAllAxes(t), i = this.getKeyframeTrackValues(a, t, r);
|
|
979
|
+
return new He(e + "." + n, a, i);
|
|
980
|
+
},
|
|
981
|
+
generateRotationTrack: function(e, t, r, n, a, i) {
|
|
982
|
+
t.x !== void 0 && (this.interpolateRotations(t.x), t.x.values = t.x.values.map(x.degToRad)), t.y !== void 0 && (this.interpolateRotations(t.y), t.y.values = t.y.values.map(x.degToRad)), t.z !== void 0 && (this.interpolateRotations(t.z), t.z.values = t.z.values.map(x.degToRad));
|
|
983
|
+
var s = this.getTimesForAllAxes(t), o = this.getKeyframeTrackValues(s, t, r);
|
|
984
|
+
n !== void 0 && (n = n.map(x.degToRad), n.push(i), n = new B().fromArray(n), n = new j().setFromEuler(n)), a !== void 0 && (a = a.map(x.degToRad), a.push(i), a = new B().fromArray(a), a = new j().setFromEuler(a).inverse());
|
|
985
|
+
for (var l = new j(), f = new B(), u = [], p = 0; p < o.length; p += 3)
|
|
986
|
+
f.set(o[p], o[p + 1], o[p + 2], i), l.setFromEuler(f), n !== void 0 && l.premultiply(n), a !== void 0 && l.multiply(a), l.toArray(u, p / 3 * 4);
|
|
987
|
+
return new _e(e + ".quaternion", s, u);
|
|
988
|
+
},
|
|
989
|
+
generateMorphTrack: function(e) {
|
|
990
|
+
var t = e.DeformPercent.curves.morph, r = t.values.map(function(a) {
|
|
991
|
+
return a / 100;
|
|
992
|
+
}), n = T.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];
|
|
993
|
+
return new Ke(e.modelName + ".morphTargetInfluences[" + n + "]", t.times, r);
|
|
994
|
+
},
|
|
995
|
+
// For all animated objects, times are defined separately for each axis
|
|
996
|
+
// Here we'll combine the times into one sorted array without duplicates
|
|
997
|
+
getTimesForAllAxes: function(e) {
|
|
998
|
+
var t = [];
|
|
999
|
+
return e.x !== void 0 && (t = t.concat(e.x.times)), e.y !== void 0 && (t = t.concat(e.y.times)), e.z !== void 0 && (t = t.concat(e.z.times)), t = t.sort(function(r, n) {
|
|
1000
|
+
return r - n;
|
|
1001
|
+
}).filter(function(r, n, a) {
|
|
1002
|
+
return a.indexOf(r) == n;
|
|
1003
|
+
}), t;
|
|
1004
|
+
},
|
|
1005
|
+
getKeyframeTrackValues: function(e, t, r) {
|
|
1006
|
+
var n = r, a = [], i = -1, s = -1, o = -1;
|
|
1007
|
+
return e.forEach(function(l) {
|
|
1008
|
+
if (t.x && (i = t.x.times.indexOf(l)), t.y && (s = t.y.times.indexOf(l)), t.z && (o = t.z.times.indexOf(l)), i !== -1) {
|
|
1009
|
+
var f = t.x.values[i];
|
|
1010
|
+
a.push(f), n[0] = f;
|
|
1011
|
+
} else
|
|
1012
|
+
a.push(n[0]);
|
|
1013
|
+
if (s !== -1) {
|
|
1014
|
+
var u = t.y.values[s];
|
|
1015
|
+
a.push(u), n[1] = u;
|
|
1016
|
+
} else
|
|
1017
|
+
a.push(n[1]);
|
|
1018
|
+
if (o !== -1) {
|
|
1019
|
+
var p = t.z.values[o];
|
|
1020
|
+
a.push(p), n[2] = p;
|
|
1021
|
+
} else
|
|
1022
|
+
a.push(n[2]);
|
|
1023
|
+
}), a;
|
|
1024
|
+
},
|
|
1025
|
+
// Rotations are defined as Euler angles which can have values of any size
|
|
1026
|
+
// These will be converted to quaternions which don't support values greater than
|
|
1027
|
+
// PI, so we'll interpolate large rotations
|
|
1028
|
+
interpolateRotations: function(e) {
|
|
1029
|
+
for (var t = 1; t < e.values.length; t++) {
|
|
1030
|
+
var r = e.values[t - 1], n = e.values[t] - r, a = Math.abs(n);
|
|
1031
|
+
if (a >= 180) {
|
|
1032
|
+
for (var i = a / 180, s = n / i, o = r + s, l = e.times[t - 1], f = e.times[t] - l, u = f / i, p = l + u, c = [], h = []; p < e.times[t]; )
|
|
1033
|
+
c.push(p), p += u, h.push(o), o += s;
|
|
1034
|
+
e.times = ie(e.times, t, c), e.values = ie(e.values, t, h);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
function W() {
|
|
1040
|
+
}
|
|
1041
|
+
W.prototype = {
|
|
1042
|
+
constructor: W,
|
|
1043
|
+
getPrevNode: function() {
|
|
1044
|
+
return this.nodeStack[this.currentIndent - 2];
|
|
1045
|
+
},
|
|
1046
|
+
getCurrentNode: function() {
|
|
1047
|
+
return this.nodeStack[this.currentIndent - 1];
|
|
1048
|
+
},
|
|
1049
|
+
getCurrentProp: function() {
|
|
1050
|
+
return this.currentProp;
|
|
1051
|
+
},
|
|
1052
|
+
pushStack: function(e) {
|
|
1053
|
+
this.nodeStack.push(e), this.currentIndent += 1;
|
|
1054
|
+
},
|
|
1055
|
+
popStack: function() {
|
|
1056
|
+
this.nodeStack.pop(), this.currentIndent -= 1;
|
|
1057
|
+
},
|
|
1058
|
+
setCurrentProp: function(e, t) {
|
|
1059
|
+
this.currentProp = e, this.currentPropName = t;
|
|
1060
|
+
},
|
|
1061
|
+
parse: function(e) {
|
|
1062
|
+
this.currentIndent = 0, this.allNodes = new k(), this.nodeStack = [], this.currentProp = [], this.currentPropName = "";
|
|
1063
|
+
var t = this, r = e.split(/[\r\n]+/);
|
|
1064
|
+
return r.forEach(function(n, a) {
|
|
1065
|
+
var i = n.match(/^[\s\t]*;/), s = n.match(/^[\s\t]*$/);
|
|
1066
|
+
if (!(i || s)) {
|
|
1067
|
+
var o = n.match("^\\t{" + t.currentIndent + "}(\\w+):(.*){", ""), l = n.match("^\\t{" + t.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"), f = n.match("^\\t{" + (t.currentIndent - 1) + "}}");
|
|
1068
|
+
o ? t.parseNodeBegin(n, o) : l ? t.parseNodeProperty(n, l, r[++a]) : f ? t.popStack() : n.match(/^[^\s\t}]/) && t.parseNodePropertyContinued(n);
|
|
1069
|
+
}
|
|
1070
|
+
}), this.allNodes;
|
|
1071
|
+
},
|
|
1072
|
+
parseNodeBegin: function(e, t) {
|
|
1073
|
+
var r = t[1].trim().replace(/^"/, "").replace(/"$/, ""), n = t[2].split(",").map(function(o) {
|
|
1074
|
+
return o.trim().replace(/^"/, "").replace(/"$/, "");
|
|
1075
|
+
}), a = { name: r }, i = this.parseNodeAttr(n), s = this.getCurrentNode();
|
|
1076
|
+
this.currentIndent === 0 ? this.allNodes.add(r, a) : r in s ? (r === "PoseNode" ? s.PoseNode.push(a) : s[r].id !== void 0 && (s[r] = {}, s[r][s[r].id] = s[r]), i.id !== "" && (s[r][i.id] = a)) : typeof i.id == "number" ? (s[r] = {}, s[r][i.id] = a) : r !== "Properties70" && (r === "PoseNode" ? s[r] = [a] : s[r] = a), typeof i.id == "number" && (a.id = i.id), i.name !== "" && (a.attrName = i.name), i.type !== "" && (a.attrType = i.type), this.pushStack(a);
|
|
1077
|
+
},
|
|
1078
|
+
parseNodeAttr: function(e) {
|
|
1079
|
+
var t = e[0];
|
|
1080
|
+
e[0] !== "" && (t = parseInt(e[0]), isNaN(t) && (t = e[0]));
|
|
1081
|
+
var r = "", n = "";
|
|
1082
|
+
return e.length > 1 && (r = e[1].replace(/^(\w+)::/, ""), n = e[2]), { id: t, name: r, type: n };
|
|
1083
|
+
},
|
|
1084
|
+
parseNodeProperty: function(e, t, r) {
|
|
1085
|
+
var n = t[1].replace(/^"/, "").replace(/"$/, "").trim(), a = t[2].replace(/^"/, "").replace(/"$/, "").trim();
|
|
1086
|
+
n === "Content" && a === "," && (a = r.replace(/"/g, "").replace(/,$/, "").trim());
|
|
1087
|
+
var i = this.getCurrentNode(), s = i.name;
|
|
1088
|
+
if (s === "Properties70") {
|
|
1089
|
+
this.parseNodeSpecialProperty(e, n, a);
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (n === "C") {
|
|
1093
|
+
var o = a.split(",").slice(1), l = parseInt(o[0]), f = parseInt(o[1]), u = a.split(",").slice(3);
|
|
1094
|
+
u = u.map(function(p) {
|
|
1095
|
+
return p.trim().replace(/^"/, "");
|
|
1096
|
+
}), n = "connections", a = [l, f], Te(a, u), i[n] === void 0 && (i[n] = []);
|
|
1097
|
+
}
|
|
1098
|
+
n === "Node" && (i.id = a), n in i && Array.isArray(i[n]) ? i[n].push(a) : n !== "a" ? i[n] = a : i.a = a, this.setCurrentProp(i, n), n === "a" && a.slice(-1) !== "," && (i.a = q(a));
|
|
1099
|
+
},
|
|
1100
|
+
parseNodePropertyContinued: function(e) {
|
|
1101
|
+
var t = this.getCurrentNode();
|
|
1102
|
+
t.a += e, e.slice(-1) !== "," && (t.a = q(t.a));
|
|
1103
|
+
},
|
|
1104
|
+
// parse "Property70"
|
|
1105
|
+
parseNodeSpecialProperty: function(e, t, r) {
|
|
1106
|
+
var n = r.split('",').map(function(f) {
|
|
1107
|
+
return f.trim().replace(/^\"/, "").replace(/\s/, "_");
|
|
1108
|
+
}), a = n[0], i = n[1], s = n[2], o = n[3], l = n[4];
|
|
1109
|
+
switch (i) {
|
|
1110
|
+
case "int":
|
|
1111
|
+
case "enum":
|
|
1112
|
+
case "bool":
|
|
1113
|
+
case "ULongLong":
|
|
1114
|
+
case "double":
|
|
1115
|
+
case "Number":
|
|
1116
|
+
case "FieldOfView":
|
|
1117
|
+
l = parseFloat(l);
|
|
1118
|
+
break;
|
|
1119
|
+
case "Color":
|
|
1120
|
+
case "ColorRGB":
|
|
1121
|
+
case "Vector3D":
|
|
1122
|
+
case "Lcl_Translation":
|
|
1123
|
+
case "Lcl_Rotation":
|
|
1124
|
+
case "Lcl_Scaling":
|
|
1125
|
+
l = q(l);
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
this.getPrevNode()[a] = {
|
|
1129
|
+
type: i,
|
|
1130
|
+
type2: s,
|
|
1131
|
+
flag: o,
|
|
1132
|
+
value: l
|
|
1133
|
+
}, this.setCurrentProp(this.getPrevNode(), a);
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
function Y() {
|
|
1137
|
+
}
|
|
1138
|
+
Y.prototype = {
|
|
1139
|
+
constructor: Y,
|
|
1140
|
+
parse: function(e) {
|
|
1141
|
+
var t = new b(e);
|
|
1142
|
+
t.skip(23);
|
|
1143
|
+
var r = t.getUint32();
|
|
1144
|
+
console.log("THREE.FBXLoader: FBX binary version: " + r);
|
|
1145
|
+
for (var n = new k(); !this.endOfContent(t); ) {
|
|
1146
|
+
var a = this.parseNode(t, r);
|
|
1147
|
+
a !== null && n.add(a.name, a);
|
|
1148
|
+
}
|
|
1149
|
+
return n;
|
|
1150
|
+
},
|
|
1151
|
+
// Check if reader has reached the end of content.
|
|
1152
|
+
endOfContent: function(e) {
|
|
1153
|
+
return e.size() % 16 === 0 ? (e.getOffset() + 160 + 16 & -16) >= e.size() : e.getOffset() + 160 + 16 >= e.size();
|
|
1154
|
+
},
|
|
1155
|
+
// recursively parse nodes until the end of the file is reached
|
|
1156
|
+
parseNode: function(e, t) {
|
|
1157
|
+
var r = {}, n = t >= 7500 ? e.getUint64() : e.getUint32(), a = t >= 7500 ? e.getUint64() : e.getUint32();
|
|
1158
|
+
t >= 7500 ? e.getUint64() : e.getUint32();
|
|
1159
|
+
var i = e.getUint8(), s = e.getString(i);
|
|
1160
|
+
if (n === 0)
|
|
1161
|
+
return null;
|
|
1162
|
+
for (var o = [], l = 0; l < a; l++)
|
|
1163
|
+
o.push(this.parseProperty(e));
|
|
1164
|
+
var f = o.length > 0 ? o[0] : "", u = o.length > 1 ? o[1] : "", p = o.length > 2 ? o[2] : "";
|
|
1165
|
+
for (r.singleProperty = a === 1 && e.getOffset() === n; n > e.getOffset(); ) {
|
|
1166
|
+
var c = this.parseNode(e, t);
|
|
1167
|
+
c !== null && this.parseSubNode(s, r, c);
|
|
1168
|
+
}
|
|
1169
|
+
return r.propertyList = o, typeof f == "number" && (r.id = f), u !== "" && (r.attrName = u), p !== "" && (r.attrType = p), s !== "" && (r.name = s), r;
|
|
1170
|
+
},
|
|
1171
|
+
parseSubNode: function(e, t, r) {
|
|
1172
|
+
if (r.singleProperty === !0) {
|
|
1173
|
+
var n = r.propertyList[0];
|
|
1174
|
+
Array.isArray(n) ? (t[r.name] = r, r.a = n) : t[r.name] = n;
|
|
1175
|
+
} else if (e === "Connections" && r.name === "C") {
|
|
1176
|
+
var a = [];
|
|
1177
|
+
r.propertyList.forEach(function(p, c) {
|
|
1178
|
+
c !== 0 && a.push(p);
|
|
1179
|
+
}), t.connections === void 0 && (t.connections = []), t.connections.push(a);
|
|
1180
|
+
} else if (r.name === "Properties70") {
|
|
1181
|
+
var i = Object.keys(r);
|
|
1182
|
+
i.forEach(function(p) {
|
|
1183
|
+
t[p] = r[p];
|
|
1184
|
+
});
|
|
1185
|
+
} else if (e === "Properties70" && r.name === "P") {
|
|
1186
|
+
var s = r.propertyList[0], o = r.propertyList[1], l = r.propertyList[2], f = r.propertyList[3], u;
|
|
1187
|
+
s.indexOf("Lcl ") === 0 && (s = s.replace("Lcl ", "Lcl_")), o.indexOf("Lcl ") === 0 && (o = o.replace("Lcl ", "Lcl_")), o === "Color" || o === "ColorRGB" || o === "Vector" || o === "Vector3D" || o.indexOf("Lcl_") === 0 ? u = [r.propertyList[4], r.propertyList[5], r.propertyList[6]] : u = r.propertyList[4], t[s] = {
|
|
1188
|
+
type: o,
|
|
1189
|
+
type2: l,
|
|
1190
|
+
flag: f,
|
|
1191
|
+
value: u
|
|
1192
|
+
};
|
|
1193
|
+
} else
|
|
1194
|
+
t[r.name] === void 0 ? typeof r.id == "number" ? (t[r.name] = {}, t[r.name][r.id] = r) : t[r.name] = r : r.name === "PoseNode" ? (Array.isArray(t[r.name]) || (t[r.name] = [t[r.name]]), t[r.name].push(r)) : t[r.name][r.id] === void 0 && (t[r.name][r.id] = r);
|
|
1195
|
+
},
|
|
1196
|
+
parseProperty: function(e) {
|
|
1197
|
+
var t = e.getString(1);
|
|
1198
|
+
switch (t) {
|
|
1199
|
+
case "C":
|
|
1200
|
+
return e.getBoolean();
|
|
1201
|
+
case "D":
|
|
1202
|
+
return e.getFloat64();
|
|
1203
|
+
case "F":
|
|
1204
|
+
return e.getFloat32();
|
|
1205
|
+
case "I":
|
|
1206
|
+
return e.getInt32();
|
|
1207
|
+
case "L":
|
|
1208
|
+
return e.getInt64();
|
|
1209
|
+
case "R":
|
|
1210
|
+
var r = e.getUint32();
|
|
1211
|
+
return e.getArrayBuffer(r);
|
|
1212
|
+
case "S":
|
|
1213
|
+
var r = e.getUint32();
|
|
1214
|
+
return e.getString(r);
|
|
1215
|
+
case "Y":
|
|
1216
|
+
return e.getInt16();
|
|
1217
|
+
case "b":
|
|
1218
|
+
case "c":
|
|
1219
|
+
case "d":
|
|
1220
|
+
case "f":
|
|
1221
|
+
case "i":
|
|
1222
|
+
case "l":
|
|
1223
|
+
var n = e.getUint32(), a = e.getUint32(), i = e.getUint32();
|
|
1224
|
+
if (a === 0)
|
|
1225
|
+
switch (t) {
|
|
1226
|
+
case "b":
|
|
1227
|
+
case "c":
|
|
1228
|
+
return e.getBooleanArray(n);
|
|
1229
|
+
case "d":
|
|
1230
|
+
return e.getFloat64Array(n);
|
|
1231
|
+
case "f":
|
|
1232
|
+
return e.getFloat32Array(n);
|
|
1233
|
+
case "i":
|
|
1234
|
+
return e.getInt32Array(n);
|
|
1235
|
+
case "l":
|
|
1236
|
+
return e.getInt64Array(n);
|
|
1237
|
+
}
|
|
1238
|
+
typeof he == "undefined" && console.error(
|
|
1239
|
+
"THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js"
|
|
1240
|
+
);
|
|
1241
|
+
var s = new he.Inflate(new Uint8Array(e.getArrayBuffer(i))), o = new b(s.decompress().buffer);
|
|
1242
|
+
switch (t) {
|
|
1243
|
+
case "b":
|
|
1244
|
+
case "c":
|
|
1245
|
+
return o.getBooleanArray(n);
|
|
1246
|
+
case "d":
|
|
1247
|
+
return o.getFloat64Array(n);
|
|
1248
|
+
case "f":
|
|
1249
|
+
return o.getFloat32Array(n);
|
|
1250
|
+
case "i":
|
|
1251
|
+
return o.getInt32Array(n);
|
|
1252
|
+
case "l":
|
|
1253
|
+
return o.getInt64Array(n);
|
|
1254
|
+
}
|
|
1255
|
+
default:
|
|
1256
|
+
throw new Error("THREE.FBXLoader: Unknown property type " + t);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1260
|
+
function b(e, t) {
|
|
1261
|
+
this.dv = new DataView(e), this.offset = 0, this.littleEndian = t !== void 0 ? t : !0;
|
|
1262
|
+
}
|
|
1263
|
+
b.prototype = {
|
|
1264
|
+
constructor: b,
|
|
1265
|
+
getOffset: function() {
|
|
1266
|
+
return this.offset;
|
|
1267
|
+
},
|
|
1268
|
+
size: function() {
|
|
1269
|
+
return this.dv.buffer.byteLength;
|
|
1270
|
+
},
|
|
1271
|
+
skip: function(e) {
|
|
1272
|
+
this.offset += e;
|
|
1273
|
+
},
|
|
1274
|
+
// seems like true/false representation depends on exporter.
|
|
1275
|
+
// true: 1 or 'Y'(=0x59), false: 0 or 'T'(=0x54)
|
|
1276
|
+
// then sees LSB.
|
|
1277
|
+
getBoolean: function() {
|
|
1278
|
+
return (this.getUint8() & 1) === 1;
|
|
1279
|
+
},
|
|
1280
|
+
getBooleanArray: function(e) {
|
|
1281
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1282
|
+
t.push(this.getBoolean());
|
|
1283
|
+
return t;
|
|
1284
|
+
},
|
|
1285
|
+
getUint8: function() {
|
|
1286
|
+
var e = this.dv.getUint8(this.offset);
|
|
1287
|
+
return this.offset += 1, e;
|
|
1288
|
+
},
|
|
1289
|
+
getInt16: function() {
|
|
1290
|
+
var e = this.dv.getInt16(this.offset, this.littleEndian);
|
|
1291
|
+
return this.offset += 2, e;
|
|
1292
|
+
},
|
|
1293
|
+
getInt32: function() {
|
|
1294
|
+
var e = this.dv.getInt32(this.offset, this.littleEndian);
|
|
1295
|
+
return this.offset += 4, e;
|
|
1296
|
+
},
|
|
1297
|
+
getInt32Array: function(e) {
|
|
1298
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1299
|
+
t.push(this.getInt32());
|
|
1300
|
+
return t;
|
|
1301
|
+
},
|
|
1302
|
+
getUint32: function() {
|
|
1303
|
+
var e = this.dv.getUint32(this.offset, this.littleEndian);
|
|
1304
|
+
return this.offset += 4, e;
|
|
1305
|
+
},
|
|
1306
|
+
// JavaScript doesn't support 64-bit integer so calculate this here
|
|
1307
|
+
// 1 << 32 will return 1 so using multiply operation instead here.
|
|
1308
|
+
// There's a possibility that this method returns wrong value if the value
|
|
1309
|
+
// is out of the range between Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER.
|
|
1310
|
+
// TODO: safely handle 64-bit integer
|
|
1311
|
+
getInt64: function() {
|
|
1312
|
+
var e, t;
|
|
1313
|
+
return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t & 2147483648 ? (t = ~t & 4294967295, e = ~e & 4294967295, e === 4294967295 && (t = t + 1 & 4294967295), e = e + 1 & 4294967295, -(t * 4294967296 + e)) : t * 4294967296 + e;
|
|
1314
|
+
},
|
|
1315
|
+
getInt64Array: function(e) {
|
|
1316
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1317
|
+
t.push(this.getInt64());
|
|
1318
|
+
return t;
|
|
1319
|
+
},
|
|
1320
|
+
// Note: see getInt64() comment
|
|
1321
|
+
getUint64: function() {
|
|
1322
|
+
var e, t;
|
|
1323
|
+
return this.littleEndian ? (e = this.getUint32(), t = this.getUint32()) : (t = this.getUint32(), e = this.getUint32()), t * 4294967296 + e;
|
|
1324
|
+
},
|
|
1325
|
+
getFloat32: function() {
|
|
1326
|
+
var e = this.dv.getFloat32(this.offset, this.littleEndian);
|
|
1327
|
+
return this.offset += 4, e;
|
|
1328
|
+
},
|
|
1329
|
+
getFloat32Array: function(e) {
|
|
1330
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1331
|
+
t.push(this.getFloat32());
|
|
1332
|
+
return t;
|
|
1333
|
+
},
|
|
1334
|
+
getFloat64: function() {
|
|
1335
|
+
var e = this.dv.getFloat64(this.offset, this.littleEndian);
|
|
1336
|
+
return this.offset += 8, e;
|
|
1337
|
+
},
|
|
1338
|
+
getFloat64Array: function(e) {
|
|
1339
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1340
|
+
t.push(this.getFloat64());
|
|
1341
|
+
return t;
|
|
1342
|
+
},
|
|
1343
|
+
getArrayBuffer: function(e) {
|
|
1344
|
+
var t = this.dv.buffer.slice(this.offset, this.offset + e);
|
|
1345
|
+
return this.offset += e, t;
|
|
1346
|
+
},
|
|
1347
|
+
getString: function(e) {
|
|
1348
|
+
for (var t = [], r = 0; r < e; r++)
|
|
1349
|
+
t[r] = this.getUint8();
|
|
1350
|
+
var n = t.indexOf(0);
|
|
1351
|
+
return n >= 0 && (t = t.slice(0, n)), J.decodeText(new Uint8Array(t));
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
function k() {
|
|
1355
|
+
}
|
|
1356
|
+
k.prototype = {
|
|
1357
|
+
constructor: k,
|
|
1358
|
+
add: function(e, t) {
|
|
1359
|
+
this[e] = t;
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
function ge(e) {
|
|
1363
|
+
var t = "Kaydara FBX Binary \0";
|
|
1364
|
+
return e.byteLength >= t.length && t === ne(e, 0, t.length);
|
|
1365
|
+
}
|
|
1366
|
+
function ye(e) {
|
|
1367
|
+
var t = ["K", "a", "y", "d", "a", "r", "a", "\\", "F", "B", "X", "\\", "B", "i", "n", "a", "r", "y", "\\", "\\"], r = 0;
|
|
1368
|
+
function n(s) {
|
|
1369
|
+
var o = e[s - 1];
|
|
1370
|
+
return e = e.slice(r + s), r++, o;
|
|
1371
|
+
}
|
|
1372
|
+
for (var a = 0; a < t.length; ++a) {
|
|
1373
|
+
var i = n(1);
|
|
1374
|
+
if (i === t[a])
|
|
1375
|
+
return !1;
|
|
1376
|
+
}
|
|
1377
|
+
return !0;
|
|
1378
|
+
}
|
|
1379
|
+
function te(e) {
|
|
1380
|
+
var t = /FBXVersion: (\d+)/, r = e.match(t);
|
|
1381
|
+
if (r) {
|
|
1382
|
+
var n = parseInt(r[1]);
|
|
1383
|
+
return n;
|
|
1384
|
+
}
|
|
1385
|
+
throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.");
|
|
1386
|
+
}
|
|
1387
|
+
function de(e) {
|
|
1388
|
+
return e / 46186158e3;
|
|
1389
|
+
}
|
|
1390
|
+
var we = [];
|
|
1391
|
+
function D(e, t, r, n) {
|
|
1392
|
+
var a;
|
|
1393
|
+
switch (n.mappingType) {
|
|
1394
|
+
case "ByPolygonVertex":
|
|
1395
|
+
a = e;
|
|
1396
|
+
break;
|
|
1397
|
+
case "ByPolygon":
|
|
1398
|
+
a = t;
|
|
1399
|
+
break;
|
|
1400
|
+
case "ByVertice":
|
|
1401
|
+
a = r;
|
|
1402
|
+
break;
|
|
1403
|
+
case "AllSame":
|
|
1404
|
+
a = n.indices[0];
|
|
1405
|
+
break;
|
|
1406
|
+
default:
|
|
1407
|
+
console.warn("THREE.FBXLoader: unknown attribute mapping type " + n.mappingType);
|
|
1408
|
+
}
|
|
1409
|
+
n.referenceType === "IndexToDirect" && (a = n.indices[a]);
|
|
1410
|
+
var i = a * n.dataSize, s = i + n.dataSize;
|
|
1411
|
+
return Ae(we, n.buffer, i, s);
|
|
1412
|
+
}
|
|
1413
|
+
var Z = new B(), M = new G();
|
|
1414
|
+
function re(e) {
|
|
1415
|
+
var t = new m(), r = new m(), n = new m(), a = new m(), i = new m(), s = new m(), o = new m(), l = new m(), f = new m(), u = new m(), p = new m(), c = e.inheritType ? e.inheritType : 0;
|
|
1416
|
+
if (e.translation && t.setPosition(M.fromArray(e.translation)), e.preRotation) {
|
|
1417
|
+
var h = e.preRotation.map(x.degToRad);
|
|
1418
|
+
h.push(e.eulerOrder), r.makeRotationFromEuler(Z.fromArray(h));
|
|
1419
|
+
}
|
|
1420
|
+
if (e.rotation) {
|
|
1421
|
+
var h = e.rotation.map(x.degToRad);
|
|
1422
|
+
h.push(e.eulerOrder), n.makeRotationFromEuler(Z.fromArray(h));
|
|
1423
|
+
}
|
|
1424
|
+
if (e.postRotation) {
|
|
1425
|
+
var h = e.postRotation.map(x.degToRad);
|
|
1426
|
+
h.push(e.eulerOrder), a.makeRotationFromEuler(Z.fromArray(h));
|
|
1427
|
+
}
|
|
1428
|
+
e.scale && i.scale(M.fromArray(e.scale)), e.scalingOffset && o.setPosition(M.fromArray(e.scalingOffset)), e.scalingPivot && s.setPosition(M.fromArray(e.scalingPivot)), e.rotationOffset && l.setPosition(M.fromArray(e.rotationOffset)), e.rotationPivot && f.setPosition(M.fromArray(e.rotationPivot)), e.parentMatrixWorld && (u = e.parentMatrixWorld);
|
|
1429
|
+
var w = r.multiply(n).multiply(a), g = new m();
|
|
1430
|
+
u.extractRotation(g);
|
|
1431
|
+
var d = new m();
|
|
1432
|
+
d.copyPosition(u);
|
|
1433
|
+
var A = new m();
|
|
1434
|
+
A.getInverse(g).multiply(u);
|
|
1435
|
+
var L = new m();
|
|
1436
|
+
if (c === 0)
|
|
1437
|
+
L.copy(g).multiply(w).multiply(A).multiply(i);
|
|
1438
|
+
else if (c === 1)
|
|
1439
|
+
L.copy(g).multiply(A).multiply(w).multiply(i);
|
|
1440
|
+
else {
|
|
1441
|
+
var S = new m().getInverse(i), R = new m().multiply(A).multiply(S);
|
|
1442
|
+
L.copy(g).multiply(w).multiply(R).multiply(i);
|
|
1443
|
+
}
|
|
1444
|
+
var $ = new m().getInverse(f), I = new m().getInverse(s), E = new m();
|
|
1445
|
+
E.copy(t).multiply(l).multiply(f).multiply(r).multiply(n).multiply(a).multiply($).multiply(o).multiply(s).multiply(i).multiply(I);
|
|
1446
|
+
var P = new m().copyPosition(E), C = new m().copy(u).multiply(P);
|
|
1447
|
+
return p.copyPosition(C), E = new m().multiply(p).multiply(L), E;
|
|
1448
|
+
}
|
|
1449
|
+
function ae(e) {
|
|
1450
|
+
e = e || 0;
|
|
1451
|
+
var t = [
|
|
1452
|
+
"ZYX",
|
|
1453
|
+
// -> XYZ extrinsic
|
|
1454
|
+
"YZX",
|
|
1455
|
+
// -> XZY extrinsic
|
|
1456
|
+
"XZY",
|
|
1457
|
+
// -> YZX extrinsic
|
|
1458
|
+
"ZXY",
|
|
1459
|
+
// -> YXZ extrinsic
|
|
1460
|
+
"YXZ",
|
|
1461
|
+
// -> ZXY extrinsic
|
|
1462
|
+
"XYZ"
|
|
1463
|
+
// -> ZYX extrinsic
|
|
1464
|
+
// 'SphericXYZ', // not possible to support
|
|
1465
|
+
];
|
|
1466
|
+
return e === 6 ? (console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."), t[0]) : t[e];
|
|
1467
|
+
}
|
|
1468
|
+
function q(e) {
|
|
1469
|
+
var t = e.split(",").map(function(r) {
|
|
1470
|
+
return parseFloat(r);
|
|
1471
|
+
});
|
|
1472
|
+
return t;
|
|
1473
|
+
}
|
|
1474
|
+
function ne(e, t, r) {
|
|
1475
|
+
return t === void 0 && (t = 0), r === void 0 && (r = e.byteLength), J.decodeText(new Uint8Array(e, t, r));
|
|
1476
|
+
}
|
|
1477
|
+
function Te(e, t) {
|
|
1478
|
+
for (var r = 0, n = e.length, a = t.length; r < a; r++, n++)
|
|
1479
|
+
e[n] = t[r];
|
|
1480
|
+
}
|
|
1481
|
+
function Ae(e, t, r, n) {
|
|
1482
|
+
for (var a = r, i = 0; a < n; a++, i++)
|
|
1483
|
+
e[i] = t[a];
|
|
1484
|
+
return e;
|
|
1485
|
+
}
|
|
1486
|
+
function ie(e, t, r) {
|
|
1487
|
+
return e.slice(0, t).concat(r).concat(e.slice(t));
|
|
1488
|
+
}
|
|
1489
|
+
return z;
|
|
1490
|
+
}();
|
|
1491
|
+
export {
|
|
1492
|
+
qe as FBXLoader
|
|
1493
|
+
};
|