run-scene-v2 0.1.96 → 0.1.97
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/package.json +2 -5
- package/types/index.d.ts +2 -1
- package/types/index.js +15 -0
- package/types/src/Anima/Anima.js +309 -0
- package/types/src/Assets/Assets.js +153 -0
- package/types/src/Assets/AssetsManager.js +34 -0
- package/types/src/BaseEx.d.ts +6 -0
- package/types/src/BaseEx.js +18 -0
- package/types/src/CallBack/BindEvent.d.ts +2 -0
- package/types/src/CallBack/BindEvent.js +66 -0
- package/types/src/CallBack/CallBack.d.ts +27 -11
- package/types/src/CallBack/CallBack.js +328 -0
- package/types/src/CallBack/CallBackBase.js +22 -0
- package/types/src/CallBack/Desktop.js +10 -0
- package/types/src/Camera/Config.js +41 -0
- package/types/src/CameraEx.d.ts +1 -14
- package/types/src/CameraEx.js +232 -0
- package/types/src/Code.js +157 -0
- package/types/src/Const/constAssets.js +2 -0
- package/types/src/Const/constLight.js +8 -0
- package/types/src/Const/constMaterial.js +29 -0
- package/types/src/Const/constModel.d.ts +10 -0
- package/types/src/Const/constModel.js +39 -0
- package/types/src/Const/constRunScene.d.ts +1 -1
- package/types/src/Const/constRunScene.js +8 -0
- package/types/src/Const/constStr.d.ts +2 -0
- package/types/src/Const/constStr.js +23 -0
- package/types/src/Const/constTexture.js +26 -0
- package/types/src/Controls/ControlsConst.d.ts +26 -0
- package/types/src/Controls/ControlsConst.js +22 -0
- package/types/src/ControlsEx.d.ts +2 -27
- package/types/src/ControlsEx.js +269 -0
- package/types/src/Events/EventKey.d.ts +1 -1
- package/types/src/Events/EventKey.js +263 -0
- package/types/src/Events/EventModel.d.ts +1 -1
- package/types/src/Events/EventModel.js +380 -0
- package/types/src/Events/EventMouse.d.ts +13 -5
- package/types/src/Events/EventMouse.js +235 -0
- package/types/src/Events/Events.js +37 -0
- package/types/src/Ex/ArrayEx.d.ts +15 -0
- package/types/src/Ex/ArrayEx.js +132 -0
- package/types/src/Ex/Ex.d.ts +0 -1
- package/types/src/Ex/Ex.js +7 -0
- package/types/src/Ex/MapEx.d.ts +5 -7
- package/types/src/Ex/MapEx.js +75 -0
- package/types/src/Ex/NumberEx.d.ts +9 -0
- package/types/src/Ex/NumberEx.js +33 -0
- package/types/src/Ex/ObjectEx.d.ts +2 -0
- package/types/src/Ex/ObjectEx.js +123 -0
- package/types/src/Ex/SetEx.js +81 -0
- package/types/src/Exporter/Exporter.js +14 -0
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperBefore.d.ts +3 -2
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperBefore.js +515 -0
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperCore.d.ts +1 -1
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperCore.js +129 -0
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperSize.d.ts +2 -2
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperSize.js +59 -0
- package/types/src/Exporter/GLTFExporter/ExportGltfHelper/HelperUtils.js +144 -0
- package/types/src/Exporter/GLTFExporter/ExporterGltf.d.ts +9 -3
- package/types/src/Exporter/GLTFExporter/ExporterGltf.js +235 -0
- package/types/src/Exporter/GLTFExporter/ExporterGltfModule.d.ts +3 -3
- package/types/src/Exporter/GLTFExporter/ExporterGltfModule.js +43 -0
- package/types/src/Exporter/OBJExporter/OBJExporter.js +15 -0
- package/types/src/FileEx/FileEx.js +324 -0
- package/types/src/GlobalConfig.js +76 -0
- package/types/src/Graph/Graph.d.ts +28 -2
- package/types/src/Graph/Graph.js +848 -0
- package/types/src/Graph/GraphBase.d.ts +20 -11
- package/types/src/Graph/GraphBase.js +786 -0
- package/types/src/Graph/GraphGet.d.ts +9 -0
- package/types/src/Graph/GraphGet.js +14 -0
- package/types/src/Graph/GraphManager.d.ts +96 -0
- package/types/src/Graph/GraphManager.js +244 -0
- package/types/src/Graph/GraphMap.js +29 -0
- package/types/src/Graph/Nodes/Data/Array/ArrayModelToName.js +22 -0
- package/types/src/Graph/Nodes/Data/Array/ArrayStr.js +118 -0
- package/types/src/Graph/Nodes/Data/Array/ArrayStrFind.js +84 -0
- package/types/src/Graph/Nodes/Data/Array/ArrayStrSlice.js +52 -0
- package/types/src/Graph/Nodes/Data/Array/ArrayStrToStrs.js +21 -0
- package/types/src/Graph/Nodes/Data/Array.js +64 -0
- package/types/src/Graph/Nodes/Data/Boolean/BooleanGraph.d.ts +1 -1
- package/types/src/Graph/Nodes/Data/Boolean/BooleanGraph.js +18 -0
- package/types/src/Graph/Nodes/Data/Boolean/GetBoolean.js +58 -0
- package/types/src/Graph/Nodes/Data/Boolean/GetBooleanInput.js +101 -0
- package/types/src/Graph/Nodes/Data/Boolean/GetBooleanMap.js +125 -0
- package/types/src/Graph/Nodes/Data/Boolean/GetBooleanMapFromStr.js +121 -0
- package/types/src/Graph/Nodes/Data/Boolean/GetBooleanMapState.js +59 -0
- package/types/src/Graph/Nodes/Data/Boolean/SetBoolean.js +42 -0
- package/types/src/Graph/Nodes/Data/Boolean/SetBooleanMulti.js +89 -0
- package/types/src/Graph/Nodes/Data/Data.d.ts +1 -1
- package/types/src/Graph/Nodes/Data/Data.js +46 -0
- package/types/src/Graph/Nodes/Data/Number/NumberBetween.js +63 -0
- package/types/src/Graph/Nodes/Data/Number/NumberClearContrast.d.ts +10 -0
- package/types/src/Graph/Nodes/Data/Number/NumberClearContrast.js +36 -0
- package/types/src/Graph/Nodes/Data/Number/NumberContrast.d.ts +10 -0
- package/types/src/Graph/Nodes/Data/Number/NumberContrast.js +63 -0
- package/types/src/Graph/Nodes/Data/Number/NumberGraph.d.ts +1 -1
- package/types/src/Graph/Nodes/Data/Number/NumberGraph.js +12 -0
- package/types/src/Graph/Nodes/Data/Number/NumberProgress.d.ts +10 -0
- package/types/src/Graph/Nodes/Data/Number/NumberProgress.js +76 -0
- package/types/src/Graph/Nodes/Data/Request.js +44 -0
- package/types/src/Graph/Nodes/Data/String/StringGetGlobalReplace.js +55 -0
- package/types/src/Graph/Nodes/Data/String/StringGetGlobalReplaceStr.js +56 -0
- package/types/src/Graph/Nodes/Data/String/StringGlobalReplace.js +76 -0
- package/types/src/Graph/Nodes/Data/String/StringMatch.d.ts +7 -0
- package/types/src/Graph/Nodes/Data/String/StringMatch.js +41 -0
- package/types/src/Graph/Nodes/Data/String/StringOutput.d.ts +6 -0
- package/types/src/Graph/Nodes/Data/String/StringOutput.js +22 -0
- package/types/src/Graph/Nodes/Data/String.js +101 -0
- package/types/src/Graph/Nodes/Data/StringReplace.js +53 -0
- package/types/src/Graph/Nodes/Data/VarExec.js +66 -0
- package/types/src/Graph/Nodes/Data/VarGet.js +32 -0
- package/types/src/Graph/Nodes/Data/VarGlobal.js +47 -0
- package/types/src/Graph/Nodes/Events/EventUtils.d.ts +21 -0
- package/types/src/Graph/Nodes/Events/EventUtils.js +67 -0
- package/types/src/Graph/Nodes/Events/Events.d.ts +1 -20
- package/types/src/Graph/Nodes/Events/Events.js +47 -0
- package/types/src/Graph/Nodes/Events/EventsBase.d.ts +1 -1
- package/types/src/Graph/Nodes/Events/EventsBase.js +105 -0
- package/types/src/Graph/Nodes/Events/EventsCb.js +26 -0
- package/types/src/Graph/Nodes/Events/EventsClick.js +9 -0
- package/types/src/Graph/Nodes/Events/EventsGroup.js +26 -0
- package/types/src/Graph/Nodes/Events/EventsModelSelect.d.ts +4 -3
- package/types/src/Graph/Nodes/Events/EventsModelSelect.js +54 -0
- package/types/src/Graph/Nodes/Events/EventsModelUnSelect.d.ts +2 -2
- package/types/src/Graph/Nodes/Events/EventsModelUnSelect.js +54 -0
- package/types/src/Graph/Nodes/Events/EventsMouseIn.js +9 -0
- package/types/src/Graph/Nodes/Events/EventsMouseOut.js +9 -0
- package/types/src/Graph/Nodes/Events/EventsMultiTrigger.js +68 -0
- package/types/src/Graph/Nodes/Events/EventsOn.js +16 -0
- package/types/src/Graph/Nodes/Events/EventsRandomTrigger.js +53 -0
- package/types/src/Graph/Nodes/Events/EventsSetSubSceneState.d.ts +2 -2
- package/types/src/Graph/Nodes/Events/EventsSetSubSceneState.js +28 -0
- package/types/src/Graph/Nodes/Events/EventsState.js +35 -0
- package/types/src/Graph/Nodes/Events/EventsWheel.js +26 -0
- package/types/src/Graph/Nodes/FrameAnima/FrameAnima.d.ts +1 -1
- package/types/src/Graph/Nodes/FrameAnima/FrameAnima.js +6 -0
- package/types/src/Graph/Nodes/FrameAnima/FrameAnimaPlay.js +102 -0
- package/types/src/Graph/Nodes/Material/ChangeType.js +72 -0
- package/types/src/Graph/Nodes/Material/Material.d.ts +1 -1
- package/types/src/Graph/Nodes/Material/Material.js +8 -0
- package/types/src/Graph/Nodes/Material/MaterialSet.js +64 -0
- package/types/src/Graph/Nodes/Model/Catch/ModelCatch.js +39 -0
- package/types/src/Graph/Nodes/Model/Catch/ModelCleanCatch.js +53 -0
- package/types/src/Graph/Nodes/Model/Catch/ModelGetCatch.js +61 -0
- package/types/src/Graph/Nodes/Model/CloseLineAnima.d.ts +13 -0
- package/types/src/Graph/Nodes/Model/CloseLineAnima.js +53 -0
- package/types/src/Graph/Nodes/Model/LineAnima.d.ts +4 -0
- package/types/src/Graph/Nodes/Model/LineAnima.js +270 -0
- package/types/src/Graph/Nodes/Model/Model.d.ts +1 -1
- package/types/src/Graph/Nodes/Model/Model.js +108 -0
- package/types/src/Graph/Nodes/Model/ModelAddByModel.js +90 -0
- package/types/src/Graph/Nodes/Model/ModelAddToScene.js +36 -0
- package/types/src/Graph/Nodes/Model/ModelAnima.js +145 -0
- package/types/src/Graph/Nodes/Model/ModelChangeParent.js +50 -0
- package/types/src/Graph/Nodes/Model/ModelClone.js +44 -0
- package/types/src/Graph/Nodes/Model/ModelCloneByStr.js +65 -0
- package/types/src/Graph/Nodes/Model/ModelCreateModel.js +82 -0
- package/types/src/Graph/Nodes/Model/ModelDataProcess.js +83 -0
- package/types/src/Graph/Nodes/Model/ModelDistance.js +99 -0
- package/types/src/Graph/Nodes/Model/ModelEach.js +95 -0
- package/types/src/Graph/Nodes/Model/ModelFocus.js +27 -0
- package/types/src/Graph/Nodes/Model/ModelGetByString.js +35 -0
- package/types/src/Graph/Nodes/Model/ModelGetClear.js +20 -0
- package/types/src/Graph/Nodes/Model/ModelGetDynamicMulti.js +26 -0
- package/types/src/Graph/Nodes/Model/ModelGetMulti.js +67 -0
- package/types/src/Graph/Nodes/Model/ModelGetName.js +19 -0
- package/types/src/Graph/Nodes/Model/ModelGetParent.js +22 -0
- package/types/src/Graph/Nodes/Model/ModelGraphBase.js +9 -0
- package/types/src/Graph/Nodes/Model/ModelRemove.js +22 -0
- package/types/src/Graph/Nodes/Model/ModelReplace.js +66 -0
- package/types/src/Graph/Nodes/Model/ModelSearch.js +31 -0
- package/types/src/Graph/Nodes/Model/ModelSelect.js +25 -0
- package/types/src/Graph/Nodes/Model/ModelShow.js +70 -0
- package/types/src/Graph/Nodes/Model/ModelTags.js +54 -0
- package/types/src/Graph/Nodes/Model/ModelToggle.js +86 -0
- package/types/src/Graph/Nodes/Model/ModelVector.js +196 -0
- package/types/src/Graph/Nodes/Model/ModelVectorAnima.js +97 -0
- package/types/src/Graph/Nodes/Model/ModelVectorCatch.js +48 -0
- package/types/src/Graph/Nodes/Model/ModelVectorGetCatch.js +20 -0
- package/types/src/Graph/Nodes/Model/ModelVectorSingle.js +56 -0
- package/types/src/Graph/Nodes/Model/ModelVisible.js +109 -0
- package/types/src/Graph/Nodes/Page/Page.d.ts +4 -0
- package/types/src/Graph/Nodes/Page/Page.js +8 -0
- package/types/src/Graph/Nodes/Page/PageGet.d.ts +17 -0
- package/types/src/Graph/Nodes/Page/PageGet.js +73 -0
- package/types/src/Graph/Nodes/Page/PageTriggerCustom.d.ts +16 -0
- package/types/src/Graph/Nodes/Page/PageTriggerCustom.js +52 -0
- package/types/src/Graph/Nodes/Queue/AddToQueue.js +43 -0
- package/types/src/Graph/Nodes/Queue/BreakQueue.js +35 -0
- package/types/src/Graph/Nodes/Queue/CreateQueue.js +84 -0
- package/types/src/Graph/Nodes/Queue/Queue.d.ts +1 -1
- package/types/src/Graph/Nodes/Queue/Queue.js +11 -0
- package/types/src/Graph/Nodes/RunTime/AutoRotate.js +22 -0
- package/types/src/Graph/Nodes/RunTime/BeforeExport.js +9 -0
- package/types/src/Graph/Nodes/RunTime/Custom.js +44 -0
- package/types/src/Graph/Nodes/RunTime/FristFrame.js +9 -0
- package/types/src/Graph/Nodes/RunTime/Loaded.js +9 -0
- package/types/src/Graph/Nodes/RunTime/PauseAutoRotate.js +22 -0
- package/types/src/Graph/Nodes/RunTime/PointerDown.js +26 -0
- package/types/src/Graph/Nodes/RunTime/PointerUp.js +26 -0
- package/types/src/Graph/Nodes/RunTime/Run.js +13 -0
- package/types/src/Graph/Nodes/RunTime/RunTime.d.ts +1 -10
- package/types/src/Graph/Nodes/RunTime/RunTime.js +96 -0
- package/types/src/Graph/Nodes/RunTime/RunTimeBase.d.ts +1 -0
- package/types/src/Graph/Nodes/RunTime/RunTimeBase.js +29 -0
- package/types/src/Graph/Nodes/RunTime/RunTimeUtils.d.ts +12 -0
- package/types/src/Graph/Nodes/RunTime/RunTimeUtils.js +34 -0
- package/types/src/Graph/Nodes/RunTime/Stop.js +13 -0
- package/types/src/Graph/Nodes/RunTime/TimelineLoaded.js +9 -0
- package/types/src/Graph/Nodes/RunTime/TriggerCustom.js +65 -0
- package/types/src/Graph/Nodes/Scene/Camera/Camera.d.ts +1 -1
- package/types/src/Graph/Nodes/Scene/Camera/Camera.js +21 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraConfigSet.js +33 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraFlow.d.ts +8 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraFlow.js +38 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraFlowOnce.d.ts +8 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraFlowOnce.js +45 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraInfo.js +25 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraTempClose.js +14 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraTempPlay.js +67 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraTempStrs.d.ts +6 -0
- package/types/src/Graph/Nodes/Scene/Camera/CameraTempStrs.js +18 -0
- package/types/src/Graph/Nodes/Scene/Controls/Controls.d.ts +1 -1
- package/types/src/Graph/Nodes/Scene/Controls/Controls.js +10 -0
- package/types/src/Graph/Nodes/Scene/Controls/Touch.js +27 -0
- package/types/src/Graph/Nodes/Scene/Controls/Wheel.js +24 -0
- package/types/src/Graph/Nodes/Scene/FrameControls.js +54 -0
- package/types/src/Graph/Nodes/Scene/Pp/Pp.d.ts +1 -1
- package/types/src/Graph/Nodes/Scene/Pp/Pp.js +10 -0
- package/types/src/Graph/Nodes/Scene/Pp/PpSetAo.js +26 -0
- package/types/src/Graph/Nodes/Scene/Scene.d.ts +1 -1
- package/types/src/Graph/Nodes/Scene/Scene.js +18 -0
- package/types/src/Graph/Nodes/Scene/SceneAnima.js +140 -0
- package/types/src/Graph/Nodes/Scene/SceneEnvMode.js +26 -0
- package/types/src/Graph/Nodes/Scene/SceneState.d.ts +7 -0
- package/types/src/Graph/Nodes/Scene/SceneState.js +19 -0
- package/types/src/Graph/Nodes/Script/Script.d.ts +1 -1
- package/types/src/Graph/Nodes/Script/Script.js +10 -0
- package/types/src/Graph/Nodes/Script/ScriptLineAnima.d.ts +1 -0
- package/types/src/Graph/Nodes/Script/ScriptLineAnima.js +74 -0
- package/types/src/Graph/Nodes/Script/ScriptPlay.js +25 -0
- package/types/src/Graph/Nodes/Script/ScriptSetLineAnimaProgress.d.ts +9 -0
- package/types/src/Graph/Nodes/Script/ScriptSetLineAnimaProgress.js +37 -0
- package/types/src/Graph/Nodes/Snapshot/Snapshot.d.ts +1 -1
- package/types/src/Graph/Nodes/Snapshot/Snapshot.js +10 -0
- package/types/src/Graph/Nodes/Snapshot/SnapshotClose.js +14 -0
- package/types/src/Graph/Nodes/Snapshot/SnapshotPlay.js +101 -0
- package/types/src/Graph/Nodes/Snapshot/SnapshotStrs.d.ts +6 -0
- package/types/src/Graph/Nodes/Snapshot/SnapshotStrs.js +18 -0
- package/types/src/Graph/Nodes/StateMachine/ClearState.js +42 -0
- package/types/src/Graph/Nodes/StateMachine/CreateStateMachine.js +80 -0
- package/types/src/Graph/Nodes/StateMachine/SetMachineTrigger.js +88 -0
- package/types/src/Graph/Nodes/StateMachine/SetState.js +86 -0
- package/types/src/Graph/Nodes/StateMachine/StateMachine.d.ts +1 -1
- package/types/src/Graph/Nodes/StateMachine/StateMachine.js +12 -0
- package/types/src/Graph/Nodes/Texture/Texture.d.ts +1 -1
- package/types/src/Graph/Nodes/Texture/Texture.js +12 -0
- package/types/src/Graph/Nodes/Texture/TextureApngAnima.js +69 -0
- package/types/src/Graph/Nodes/Texture/TextureNode.js +59 -0
- package/types/src/Graph/Nodes/Texture/TextureScript.js +50 -0
- package/types/src/Graph/Nodes/Texture/TextureVectorAnima.d.ts +10 -0
- package/types/src/Graph/Nodes/Texture/TextureVectorAnima.js +59 -0
- package/types/src/Graph/Nodes/Timeline/TimeLine.d.ts +1 -1
- package/types/src/Graph/Nodes/Timeline/TimeLine.js +10 -0
- package/types/src/Graph/Nodes/Timeline/TimeLineClose.js +15 -0
- package/types/src/Graph/Nodes/Timeline/TimeLinePlay.js +96 -0
- package/types/src/Graph/Nodes/Tools/Debug.js +16 -0
- package/types/src/Graph/Nodes/Tools/EndCall.js +16 -0
- package/types/src/Graph/Nodes/Tools/Func/Func.d.ts +1 -0
- package/types/src/Graph/Nodes/Tools/Func/Func.js +41 -0
- package/types/src/Graph/Nodes/Tools/Func/FuncInputModel.d.ts +1 -1
- package/types/src/Graph/Nodes/Tools/Func/FuncInputModel.js +16 -0
- package/types/src/Graph/Nodes/Tools/Func/FuncNode.js +37 -0
- package/types/src/Graph/Nodes/Tools/Func/FuncOutputModel.js +46 -0
- package/types/src/Graph/Nodes/Tools/Func/TriggerFunc.js +147 -0
- package/types/src/Graph/Nodes/Tools/GetNodeEnd.d.ts +2 -0
- package/types/src/Graph/Nodes/Tools/GetNodeEnd.js +28 -0
- package/types/src/Graph/Nodes/Tools/Notice/NoticeEmit.d.ts +1 -0
- package/types/src/Graph/Nodes/Tools/Notice/NoticeEmit.js +39 -0
- package/types/src/Graph/Nodes/Tools/Notice/NoticeOn.js +25 -0
- package/types/src/Graph/Nodes/Tools/StopNode.js +21 -0
- package/types/src/Graph/Nodes/Tools/Tools.d.ts +1 -1
- package/types/src/Graph/Nodes/Tools/Tools.js +26 -0
- package/types/src/Graph/Nodes/TriggerWay/Delay.js +67 -0
- package/types/src/Graph/Nodes/TriggerWay/Loop.js +66 -0
- package/types/src/Graph/Nodes/TriggerWay/TriggerWay.d.ts +1 -1
- package/types/src/Graph/Nodes/TriggerWay/TriggerWay.js +8 -0
- package/types/src/Graph/Nodes/Ui/Button.js +135 -0
- package/types/src/Graph/Nodes/Ui/DelButton.js +38 -0
- package/types/src/Graph/Nodes/Ui/MobileButtons.js +108 -0
- package/types/src/Graph/Nodes/Ui/Pop.js +36 -0
- package/types/src/Graph/Nodes/Ui/Ui.d.ts +1 -1
- package/types/src/Graph/Nodes/Ui/Ui.js +12 -0
- package/types/src/Helper/HelperEx.js +115 -0
- package/types/src/Helper/MTTransformControls.js +426 -0
- package/types/src/Helper/TransContaro.d.ts +1 -1
- package/types/src/Helper/TransContaro.js +212 -0
- package/types/src/Helper/ViewHelper.js +85 -0
- package/types/src/Libs/Bus.js +22 -0
- package/types/src/Libs/MultiSelect.js +80 -0
- package/types/src/Libs/Three.js +3 -0
- package/types/src/Lights/AmbientLightEx.d.ts +3 -3
- package/types/src/Lights/AmbientLightEx.js +88 -0
- package/types/src/Lights/BaseLightEx.d.ts +4 -4
- package/types/src/Lights/BaseLightEx.js +11 -0
- package/types/src/Lights/DirectionalLightEx.d.ts +2 -2
- package/types/src/Lights/DirectionalLightEx.js +257 -0
- package/types/src/Lights/HemisphereLightEx.d.ts +2 -2
- package/types/src/Lights/HemisphereLightEx.js +64 -0
- package/types/src/Lights/LightEx.d.ts +2 -4
- package/types/src/Lights/LightEx.js +435 -0
- package/types/src/Lights/PointLightEx.js +94 -0
- package/types/src/Lights/RectAreaLightEx.js +63 -0
- package/types/src/Lights/SpotLightEx.js +101 -0
- package/types/src/Loaderer/AnimaLoader.js +9 -0
- package/types/src/Loaderer/GLTFLoader/GLTFLoaderEx.d.ts +1 -1
- package/types/src/Loaderer/GLTFLoader/GLTFLoaderEx.js +134 -0
- package/types/src/Loaderer/GLTFLoader/LoaderGltf/LoaderGltfCore.d.ts +5 -5
- package/types/src/Loaderer/GLTFLoader/LoaderGltf/LoaderGltfCore.js +262 -0
- package/types/src/Loaderer/GLTFLoader/LoaderGltf/LoaderOptions.d.ts +2 -2
- package/types/src/Loaderer/GLTFLoader/LoaderGltf/LoaderOptions.js +23 -0
- package/types/src/Loaderer/GLTFLoader/LoaderGltf.d.ts +7 -5
- package/types/src/Loaderer/GLTFLoader/LoaderGltf.js +303 -0
- package/types/src/Loaderer/JsonModelLoader/JsonModelLoader.d.ts +1 -1
- package/types/src/Loaderer/JsonModelLoader/JsonModelLoader.js +58 -0
- package/types/src/Loaderer/Loaderer.js +34 -0
- package/types/src/LtPostProcessing/BaseLtPostProcessing.d.ts +5 -4
- package/types/src/LtPostProcessing/BaseLtPostProcessing.js +327 -0
- package/types/src/LtPostProcessing/BrightnessContrast.d.ts +3 -3
- package/types/src/LtPostProcessing/BrightnessContrast.js +94 -0
- package/types/src/LtPostProcessing/DOF.d.ts +3 -3
- package/types/src/LtPostProcessing/DOF.js +97 -0
- package/types/src/LtPostProcessing/HueSaturation.d.ts +3 -3
- package/types/src/LtPostProcessing/HueSaturation.js +71 -0
- package/types/src/LtPostProcessing/LtPostProcessing.d.ts +4 -11
- package/types/src/LtPostProcessing/LtPostProcessing.js +316 -0
- package/types/src/LtPostProcessing/LtppUtils.d.ts +11 -0
- package/types/src/LtPostProcessing/LtppUtils.js +6 -0
- package/types/src/LtPostProcessing/Lut.d.ts +4 -3
- package/types/src/LtPostProcessing/Lut.js +257 -0
- package/types/src/LtPostProcessing/Moon.d.ts +3 -3
- package/types/src/LtPostProcessing/Moon.js +229 -0
- package/types/src/LtPostProcessing/Outline.d.ts +104 -3
- package/types/src/LtPostProcessing/Outline.js +294 -0
- package/types/src/LtPostProcessing/SMAA.d.ts +92 -0
- package/types/src/LtPostProcessing/SMAA.js +68 -0
- package/types/src/LtPostProcessing/SSAO.d.ts +3 -3
- package/types/src/LtPostProcessing/SSAO.js +431 -0
- package/types/src/LtPostProcessing/SelectiveBloom.d.ts +3 -3
- package/types/src/LtPostProcessing/SelectiveBloom.js +222 -0
- package/types/src/LtPostProcessing/Sun.d.ts +3 -3
- package/types/src/LtPostProcessing/Sun.js +256 -0
- package/types/src/LtPostProcessing/ToneMapping.d.ts +3 -3
- package/types/src/LtPostProcessing/ToneMapping.js +125 -0
- package/types/src/Material/Assets/BaseShader.js +123 -0
- package/types/src/Material/Def.MaterialEx.d.ts +5 -54
- package/types/src/Material/Def.MaterialEx.js +114 -0
- package/types/src/Material/ExportAndImport/ImportMaterial.d.ts +5 -5
- package/types/src/Material/ExportAndImport/ImportMaterial.js +344 -0
- package/types/src/Material/MaterialBaseUtils.d.ts +6 -0
- package/types/src/Material/MaterialBaseUtils.js +28 -0
- package/types/src/Material/MaterialClipping.d.ts +1 -1
- package/types/src/Material/MaterialClipping.js +344 -0
- package/types/src/Material/MaterialDefConst.d.ts +39 -0
- package/types/src/Material/MaterialDefConst.js +129 -0
- package/types/src/Material/MaterialDefMap.d.ts +43 -0
- package/types/src/Material/MaterialDefMap.js +47 -0
- package/types/src/Material/MaterialDefType.d.ts +94 -0
- package/types/src/Material/MaterialDefType.js +1 -0
- package/types/src/Material/MaterialEx.d.ts +15 -77
- package/types/src/Material/MaterialEx.js +505 -0
- package/types/src/Material/MaterialRegistry.d.ts +40 -0
- package/types/src/Material/MaterialRegistry.js +124 -0
- package/types/src/Material/MaterialSnapshot.d.ts +1 -1
- package/types/src/Material/MaterialSnapshot.js +102 -0
- package/types/src/Material/MaterialUtils.d.ts +17 -0
- package/types/src/Material/MaterialUtils.js +86 -0
- package/types/src/Material/MyShaderMaterial.js +16 -0
- package/types/src/Material/defMaterial/BasicMaterial.d.ts +3 -119
- package/types/src/Material/defMaterial/BasicMaterial.js +245 -0
- package/types/src/Material/defMaterial/BasicMaterialUtils.d.ts +32 -0
- package/types/src/Material/defMaterial/BasicMaterialUtils.js +66 -0
- package/types/src/Material/defMaterial/ExMaterial/ExMaterialAssets.d.ts +6 -21
- package/types/src/Material/defMaterial/ExMaterial/ExMaterialAssets.js +929 -0
- package/types/src/Material/defMaterial/ExMaterial/ExMaterialAssetsType.d.ts +16 -0
- package/types/src/Material/defMaterial/ExMaterial/ExMaterialAssetsType.js +1 -0
- package/types/src/Material/defMaterial/ExMaterial/sweepWave.d.ts +1 -1
- package/types/src/Material/defMaterial/ExMaterial/sweepWave.js +396 -0
- package/types/src/Material/defMaterial/ExMaterial/test.d.ts +1 -1
- package/types/src/Material/defMaterial/ExMaterial/test.js +239 -0
- package/types/src/Material/defMaterial/ExMaterial.d.ts +2 -2
- package/types/src/Material/defMaterial/ExMaterial.js +267 -0
- package/types/src/Material/defMaterial/FakeInterior.d.ts +1 -1
- package/types/src/Material/defMaterial/FakeInterior.js +314 -0
- package/types/src/Material/defMaterial/Fresnel.d.ts +2 -2
- package/types/src/Material/defMaterial/Fresnel.js +370 -0
- package/types/src/Material/defMaterial/LineBasicMaterial.d.ts +3 -3
- package/types/src/Material/defMaterial/LineBasicMaterial.js +109 -0
- package/types/src/Material/defMaterial/Matcap.d.ts +2 -2
- package/types/src/Material/defMaterial/Matcap.js +228 -0
- package/types/src/Material/defMaterial/MeshReflectorMaterial.js +231 -0
- package/types/src/Material/defMaterial/MixTexture.d.ts +2 -2
- package/types/src/Material/defMaterial/MixTexture.js +539 -0
- package/types/src/Material/defMaterial/MyMeshLambertMaterial.d.ts +2 -1
- package/types/src/Material/defMaterial/MyMeshLambertMaterial.js +214 -0
- package/types/src/Material/defMaterial/MyMeshPhongMaterial.d.ts +2 -1
- package/types/src/Material/defMaterial/MyMeshPhongMaterial.js +186 -0
- package/types/src/Material/defMaterial/MyPointsMaterial.d.ts +1 -1
- package/types/src/Material/defMaterial/MyPointsMaterial.js +104 -0
- package/types/src/Material/defMaterial/MySpriteMaterial.d.ts +5 -5
- package/types/src/Material/defMaterial/MySpriteMaterial.js +206 -0
- package/types/src/Material/defMaterial/Physical.d.ts +2 -2
- package/types/src/Material/defMaterial/Physical.js +312 -0
- package/types/src/Material/defMaterial/Reflector.d.ts +1 -1
- package/types/src/Material/defMaterial/Reflector.js +544 -0
- package/types/src/Material/defMaterial/SkyBox.d.ts +2 -2
- package/types/src/Material/defMaterial/SkyBox.js +241 -0
- package/types/src/Material/defMaterial/TreeLeaf.d.ts +2 -2
- package/types/src/Material/defMaterial/TreeLeaf.js +336 -0
- package/types/src/Material/defMaterial/Weather.d.ts +2 -2
- package/types/src/Material/defMaterial/Weather.js +369 -0
- package/types/src/ModelEx/ExportAndImport/ExportModel.js +9 -0
- package/types/src/ModelEx/ExportAndImport/ImportModel.d.ts +2 -7
- package/types/src/ModelEx/ExportAndImport/ImportModel.js +328 -0
- package/types/src/ModelEx/ModelEx.CamFlow.js +226 -0
- package/types/src/ModelEx/ModelEx.Clone.js +70 -0
- package/types/src/ModelEx/ModelEx.Utils.d.ts +79 -0
- package/types/src/ModelEx/ModelEx.Utils.js +411 -0
- package/types/src/ModelEx/ModelEx.d.ts +5 -104
- package/types/src/ModelEx/ModelEx.js +1601 -0
- package/types/src/ModelEx/ModelExDef/GroundProjected/GroundProjected.d.ts +1 -1
- package/types/src/ModelEx/ModelExDef/GroundProjected/GroundProjected.js +178 -0
- package/types/src/ModelEx/ModelExDef/GroundProjected/MyGroundProjectedEnv.js +18 -0
- package/types/src/ModelEx/ModelExDef/InstanceHelper.d.ts +14 -6
- package/types/src/ModelEx/ModelExDef/InstanceHelper.js +398 -0
- package/types/src/ModelEx/ModelExDef/InstanceModel.d.ts +7 -5
- package/types/src/ModelEx/ModelExDef/InstanceModel.js +479 -0
- package/types/src/ModelEx/ModelExDef/Lod.d.ts +5 -4
- package/types/src/ModelEx/ModelExDef/Lod.js +139 -0
- package/types/src/ModelEx/ModelExDef/ModelBase/ModelBaseSnapshot.d.ts +1 -1
- package/types/src/ModelEx/ModelExDef/ModelBase/ModelBaseSnapshot.js +25 -0
- package/types/src/ModelEx/ModelExDef/ModelBase.d.ts +2 -14
- package/types/src/ModelEx/ModelExDef/ModelBase.js +43 -0
- package/types/src/ModelEx/ModelExDef/ModelBaseType.d.ts +15 -0
- package/types/src/ModelEx/ModelExDef/ModelBaseType.js +1 -0
- package/types/src/ModelEx/ModelExDef/ModelConstType.d.ts +7 -0
- package/types/src/ModelEx/ModelExDef/ModelConstType.js +1 -0
- package/types/src/ModelEx/ModelExDef/ModelContant.d.ts +4 -3
- package/types/src/ModelEx/ModelExDef/ModelContant.js +14 -0
- package/types/src/ModelEx/ModelExDef/ModelExDef.d.ts +4 -5
- package/types/src/ModelEx/ModelExDef/ModelExDef.js +58 -0
- package/types/src/ModelEx/ModelExDef/ModelRegistry.d.ts +20 -0
- package/types/src/ModelEx/ModelExDef/ModelRegistry.js +39 -0
- package/types/src/ModelEx/ModelExDef/Vertices/Vertices.js +7 -0
- package/types/src/ModelEx/ModelExDef/Vertices/VerticesRain.d.ts +7 -6
- package/types/src/ModelEx/ModelExDef/Vertices/VerticesRain.js +252 -0
- package/types/src/ModelEx/ModelExDef/WaterModel.d.ts +3 -3
- package/types/src/ModelEx/ModelExDef/WaterModel.js +323 -0
- package/types/src/ModelEx/ModelExSnapshot.d.ts +1 -14
- package/types/src/ModelEx/ModelExSnapshot.js +312 -0
- package/types/src/ModelEx/ModelInstance.d.ts +1 -1
- package/types/src/ModelEx/ModelInstance.js +64 -0
- package/types/src/ModelEx/ModelSnapshotConst.d.ts +5 -0
- package/types/src/ModelEx/ModelSnapshotConst.js +78 -0
- package/types/src/ModelEx/ModelType.d.ts +27 -0
- package/types/src/ModelEx/ModelType.js +7 -0
- package/types/src/Msg.d.ts +1 -1
- package/types/src/Msg.js +35 -0
- package/types/src/MultipSelector/MultipSelector.d.ts +4 -2
- package/types/src/MultipSelector/MultipSelector.js +374 -0
- package/types/src/Objects/Objects.js +19 -0
- package/types/src/Objects/Sky/SkyLight.js +49 -0
- package/types/src/Objects/Sky.d.ts +5 -4
- package/types/src/Objects/Sky.js +673 -0
- package/types/src/OptionsEx.d.ts +3 -2
- package/types/src/OptionsEx.js +182 -0
- package/types/src/PostProcessing/AmbientOcclusion/BlueNoiseGenerator.js +91 -0
- package/types/src/PostProcessing/AmbientOcclusion/BlueNoiseSamples.js +135 -0
- package/types/src/PostProcessing/AmbientOcclusion/CompositeShader.js +263 -0
- package/types/src/PostProcessing/AmbientOcclusion/DebugShaders.js +142 -0
- package/types/src/PostProcessing/AmbientOcclusion/ExtendedShaderMaterial.js +20 -0
- package/types/src/PostProcessing/AmbientOcclusion/GTAOPass.js +273 -0
- package/types/src/PostProcessing/AmbientOcclusion/GTAOShader.js +295 -0
- package/types/src/PostProcessing/AmbientOcclusion/LinearDepthPass.js +113 -0
- package/types/src/PostProcessing/AmbientOcclusion/MTAO.d.ts +1 -1
- package/types/src/PostProcessing/AmbientOcclusion/MTAO.js +63 -0
- package/types/src/PostProcessing/AmbientOcclusion/NormalPass.js +75 -0
- package/types/src/PostProcessing/AmbientOcclusion/RendererState.js +55 -0
- package/types/src/PostProcessing/AmbientOcclusion/ShaderReplacement.js +194 -0
- package/types/src/PostProcessing/AmbientOcclusion/WrappedShaderMaterial.js +66 -0
- package/types/src/PostProcessing/AmbientOcclusion/utils.js +14 -0
- package/types/src/PostProcessing/Glow/GlowEffectShader.js +29 -0
- package/types/src/PostProcessing/Glow/GlowMTU.d.ts +1 -1
- package/types/src/PostProcessing/Glow/GlowMTU.js +155 -0
- package/types/src/PostProcessing/Glow/GlowThree.d.ts +1 -1
- package/types/src/PostProcessing/Glow/GlowThree.js +142 -0
- package/types/src/PostProcessing/Glow/GlowThreeShader.js +21 -0
- package/types/src/PostProcessing/Glow/MTMixShaderPass.js +50 -0
- package/types/src/PostProcessing/Glow/MTRenderPass.js +62 -0
- package/types/src/PostProcessing/MTPostProcessing.d.ts +1 -1
- package/types/src/PostProcessing/MTPostProcessing.js +496 -0
- package/types/src/PostProcessing/Outline/MTOutline.d.ts +2 -1
- package/types/src/PostProcessing/Outline/MTOutline.js +100 -0
- package/types/src/PostProcessing/PPInfo.js +93 -0
- package/types/src/PostProcessing/PPSnapshot.d.ts +1 -1
- package/types/src/PostProcessing/PPSnapshot.js +238 -0
- package/types/src/Render/Css2dDom.js +26 -0
- package/types/src/Render/Css3dDom.js +46 -0
- package/types/src/Render/Css3dSprite.js +28 -0
- package/types/src/Render/CssRenderBase.js +289 -0
- package/types/src/Render/Render.d.ts +1 -11
- package/types/src/Render/Render.js +182 -0
- package/types/src/Render/RenderUtils.d.ts +12 -0
- package/types/src/Render/RenderUtils.js +20 -0
- package/types/src/Render/ShadowManaer.js +68 -0
- package/types/src/Run/Run.js +3 -0
- package/types/src/Run/RunBase.js +50 -0
- package/types/src/RunScene.d.ts +5 -4
- package/types/src/RunScene.js +471 -0
- package/types/src/Scene/ExportAndImport.d.ts +6 -5
- package/types/src/Scene/ExportAndImport.js +220 -0
- package/types/src/Scene/SceneSnapshot.d.ts +1 -1
- package/types/src/Scene/SceneSnapshot.js +195 -0
- package/types/src/Scene/SceneUtils.d.ts +27 -0
- package/types/src/Scene/SceneUtils.js +21 -0
- package/types/src/SceneEx.d.ts +10 -27
- package/types/src/SceneEx.js +608 -0
- package/types/src/Script/Script.d.ts +7 -0
- package/types/src/Script/Script.js +99 -0
- package/types/src/Script/ScriptCreator.js +88 -0
- package/types/src/Script/ScriptLineAnima.d.ts +14 -2
- package/types/src/Script/ScriptLineAnima.js +339 -0
- package/types/src/Script/ScriptLookAt.js +61 -0
- package/types/src/Script/ScriptTexture.d.ts +2 -4
- package/types/src/Script/ScriptTexture.js +87 -0
- package/types/src/Shader/GaussBlurShader.js +114 -0
- package/types/src/Shader/LeafShader.js +279 -0
- package/types/src/Shader/MixTextureShader.js +181 -0
- package/types/src/Shader/NoiseUtils.js +170 -0
- package/types/src/Shader/ShaderUtils.js +91 -0
- package/types/src/Shader/WeatherShader.js +220 -0
- package/types/src/Size.js +54 -0
- package/types/src/Snapshot/BaseSnapshot.d.ts +14 -1
- package/types/src/Snapshot/BaseSnapshot.js +47 -0
- package/types/src/Snapshot/ConstantSnapshot.d.ts +3 -2
- package/types/src/Snapshot/ConstantSnapshot.js +22 -0
- package/types/src/Snapshot/Snapshot.d.ts +2 -112
- package/types/src/Snapshot/Snapshot.js +726 -0
- package/types/src/Snapshot/SnapshotType.d.ts +98 -0
- package/types/src/Snapshot/SnapshotType.js +29 -0
- package/types/src/Snapshot/SnapshotUtils.d.ts +23 -0
- package/types/src/Snapshot/SnapshotUtils.js +152 -0
- package/types/src/SubScene/Graph/SubSceneGet.js +57 -0
- package/types/src/SubScene/Graph/SubSceneSetState.js +59 -0
- package/types/src/SubScene/Graph/SubSceneTriggerBtn.js +66 -0
- package/types/src/SubScene/Graph/SubSceneTriggerLoad.js +56 -0
- package/types/src/SubScene/SubScene.d.ts +2 -0
- package/types/src/SubScene/SubScene.js +151 -0
- package/types/src/SubScene/SubSceneBase.d.ts +1 -0
- package/types/src/SubScene/SubSceneBase.js +232 -0
- package/types/src/Tags.js +107 -0
- package/types/src/Texture/TextureEx.d.ts +4 -151
- package/types/src/Texture/TextureEx.js +694 -0
- package/types/src/Texture/TextureMsg.js +56 -0
- package/types/src/Texture/TextureMultip.js +55 -0
- package/types/src/Texture/TextureSnapshot.d.ts +1 -1
- package/types/src/Texture/TextureSnapshot.js +157 -0
- package/types/src/Texture/TextureUtils.d.ts +153 -0
- package/types/src/Texture/TextureUtils.js +517 -0
- package/types/src/TimeLine/TimeLine.Camera.d.ts +1 -1
- package/types/src/TimeLine/TimeLine.Camera.js +261 -0
- package/types/src/TimeLine/TimeLine.ExportAndImport.js +35 -0
- package/types/src/TimeLine/TimeLine.LineMaterial.js +32 -0
- package/types/src/TimeLine/TimeLine.Material.d.ts +33 -0
- package/types/src/TimeLine/TimeLine.Material.js +41 -0
- package/types/src/TimeLine/TimeLine.Model.d.ts +1 -1
- package/types/src/TimeLine/TimeLine.Model.js +269 -0
- package/types/src/TimeLine/TimeLine.Multi.js +6 -0
- package/types/src/TimeLine/TimeLine.Texture.js +39 -0
- package/types/src/TimeLine/TimeLine.d.ts +4 -16
- package/types/src/TimeLine/TimeLine.js +578 -0
- package/types/src/TimeLine/TimeLineBase.d.ts +1 -1
- package/types/src/TimeLine/TimeLineBase.js +486 -0
- package/types/src/TimeLine/TimeLineUtils.d.ts +12 -0
- package/types/src/TimeLine/TimeLineUtils.js +12 -0
- package/types/src/Types/Engine.d.ts +0 -2
- package/types/src/Types/Engine.js +30 -0
- package/types/src/Types/type.js +1 -0
- package/types/src/Undo/Undo.js +137 -0
- package/types/src/Undo/UndoAdd.js +36 -0
- package/types/src/Undo/UndoAddAndRemove.js +60 -0
- package/types/src/Undo/UndoBase.js +2 -0
- package/types/src/Undo/UndoFunc.js +22 -0
- package/types/src/Undo/UndoMaterial.js +45 -0
- package/types/src/Undo/UndoMultiLevel.js +58 -0
- package/types/src/Undo/UndoNormal.js +98 -0
- package/types/src/Undo/UndoParent.js +37 -0
- package/types/src/Undo/UndoRemove.js +33 -0
- package/types/src/Undo/UndoV3.d.ts +1 -1
- package/types/src/Undo/UndoV3.js +58 -0
- package/types/src/Unique/Unique.d.ts +0 -4
- package/types/src/Unique/Unique.js +25 -0
- package/types/src/Unique/UniqueBase.d.ts +1 -1
- package/types/src/Unique/UniqueBase.js +28 -0
- package/types/src/Unique/UniqueGeometry.d.ts +2 -2
- package/types/src/Unique/UniqueGeometry.js +264 -0
- package/types/src/Unique/UniqueMaterial.d.ts +2 -1
- package/types/src/Unique/UniqueMaterial.js +153 -0
- package/types/src/Unique/UniqueModel.d.ts +4 -2
- package/types/src/Unique/UniqueModel.js +302 -0
- package/types/src/Unique/UniqueTexture.d.ts +2 -1
- package/types/src/Unique/UniqueTexture.js +206 -0
- package/types/src/Unique/UniqueUtils.d.ts +4 -0
- package/types/src/Unique/UniqueUtils.js +22 -0
- package/types/src/Utils/Utils.js +7 -0
- package/types/src/Utils/UtilsAnima.js +69 -0
- package/types/src/Utils/UtilsCamera.d.ts +2 -0
- package/types/src/Utils/UtilsCamera.js +3 -0
- package/types/src/Utils/UtilsDom.d.ts +1 -0
- package/types/src/Utils/UtilsDom.js +31 -0
- package/types/src/Utils/UtilsHTML.js +15 -0
- package/types/src/Utils/UtilsImage.d.ts +0 -1
- package/types/src/Utils/UtilsImage.js +244 -0
- package/types/src/Utils/UtilsJs.d.ts +2 -0
- package/types/src/Utils/UtilsJs.js +898 -0
- package/types/src/Utils/UtilsLight.d.ts +3 -0
- package/types/src/Utils/UtilsLight.js +12 -0
- package/types/src/Utils/UtilsRunScene.js +23 -0
- package/types/src/Utils/UtilsThree/material.constant.js +211 -0
- package/types/src/Utils/UtilsThree.d.ts +9 -0
- package/types/src/Utils/UtilsThree.js +836 -0
- /package/types/src/Graph/Nodes/Scene/Pp/{PpGetEvents.d.ts → PpSetAo.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run-scene-v2",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.97",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
"lodash": "^4.17.21",
|
|
10
10
|
"postprocessing": "6.35.5",
|
|
11
11
|
"run-scene-core": "0.165.1",
|
|
12
|
-
"
|
|
13
|
-
"simple-bool": "^3.0.1",
|
|
14
|
-
"three": "0.165.0",
|
|
15
|
-
"three-volumetric-pass-fork": "^0.1.0"
|
|
12
|
+
"three": "0.165.0"
|
|
16
13
|
},
|
|
17
14
|
"types": "./types/index.d.ts",
|
|
18
15
|
"files": [
|
package/types/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TransformControls } from "run-scene-core/examples/jsm/controls/TransformControls";
|
|
2
2
|
import RunScene, { Utils, ModelEx, MaterialEx, TextureEx, Bus } from "./src/RunScene";
|
|
3
|
+
import Three from "./src/Libs/Three";
|
|
3
4
|
declare const _default: {
|
|
4
5
|
RunScene: typeof RunScene;
|
|
5
6
|
Utils: typeof Utils;
|
|
6
7
|
ModelEx: typeof ModelEx;
|
|
7
8
|
MaterialEx: typeof MaterialEx;
|
|
8
9
|
TextureEx: typeof TextureEx;
|
|
9
|
-
Three: typeof
|
|
10
|
+
Three: typeof Three;
|
|
10
11
|
ThreeEx: {
|
|
11
12
|
TransformControls: typeof TransformControls;
|
|
12
13
|
};
|
package/types/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TransformControls } from "run-scene-core/examples/jsm/controls/TransformControls";
|
|
2
|
+
import RunScene, { Utils, ModelEx, MaterialEx, TextureEx, Bus, } from "./src/RunScene";
|
|
3
|
+
import Three from "./src/Libs/Three";
|
|
4
|
+
export default {
|
|
5
|
+
RunScene,
|
|
6
|
+
Utils,
|
|
7
|
+
ModelEx,
|
|
8
|
+
MaterialEx,
|
|
9
|
+
TextureEx,
|
|
10
|
+
Three,
|
|
11
|
+
ThreeEx: {
|
|
12
|
+
TransformControls,
|
|
13
|
+
},
|
|
14
|
+
Bus,
|
|
15
|
+
};
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { mapObj } from "js-funcs";
|
|
2
|
+
import { getId } from "js-funcs";
|
|
3
|
+
import { AnimationMixer, Clock, } from "run-scene-core";
|
|
4
|
+
import BaseEx from "../BaseEx";
|
|
5
|
+
import { animaLoader } from "../Loaderer/Loaderer";
|
|
6
|
+
import Three from "../Libs/Three";
|
|
7
|
+
import { getProgress, mergeObject } from "../Utils/Utils";
|
|
8
|
+
import BindEvent from "../CallBack/BindEvent";
|
|
9
|
+
import _ from "lodash";
|
|
10
|
+
import { withAnima } from "../ModelEx/ModelEx.Utils";
|
|
11
|
+
export default class Anima extends BaseEx {
|
|
12
|
+
constructor(runScene) {
|
|
13
|
+
super(runScene);
|
|
14
|
+
this.map = {};
|
|
15
|
+
this.clock = new Clock();
|
|
16
|
+
this.tickIndex = undefined;
|
|
17
|
+
this.playings = new Set();
|
|
18
|
+
this.updates = {};
|
|
19
|
+
this.clean = () => {
|
|
20
|
+
this.reset();
|
|
21
|
+
};
|
|
22
|
+
runScene.cb.model.add.add("anima-parse", ({ model }) => {
|
|
23
|
+
this.parses(model);
|
|
24
|
+
});
|
|
25
|
+
runScene.cb.model.remove.add("anima-parse", ({ model }) => {
|
|
26
|
+
this.onModelDelete(model);
|
|
27
|
+
});
|
|
28
|
+
runScene.cb.scene.validCloseUpdate.on(() => {
|
|
29
|
+
return this.playings.size === 0;
|
|
30
|
+
});
|
|
31
|
+
this.runScene.cb.clean.add("EngineHelper", this.clean);
|
|
32
|
+
}
|
|
33
|
+
onModelDelete(model) {
|
|
34
|
+
model.traverse((child) => {
|
|
35
|
+
if (!withAnima(child))
|
|
36
|
+
return;
|
|
37
|
+
child.animations.map((clip) => {
|
|
38
|
+
if (!clip.id)
|
|
39
|
+
return;
|
|
40
|
+
this.close(child, clip.name);
|
|
41
|
+
delete this.map[clip.id];
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
parses(model) {
|
|
46
|
+
model.traverse((child) => this.parse(child));
|
|
47
|
+
}
|
|
48
|
+
findId(model, name) {
|
|
49
|
+
for (const clip of model.animations) {
|
|
50
|
+
if (clip.name === name)
|
|
51
|
+
return clip.id;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
parse(model, clipsJSON) {
|
|
55
|
+
if (model.animations.length === 0 && !clipsJSON)
|
|
56
|
+
return;
|
|
57
|
+
const clips = model.animations.length
|
|
58
|
+
? model.animations
|
|
59
|
+
: animaLoader.parse(clipsJSON);
|
|
60
|
+
const mixer = new AnimationMixer(model);
|
|
61
|
+
for (const clip of clips) {
|
|
62
|
+
const id = getId();
|
|
63
|
+
clip.id = id;
|
|
64
|
+
var action = mixer.clipAction(clip);
|
|
65
|
+
const eventMap = {
|
|
66
|
+
finished: () => { },
|
|
67
|
+
loop: () => { },
|
|
68
|
+
};
|
|
69
|
+
mixer.addEventListener("finished", () => eventMap.finished());
|
|
70
|
+
mixer.addEventListener("loop", () => eventMap.loop());
|
|
71
|
+
this.map[id] = {
|
|
72
|
+
mixer,
|
|
73
|
+
action,
|
|
74
|
+
model,
|
|
75
|
+
time: 0,
|
|
76
|
+
runState: "close",
|
|
77
|
+
clip,
|
|
78
|
+
eventMap,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
clips.map((clip) => {
|
|
82
|
+
const has = model.animations.find((i) => i.uuid === clip.uuid);
|
|
83
|
+
if (has)
|
|
84
|
+
return;
|
|
85
|
+
model.animations.push(clip);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
closeAllAndPlay(model, name, iOptions) {
|
|
89
|
+
const item = _.find(model.animations, (i) => this.playings.has(this.map[i.id]));
|
|
90
|
+
if (item) {
|
|
91
|
+
this.close(model, item.name, { resetAction: true });
|
|
92
|
+
this.play(model, name, iOptions);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.play(model, name, iOptions);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
play(model, name, iOptions) {
|
|
99
|
+
const id = this.findId(model, name);
|
|
100
|
+
const item = this.map[id];
|
|
101
|
+
if (!item || this.playings.has(item))
|
|
102
|
+
return;
|
|
103
|
+
const options = mergeObject({
|
|
104
|
+
onLoop: () => { },
|
|
105
|
+
onProgress: () => { },
|
|
106
|
+
onFinished: () => { },
|
|
107
|
+
onClose: () => { },
|
|
108
|
+
onPause: () => { },
|
|
109
|
+
onResume: () => { },
|
|
110
|
+
onBeforeEnd: () => { },
|
|
111
|
+
loop: false,
|
|
112
|
+
lastFrame: true,
|
|
113
|
+
reset: true,
|
|
114
|
+
triggerFinished: true,
|
|
115
|
+
}, iOptions);
|
|
116
|
+
const { onProgress, onBeforeEnd, onLoop, onFinished, lastFrame, loop, reset, } = options;
|
|
117
|
+
this.map[id].options = options;
|
|
118
|
+
const { action, clip, eventMap } = item;
|
|
119
|
+
action.stop();
|
|
120
|
+
const time = reset ? 0 : item.time;
|
|
121
|
+
action.time = time;
|
|
122
|
+
this.setPlayState(item, true);
|
|
123
|
+
reset && action.reset();
|
|
124
|
+
action.play();
|
|
125
|
+
item.runState = "play";
|
|
126
|
+
Anima.callback.play.cb();
|
|
127
|
+
let triggerBeforeEnd = false;
|
|
128
|
+
let finished = false;
|
|
129
|
+
this.setUpdates(id, () => {
|
|
130
|
+
const pgs = getProgress(action.time, clip.duration, true);
|
|
131
|
+
if (pgs >= 99 && !triggerBeforeEnd) {
|
|
132
|
+
onBeforeEnd();
|
|
133
|
+
triggerBeforeEnd = true;
|
|
134
|
+
}
|
|
135
|
+
onProgress(pgs);
|
|
136
|
+
});
|
|
137
|
+
if (loop) {
|
|
138
|
+
action.loop = Three.LoopRepeat;
|
|
139
|
+
eventMap.loop = onLoop;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
action.clampWhenFinished = lastFrame;
|
|
143
|
+
action.loop = Three.LoopOnce;
|
|
144
|
+
eventMap.finished = () => {
|
|
145
|
+
if (finished || !options.triggerFinished)
|
|
146
|
+
return;
|
|
147
|
+
finished = true;
|
|
148
|
+
this.setPlayState(item, false);
|
|
149
|
+
onProgress(100.0);
|
|
150
|
+
onFinished();
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
pause(model, name) {
|
|
155
|
+
const id = this.findId(model, name);
|
|
156
|
+
const item = this.map[id];
|
|
157
|
+
if (!item || !this.playings.has(item))
|
|
158
|
+
return;
|
|
159
|
+
this.updateTime(item);
|
|
160
|
+
this.setPlayState(item, false);
|
|
161
|
+
item.options.onPause();
|
|
162
|
+
item.runState = "pause";
|
|
163
|
+
}
|
|
164
|
+
resume(model, name) {
|
|
165
|
+
var _a;
|
|
166
|
+
const id = this.findId(model, name);
|
|
167
|
+
const item = this.map[id];
|
|
168
|
+
if (!item || !this.playings.has(item))
|
|
169
|
+
return;
|
|
170
|
+
item.options.onResume();
|
|
171
|
+
this.play(model, name, (_a = this.map[name]) === null || _a === void 0 ? void 0 : _a.options);
|
|
172
|
+
}
|
|
173
|
+
playAll() {
|
|
174
|
+
this.pauseAll();
|
|
175
|
+
this.playings.clear();
|
|
176
|
+
Object.values(this.map).map((val) => {
|
|
177
|
+
this.playings.add(val);
|
|
178
|
+
const { action } = val;
|
|
179
|
+
action.time = 0;
|
|
180
|
+
action.play();
|
|
181
|
+
});
|
|
182
|
+
this.anima();
|
|
183
|
+
}
|
|
184
|
+
setValue(num) {
|
|
185
|
+
let detal = this.clock.getDelta();
|
|
186
|
+
Object.keys(this.map).map((name) => {
|
|
187
|
+
const val = this.map[name];
|
|
188
|
+
const { mixer, action } = val;
|
|
189
|
+
action.play();
|
|
190
|
+
action.time = num;
|
|
191
|
+
mixer.update(detal);
|
|
192
|
+
return;
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
getDetal() {
|
|
196
|
+
return this.clock.getDelta();
|
|
197
|
+
}
|
|
198
|
+
update(iDetal) {
|
|
199
|
+
const detal = iDetal || this.getDetal();
|
|
200
|
+
mapObj(this.updates, (_, fn) => fn(detal));
|
|
201
|
+
}
|
|
202
|
+
anima() {
|
|
203
|
+
let detal = this.clock.getDelta();
|
|
204
|
+
this.update(detal);
|
|
205
|
+
this.playings.forEach((val) => {
|
|
206
|
+
val.mixer.update(detal);
|
|
207
|
+
});
|
|
208
|
+
this.tickIndex = window.requestAnimationFrame(this.anima.bind(this));
|
|
209
|
+
}
|
|
210
|
+
closeAnima() {
|
|
211
|
+
window.cancelAnimationFrame(this.tickIndex);
|
|
212
|
+
}
|
|
213
|
+
resetItem(item) {
|
|
214
|
+
const { mixer, action } = item;
|
|
215
|
+
action.reset();
|
|
216
|
+
action.stop();
|
|
217
|
+
mixer.time = 0;
|
|
218
|
+
}
|
|
219
|
+
resetItemByName(model, name) {
|
|
220
|
+
const id = this.findId(model, name);
|
|
221
|
+
if (!id)
|
|
222
|
+
return;
|
|
223
|
+
const item = this.map[id];
|
|
224
|
+
if (!item)
|
|
225
|
+
return;
|
|
226
|
+
const { mixer, action } = item;
|
|
227
|
+
action.reset();
|
|
228
|
+
action.stop();
|
|
229
|
+
mixer.time = 0;
|
|
230
|
+
}
|
|
231
|
+
pauseAll() {
|
|
232
|
+
this.closeAnima();
|
|
233
|
+
this.playings.forEach((i) => this.resetItem(i));
|
|
234
|
+
this.playings.clear();
|
|
235
|
+
}
|
|
236
|
+
reset() {
|
|
237
|
+
this.pauseAll();
|
|
238
|
+
this.map = {};
|
|
239
|
+
this.playings.clear();
|
|
240
|
+
this.closeAnima();
|
|
241
|
+
}
|
|
242
|
+
updateTime(item, num) {
|
|
243
|
+
item.time = num || item.action.time;
|
|
244
|
+
}
|
|
245
|
+
setPlayState(item, state) {
|
|
246
|
+
if (!state) {
|
|
247
|
+
this.playings.delete(item);
|
|
248
|
+
delete this.updates[item.clip.id];
|
|
249
|
+
if (this.playings.size === 0)
|
|
250
|
+
this.closeAnima();
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.playings.add(item);
|
|
254
|
+
if (this.playings.size === 1)
|
|
255
|
+
this.anima();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
getItem(model, name) {
|
|
259
|
+
const id = this.findId(model, name);
|
|
260
|
+
return this.map[id];
|
|
261
|
+
}
|
|
262
|
+
close(model, name, inputOptions) {
|
|
263
|
+
const id = this.findId(model, name);
|
|
264
|
+
const item = this.map[id];
|
|
265
|
+
if (!item || !this.playings.has(item) || !item.options)
|
|
266
|
+
return;
|
|
267
|
+
// this.resetItem(item);
|
|
268
|
+
const { resetAction } = mergeObject({
|
|
269
|
+
resetAction: true,
|
|
270
|
+
}, inputOptions);
|
|
271
|
+
resetAction && item.action.reset();
|
|
272
|
+
// item.mixer.time = 0;
|
|
273
|
+
this.setPlayState(item, false);
|
|
274
|
+
this.updateTime(item, 0);
|
|
275
|
+
item.options.onClose();
|
|
276
|
+
item.options = null;
|
|
277
|
+
item.runState = "pause";
|
|
278
|
+
Anima.callback.close.cb();
|
|
279
|
+
}
|
|
280
|
+
setUpdates(id, fn) {
|
|
281
|
+
this.updates[id] = fn;
|
|
282
|
+
}
|
|
283
|
+
fadeTo(map) {
|
|
284
|
+
const { lastModel, lastName, nextModel, nextName, duration } = map;
|
|
285
|
+
const lastId = this.findId(lastModel, lastName);
|
|
286
|
+
const lastItem = this.map[lastId];
|
|
287
|
+
if (!lastItem)
|
|
288
|
+
return;
|
|
289
|
+
const nextId = this.findId(nextModel, nextName);
|
|
290
|
+
const nextItem = this.map[nextId];
|
|
291
|
+
if (!nextItem)
|
|
292
|
+
return;
|
|
293
|
+
lastItem.action.crossFadeTo(nextItem.action, duration, true);
|
|
294
|
+
}
|
|
295
|
+
resetTime(model, name) {
|
|
296
|
+
const item = this.getItem(model, name);
|
|
297
|
+
if (!item)
|
|
298
|
+
return;
|
|
299
|
+
item.action.time = 0;
|
|
300
|
+
}
|
|
301
|
+
closeAndReset(model, name, options) {
|
|
302
|
+
this.resetItemByName(model, name);
|
|
303
|
+
this.close(model, name, options);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
Anima.callback = {
|
|
307
|
+
play: new BindEvent(),
|
|
308
|
+
close: new BindEvent(),
|
|
309
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { CSS2DRenderer } from "run-scene-core/examples/jsm/renderers/CSS2DRenderer";
|
|
2
|
+
import { CSS3DRenderer } from "run-scene-core/examples/jsm/renderers/CSS3DRenderer";
|
|
3
|
+
import AssetsManager from "./AssetsManager";
|
|
4
|
+
export default class Assets {
|
|
5
|
+
constructor(runScene) {
|
|
6
|
+
this.scene = null;
|
|
7
|
+
this.camera = null;
|
|
8
|
+
this.controls = null;
|
|
9
|
+
this.renderer = null;
|
|
10
|
+
this.engineDom = null;
|
|
11
|
+
this.parentDom = null;
|
|
12
|
+
this.clean = () => {
|
|
13
|
+
const { camera } = this.get();
|
|
14
|
+
// this.get().controls.dispose();
|
|
15
|
+
// this.renderer = this.runScene.renderEx.create(this.engineDom);
|
|
16
|
+
// const { camera } = this.get();
|
|
17
|
+
// this.controls = this.runScene.controlsEx.create(
|
|
18
|
+
// camera,
|
|
19
|
+
// this.renderer.domElement
|
|
20
|
+
// );
|
|
21
|
+
this.runScene.controlsEx.reset();
|
|
22
|
+
this.runScene.cameraEx.reset(camera);
|
|
23
|
+
};
|
|
24
|
+
this.disposeRender = (renderer) => {
|
|
25
|
+
if (!renderer)
|
|
26
|
+
return;
|
|
27
|
+
renderer.dispose();
|
|
28
|
+
renderer.render = () => { };
|
|
29
|
+
renderer.domElement.remove();
|
|
30
|
+
renderer = null;
|
|
31
|
+
};
|
|
32
|
+
this.runScene = runScene;
|
|
33
|
+
this.manager = new AssetsManager(runScene);
|
|
34
|
+
this.runScene.cb.clean.add("assets", this.clean);
|
|
35
|
+
}
|
|
36
|
+
initRender3() {
|
|
37
|
+
const css3DRenderer = new CSS3DRenderer();
|
|
38
|
+
css3DRenderer.setSize(this.engineDom.clientWidth, this.engineDom.clientHeight);
|
|
39
|
+
css3DRenderer.domElement.style.width = "100%";
|
|
40
|
+
css3DRenderer.domElement.style.height = "100%";
|
|
41
|
+
css3DRenderer.domElement.style.position = "absolute";
|
|
42
|
+
css3DRenderer.domElement.style.zIndex = "1";
|
|
43
|
+
css3DRenderer.domElement.style.left = "0px";
|
|
44
|
+
css3DRenderer.domElement.style.top = "0px";
|
|
45
|
+
css3DRenderer.domElement.className = "css3dRenderer";
|
|
46
|
+
/**
|
|
47
|
+
* transform-style属性用于指定3D变换中子元素的处理方式。在CSS3DRenderer中,为了支持3D变换,CSS3DObject被转换为一个HTML元素,并且该元素的父级元素的transform-style属性被设置为preserve-3d,从而子元素也能够支持3D变换。但是,这样设置之后,子元素的渲染质量有可能会受到影响,导致子元素变得模糊。
|
|
48
|
+
造成渲染质量变差的原因是,开启了preserve-3d之后,浏览器会对元素进行更复杂的渲染处理,这可能会导致一些图形或文本的模糊或失真。另外,还有一些浏览器的实现存在一些问题,例如Chrome浏览器在某些情况下会将CSS3DObject中的文本元素渲染成模糊的黑白图像。
|
|
49
|
+
*/
|
|
50
|
+
// child.style.transformStyle = "flat";
|
|
51
|
+
this.engineDom.appendChild(css3DRenderer.domElement);
|
|
52
|
+
return css3DRenderer;
|
|
53
|
+
}
|
|
54
|
+
initRender2() {
|
|
55
|
+
const css2DRenderer = new CSS2DRenderer();
|
|
56
|
+
css2DRenderer.setSize(this.engineDom.clientWidth, this.engineDom.clientHeight);
|
|
57
|
+
css2DRenderer.domElement.style.width = "100%";
|
|
58
|
+
css2DRenderer.domElement.style.height = "100%";
|
|
59
|
+
css2DRenderer.domElement.style.position = "absolute";
|
|
60
|
+
css2DRenderer.domElement.style.zIndex = "1";
|
|
61
|
+
css2DRenderer.domElement.style.left = "0px";
|
|
62
|
+
css2DRenderer.domElement.style.top = "0px";
|
|
63
|
+
css2DRenderer.domElement.classList.add("css2dRenderer");
|
|
64
|
+
// 避免renderer.domElement影响HTMl标签定位,设置top为0px
|
|
65
|
+
// css2DRenderer.domElement.style.pointerEvents = "none";
|
|
66
|
+
this.engineDom.insertBefore(css2DRenderer.domElement, this.engineDom.childNodes[0]);
|
|
67
|
+
return css2DRenderer;
|
|
68
|
+
}
|
|
69
|
+
reset() {
|
|
70
|
+
const { camera } = this.get();
|
|
71
|
+
// this.get().controls.dispose();
|
|
72
|
+
// this.renderer = this.runScene.renderEx.create(this.engineDom);
|
|
73
|
+
this.runScene.renderEx.setSize();
|
|
74
|
+
// const { camera } = this.get();
|
|
75
|
+
// this.controls = this.runScene.controlsEx.create(
|
|
76
|
+
// camera,
|
|
77
|
+
// this.renderer.domElement
|
|
78
|
+
// );
|
|
79
|
+
this.runScene.cameraEx.reset(camera);
|
|
80
|
+
this.runScene.controlsEx.reset();
|
|
81
|
+
// this.get().renderer.resetState();
|
|
82
|
+
// this.get().controls.update();
|
|
83
|
+
}
|
|
84
|
+
dispose() {
|
|
85
|
+
this.disposeRender(this.renderer);
|
|
86
|
+
this.disposeRender(this.render2);
|
|
87
|
+
this.disposeRender(this.render3);
|
|
88
|
+
}
|
|
89
|
+
setRender2(state) {
|
|
90
|
+
if (this.render2 && state)
|
|
91
|
+
return;
|
|
92
|
+
if (state) {
|
|
93
|
+
this.render2 = this.initRender2();
|
|
94
|
+
this.runScene.renderEx.setSize();
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (!this.render2)
|
|
98
|
+
return;
|
|
99
|
+
this.disposeRender(this.render2);
|
|
100
|
+
this.render2 = null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
setRender3(state) {
|
|
104
|
+
if (this.render3 && state)
|
|
105
|
+
return;
|
|
106
|
+
if (state) {
|
|
107
|
+
this.render3 = this.initRender3();
|
|
108
|
+
this.runScene.renderEx.setSize();
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
if (!this.render3)
|
|
112
|
+
return;
|
|
113
|
+
this.disposeRender(this.render3);
|
|
114
|
+
this.render3 = null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
init(engineDom) {
|
|
118
|
+
this.parentDom = engineDom;
|
|
119
|
+
this.engineDom = this.runScene.renderEx.initOutDom(engineDom);
|
|
120
|
+
const scene = this.runScene.sceneEx.create();
|
|
121
|
+
const camera = this.runScene.cameraEx.pCam;
|
|
122
|
+
const render = this.runScene.renderEx.create(this.engineDom);
|
|
123
|
+
const controls = this.runScene.controlsEx.create(camera, this.runScene.optionsEx.options.renderConfig.controlsDom || this.engineDom);
|
|
124
|
+
const { render2, render3 } = this.runScene.optionsEx.options;
|
|
125
|
+
this.camera = camera;
|
|
126
|
+
this.scene = scene;
|
|
127
|
+
this.renderer = render;
|
|
128
|
+
this.controls = controls;
|
|
129
|
+
this.runScene.renderEx.setSize();
|
|
130
|
+
this.setRender2(render2);
|
|
131
|
+
this.setRender3(render3);
|
|
132
|
+
return {
|
|
133
|
+
scene,
|
|
134
|
+
camera,
|
|
135
|
+
render,
|
|
136
|
+
controls,
|
|
137
|
+
engineDom: this.engineDom,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
get() {
|
|
141
|
+
const { scene, renderer, controls, engineDom, render2, render3, parentDom, } = this;
|
|
142
|
+
return {
|
|
143
|
+
scene,
|
|
144
|
+
camera: this.runScene.cameraEx.getCamera(),
|
|
145
|
+
renderer,
|
|
146
|
+
controls,
|
|
147
|
+
engineDom,
|
|
148
|
+
render2,
|
|
149
|
+
render3,
|
|
150
|
+
parentDom,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import MapEx from "../Ex/MapEx";
|
|
2
|
+
export default class AssetsManager {
|
|
3
|
+
constructor(runScene) {
|
|
4
|
+
this.map = {
|
|
5
|
+
//id:length
|
|
6
|
+
material: new MapEx(),
|
|
7
|
+
texture: new MapEx(),
|
|
8
|
+
};
|
|
9
|
+
this.onSet = (map) => {
|
|
10
|
+
const { type, id, isAdd } = map;
|
|
11
|
+
if (isAdd) {
|
|
12
|
+
let saved = this.map[type].get(id) || 0;
|
|
13
|
+
this.map[type].set(id, ++saved);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
if (!this.map[type].get(id))
|
|
17
|
+
return;
|
|
18
|
+
let num = this.map[type].get(id);
|
|
19
|
+
this.map[type].set(id, --num);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.runScene = runScene;
|
|
23
|
+
this.init();
|
|
24
|
+
}
|
|
25
|
+
init() {
|
|
26
|
+
this.runScene.cb.assets.manager.set.add("AssetsManager", this.onSet);
|
|
27
|
+
}
|
|
28
|
+
isUsed(type, id) {
|
|
29
|
+
const number = this.map[type].get(id);
|
|
30
|
+
if (number === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
return number > 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/types/src/BaseEx.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default class BaseEx {
|
|
2
|
+
constructor(runScene, parent) {
|
|
3
|
+
var _a;
|
|
4
|
+
this.runScene = runScene;
|
|
5
|
+
this.parent = parent;
|
|
6
|
+
(_a = this.inited) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
7
|
+
}
|
|
8
|
+
inited() { }
|
|
9
|
+
}
|
|
10
|
+
export class CoreModuleBase {
|
|
11
|
+
constructor(runScene, parent) {
|
|
12
|
+
var _a;
|
|
13
|
+
this.runScene = runScene;
|
|
14
|
+
this.core = parent;
|
|
15
|
+
(_a = this.inited) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
16
|
+
}
|
|
17
|
+
inited() { }
|
|
18
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare type CallBackType = {
|
|
|
14
14
|
}[];
|
|
15
15
|
};
|
|
16
16
|
export default class BindEvent<inputType = void, outType = void> {
|
|
17
|
+
isBindEvent: boolean;
|
|
17
18
|
private cbs;
|
|
18
19
|
cb: (data: inputType) => outType[];
|
|
19
20
|
getCbNames(): string[];
|
|
@@ -25,6 +26,7 @@ export default class BindEvent<inputType = void, outType = void> {
|
|
|
25
26
|
* @returns
|
|
26
27
|
*/
|
|
27
28
|
add(name: string, fn: (data: inputType) => outType, isUnique?: boolean): number;
|
|
29
|
+
deleteThenAdd(name: string, fn: (data: inputType) => outType, isUnique?: boolean): number;
|
|
28
30
|
on(fn: (data: inputType) => outType, name?: string): number;
|
|
29
31
|
get(name: string): {
|
|
30
32
|
data: undefined | addArgs<inputType>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { getId } from "js-funcs";
|
|
2
|
+
export default class BindEvent {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.isBindEvent = true;
|
|
5
|
+
this.cbs = [];
|
|
6
|
+
this.cb = (data) => {
|
|
7
|
+
return this.cbs.map((map) => { var _a; return (_a = map.fn) === null || _a === void 0 ? void 0 : _a.call(map, data); });
|
|
8
|
+
};
|
|
9
|
+
this.emit = this.cb;
|
|
10
|
+
}
|
|
11
|
+
getCbNames() {
|
|
12
|
+
return this.cbs.map((i) => i.name);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param name 传入的函数名称,用来确定该函数的作用
|
|
17
|
+
* @param fn 函数本身
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
add(name, fn, isUnique) {
|
|
21
|
+
if (isUnique) {
|
|
22
|
+
if (this.get(name))
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
return this.cbs.push({
|
|
26
|
+
fn,
|
|
27
|
+
name,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
deleteThenAdd(name, fn, isUnique) {
|
|
31
|
+
this.delete(name);
|
|
32
|
+
return this.add(name, fn, isUnique);
|
|
33
|
+
}
|
|
34
|
+
on(fn, name) {
|
|
35
|
+
return this.add(name || "custom_" + getId(), fn);
|
|
36
|
+
}
|
|
37
|
+
get(name) {
|
|
38
|
+
const index = this.cbs.findIndex((i) => i.name === name);
|
|
39
|
+
if (index === -1)
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
data: this.cbs[index],
|
|
43
|
+
index,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
reset(name, fn) {
|
|
47
|
+
const old = this.get(name);
|
|
48
|
+
if (!old)
|
|
49
|
+
return false;
|
|
50
|
+
const { data } = old;
|
|
51
|
+
data.fn = fn;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
remove(name) {
|
|
55
|
+
this.reset(name, null);
|
|
56
|
+
}
|
|
57
|
+
delete(name) {
|
|
58
|
+
const { index } = this.get(name) || {};
|
|
59
|
+
if (index === undefined)
|
|
60
|
+
return;
|
|
61
|
+
this.cbs.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
clear() {
|
|
64
|
+
this.cbs = [];
|
|
65
|
+
}
|
|
66
|
+
}
|