@luminocity/lemonate-engine 15.2.2 → 15.2.3
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/dist/engine.min.js +302 -0
- package/dist/player.zip +302 -0
- package/package.json +6 -2
- package/dist/Builder.js +0 -93
- package/dist/Builder.js.map +0 -1
- package/dist/Canvas.js +0 -109
- package/dist/Canvas.js.map +0 -1
- package/dist/Controllers.js +0 -97
- package/dist/Controllers.js.map +0 -1
- package/dist/EditorScene.js +0 -372
- package/dist/EditorScene.js.map +0 -1
- package/dist/Engine.js +0 -1576
- package/dist/Engine.js.map +0 -1
- package/dist/LoadingManager.js +0 -1195
- package/dist/LoadingManager.js.map +0 -1
- package/dist/LoadingState.js +0 -37
- package/dist/LoadingState.js.map +0 -1
- package/dist/Logger.js +0 -141
- package/dist/Logger.js.map +0 -1
- package/dist/Player.js +0 -470
- package/dist/Player.js.map +0 -1
- package/dist/Preview.js +0 -166
- package/dist/Preview.js.map +0 -1
- package/dist/RenderOptions.js +0 -59
- package/dist/RenderOptions.js.map +0 -1
- package/dist/RenderPassInfo.js +0 -133
- package/dist/RenderPassInfo.js.map +0 -1
- package/dist/RenderView.js +0 -459
- package/dist/RenderView.js.map +0 -1
- package/dist/Renderer.js +0 -1867
- package/dist/Renderer.js.map +0 -1
- package/dist/SceneGraph.js +0 -798
- package/dist/SceneGraph.js.map +0 -1
- package/dist/SceneGraphCollection.js +0 -614
- package/dist/SceneGraphCollection.js.map +0 -1
- package/dist/Shortcuts.js +0 -259
- package/dist/Shortcuts.js.map +0 -1
- package/dist/Tools.js +0 -500
- package/dist/Tools.js.map +0 -1
- package/dist/Variables.js +0 -243
- package/dist/Variables.js.map +0 -1
- package/dist/helpers/ArrowHelper.js +0 -104
- package/dist/helpers/ArrowHelper.js.map +0 -1
- package/dist/helpers/BoxHelper.js +0 -112
- package/dist/helpers/BoxHelper.js.map +0 -1
- package/dist/helpers/CameraHelper.js +0 -237
- package/dist/helpers/CameraHelper.js.map +0 -1
- package/dist/helpers/FaceNormalsHelper.js +0 -85
- package/dist/helpers/FaceNormalsHelper.js.map +0 -1
- package/dist/helpers/MeshHelper.js +0 -92
- package/dist/helpers/MeshHelper.js.map +0 -1
- package/dist/helpers/MultiGridHelper.js +0 -61
- package/dist/helpers/MultiGridHelper.js.map +0 -1
- package/dist/helpers/ParticlesHelper.js +0 -245
- package/dist/helpers/ParticlesHelper.js.map +0 -1
- package/dist/helpers/PointHelper.js +0 -85
- package/dist/helpers/PointHelper.js.map +0 -1
- package/dist/helpers/SphereHelper.js +0 -62
- package/dist/helpers/SphereHelper.js.map +0 -1
- package/dist/helpers/VertexNormalsHelper.js +0 -75
- package/dist/helpers/VertexNormalsHelper.js.map +0 -1
- package/dist/helpers/ViewHelper.js +0 -252
- package/dist/helpers/ViewHelper.js.map +0 -1
- package/dist/helpers/lighthelpers/DirectionalLightHelper.js +0 -136
- package/dist/helpers/lighthelpers/DirectionalLightHelper.js.map +0 -1
- package/dist/helpers/lighthelpers/HemisphereLightHelper.js +0 -124
- package/dist/helpers/lighthelpers/HemisphereLightHelper.js.map +0 -1
- package/dist/helpers/lighthelpers/PointLightHelper.js +0 -133
- package/dist/helpers/lighthelpers/PointLightHelper.js.map +0 -1
- package/dist/helpers/lighthelpers/SpotLightHelper.js +0 -123
- package/dist/helpers/lighthelpers/SpotLightHelper.js.map +0 -1
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/items/AudioCollectionItem.js +0 -230
- package/dist/items/AudioCollectionItem.js.map +0 -1
- package/dist/items/AudioItem.js +0 -75
- package/dist/items/AudioItem.js.map +0 -1
- package/dist/items/BackgroundShaderItem.js +0 -239
- package/dist/items/BackgroundShaderItem.js.map +0 -1
- package/dist/items/CanvasTextureItem.js +0 -194
- package/dist/items/CanvasTextureItem.js.map +0 -1
- package/dist/items/CompositionItem.js +0 -110
- package/dist/items/CompositionItem.js.map +0 -1
- package/dist/items/FontItem.js +0 -135
- package/dist/items/FontItem.js.map +0 -1
- package/dist/items/GaussianSplatsItem.js +0 -103
- package/dist/items/GaussianSplatsItem.js.map +0 -1
- package/dist/items/GridMapItem.js +0 -202
- package/dist/items/GridMapItem.js.map +0 -1
- package/dist/items/ImageItem.js +0 -255
- package/dist/items/ImageItem.js.map +0 -1
- package/dist/items/Item.js +0 -739
- package/dist/items/Item.js.map +0 -1
- package/dist/items/MaterialCollectionItem.js +0 -216
- package/dist/items/MaterialCollectionItem.js.map +0 -1
- package/dist/items/MaterialItem.js +0 -1762
- package/dist/items/MaterialItem.js.map +0 -1
- package/dist/items/MeshCollectionItem.js +0 -258
- package/dist/items/MeshCollectionItem.js.map +0 -1
- package/dist/items/MeshItem.js +0 -274
- package/dist/items/MeshItem.js.map +0 -1
- package/dist/items/ParticlesItem.js +0 -187
- package/dist/items/ParticlesItem.js.map +0 -1
- package/dist/items/PixelShaderItem.js +0 -42
- package/dist/items/PixelShaderItem.js.map +0 -1
- package/dist/items/PointsItem.js +0 -122
- package/dist/items/PointsItem.js.map +0 -1
- package/dist/items/PrefabItem.js +0 -140
- package/dist/items/PrefabItem.js.map +0 -1
- package/dist/items/ProjectItem.js +0 -857
- package/dist/items/ProjectItem.js.map +0 -1
- package/dist/items/SceneItem.js +0 -443
- package/dist/items/SceneItem.js.map +0 -1
- package/dist/items/ScriptItem.js +0 -159
- package/dist/items/ScriptItem.js.map +0 -1
- package/dist/items/VariableSetItem.js +0 -208
- package/dist/items/VariableSetItem.js.map +0 -1
- package/dist/items/VertexShaderItem.js +0 -42
- package/dist/items/VertexShaderItem.js.map +0 -1
- package/dist/items/VideoItem.js +0 -152
- package/dist/items/VideoItem.js.map +0 -1
- package/dist/items/base/ImageOwningItem.js +0 -205
- package/dist/items/base/ImageOwningItem.js.map +0 -1
- package/dist/items/base/MeshBase.js +0 -342
- package/dist/items/base/MeshBase.js.map +0 -1
- package/dist/items/base/ShaderBase.js +0 -115
- package/dist/items/base/ShaderBase.js.map +0 -1
- package/dist/items/helpers/ListEntry.js +0 -113
- package/dist/items/helpers/ListEntry.js.map +0 -1
- package/dist/items/helpers/ListField.js +0 -210
- package/dist/items/helpers/ListField.js.map +0 -1
- package/dist/items/helpers/MappingSetup.js +0 -126
- package/dist/items/helpers/MappingSetup.js.map +0 -1
- package/dist/json/packageVersionInfo.json +0 -6
- package/dist/json/shortcuts.json +0 -37
- package/dist/renderers/ForwardRenderer.js +0 -50
- package/dist/renderers/ForwardRenderer.js.map +0 -1
- package/dist/renderers/RendererBase.js +0 -38
- package/dist/renderers/RendererBase.js.map +0 -1
- package/dist/scenegraph/SgAudio.js +0 -286
- package/dist/scenegraph/SgAudio.js.map +0 -1
- package/dist/scenegraph/SgAudioListener.js +0 -64
- package/dist/scenegraph/SgAudioListener.js.map +0 -1
- package/dist/scenegraph/SgBillboard.js +0 -150
- package/dist/scenegraph/SgBillboard.js.map +0 -1
- package/dist/scenegraph/SgBox.js +0 -54
- package/dist/scenegraph/SgBox.js.map +0 -1
- package/dist/scenegraph/SgCamera.js +0 -219
- package/dist/scenegraph/SgCamera.js.map +0 -1
- package/dist/scenegraph/SgCircleShadow.js +0 -105
- package/dist/scenegraph/SgCircleShadow.js.map +0 -1
- package/dist/scenegraph/SgCone.js +0 -61
- package/dist/scenegraph/SgCone.js.map +0 -1
- package/dist/scenegraph/SgCylinder.js +0 -62
- package/dist/scenegraph/SgCylinder.js.map +0 -1
- package/dist/scenegraph/SgGaussianSplats.js +0 -103
- package/dist/scenegraph/SgGaussianSplats.js.map +0 -1
- package/dist/scenegraph/SgGridMap.js +0 -112
- package/dist/scenegraph/SgGridMap.js.map +0 -1
- package/dist/scenegraph/SgGroup.js +0 -40
- package/dist/scenegraph/SgGroup.js.map +0 -1
- package/dist/scenegraph/SgItem.js +0 -1427
- package/dist/scenegraph/SgItem.js.map +0 -1
- package/dist/scenegraph/SgItemScript.js +0 -117
- package/dist/scenegraph/SgItemScript.js.map +0 -1
- package/dist/scenegraph/SgLightsource.js +0 -319
- package/dist/scenegraph/SgLightsource.js.map +0 -1
- package/dist/scenegraph/SgLod.js +0 -82
- package/dist/scenegraph/SgLod.js.map +0 -1
- package/dist/scenegraph/SgMesh.js +0 -662
- package/dist/scenegraph/SgMesh.js.map +0 -1
- package/dist/scenegraph/SgNavMesh.js +0 -503
- package/dist/scenegraph/SgNavMesh.js.map +0 -1
- package/dist/scenegraph/SgParticles.js +0 -796
- package/dist/scenegraph/SgParticles.js.map +0 -1
- package/dist/scenegraph/SgPhysicsItem.js +0 -806
- package/dist/scenegraph/SgPhysicsItem.js.map +0 -1
- package/dist/scenegraph/SgPhysicsSubItem.js +0 -449
- package/dist/scenegraph/SgPhysicsSubItem.js.map +0 -1
- package/dist/scenegraph/SgPlane.js +0 -47
- package/dist/scenegraph/SgPlane.js.map +0 -1
- package/dist/scenegraph/SgPoints.js +0 -143
- package/dist/scenegraph/SgPoints.js.map +0 -1
- package/dist/scenegraph/SgPositionalAudio.js +0 -93
- package/dist/scenegraph/SgPositionalAudio.js.map +0 -1
- package/dist/scenegraph/SgPrefab.js +0 -153
- package/dist/scenegraph/SgPrefab.js.map +0 -1
- package/dist/scenegraph/SgProceduralGeometryItem.js +0 -146
- package/dist/scenegraph/SgProceduralGeometryItem.js.map +0 -1
- package/dist/scenegraph/SgResourceOwner.js +0 -127
- package/dist/scenegraph/SgResourceOwner.js.map +0 -1
- package/dist/scenegraph/SgRibbon.js +0 -107
- package/dist/scenegraph/SgRibbon.js.map +0 -1
- package/dist/scenegraph/SgRing.js +0 -49
- package/dist/scenegraph/SgRing.js.map +0 -1
- package/dist/scenegraph/SgRoot.js +0 -87
- package/dist/scenegraph/SgRoot.js.map +0 -1
- package/dist/scenegraph/SgScriptedMesh.js +0 -213
- package/dist/scenegraph/SgScriptedMesh.js.map +0 -1
- package/dist/scenegraph/SgSky.js +0 -126
- package/dist/scenegraph/SgSky.js.map +0 -1
- package/dist/scenegraph/SgSphere.js +0 -59
- package/dist/scenegraph/SgSphere.js.map +0 -1
- package/dist/scenegraph/SgText.js +0 -182
- package/dist/scenegraph/SgText.js.map +0 -1
- package/dist/scenegraph/SgTorus.js +0 -48
- package/dist/scenegraph/SgTorus.js.map +0 -1
- package/dist/scenegraph/SgVehicle.js +0 -370
- package/dist/scenegraph/SgVehicle.js.map +0 -1
- package/dist/subsystems/AudioSystem.js +0 -128
- package/dist/subsystems/AudioSystem.js.map +0 -1
- package/dist/subsystems/Billboard.js +0 -190
- package/dist/subsystems/Billboard.js.map +0 -1
- package/dist/subsystems/FontLoader.js +0 -161
- package/dist/subsystems/FontLoader.js.map +0 -1
- package/dist/subsystems/Physics.js +0 -1079
- package/dist/subsystems/Physics.js.map +0 -1
- package/dist/subsystems/Ribbons.js +0 -179
- package/dist/subsystems/Ribbons.js.map +0 -1
- package/dist/subsystems/gridmap/GridMapBuilder.js +0 -430
- package/dist/subsystems/gridmap/GridMapBuilder.js.map +0 -1
- package/dist/subsystems/imgui/ImGui.js +0 -742
- package/dist/subsystems/imgui/ImGui.js.map +0 -1
- package/dist/subsystems/importer/Converter.js +0 -199
- package/dist/subsystems/importer/Converter.js.map +0 -1
- package/dist/subsystems/importer/ImageConverter.js +0 -77
- package/dist/subsystems/importer/ImageConverter.js.map +0 -1
- package/dist/subsystems/importer/Importer.js +0 -381
- package/dist/subsystems/importer/Importer.js.map +0 -1
- package/dist/subsystems/importer/MeshConverter.js +0 -595
- package/dist/subsystems/importer/MeshConverter.js.map +0 -1
- package/dist/subsystems/particlesystem/CurlNoiseTexturePreview.js +0 -127
- package/dist/subsystems/particlesystem/CurlNoiseTexturePreview.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/CircleEmitter.js +0 -135
- package/dist/subsystems/particlesystem/Emitters/CircleEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/ConeEmitter.js +0 -192
- package/dist/subsystems/particlesystem/Emitters/ConeEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/CubeEmitter.js +0 -157
- package/dist/subsystems/particlesystem/Emitters/CubeEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/EdgeEmitter.js +0 -133
- package/dist/subsystems/particlesystem/Emitters/EdgeEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/Emitter.js +0 -107
- package/dist/subsystems/particlesystem/Emitters/Emitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/HemiSphereEmitter.js +0 -142
- package/dist/subsystems/particlesystem/Emitters/HemiSphereEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/MeshEmitter.js +0 -56
- package/dist/subsystems/particlesystem/Emitters/MeshEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/SphereEmitter.js +0 -142
- package/dist/subsystems/particlesystem/Emitters/SphereEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/Emitters/TorusEmitter.js +0 -159
- package/dist/subsystems/particlesystem/Emitters/TorusEmitter.js.map +0 -1
- package/dist/subsystems/particlesystem/ParticleSystem.js +0 -706
- package/dist/subsystems/particlesystem/ParticleSystem.js.map +0 -1
- package/dist/subsystems/particlesystem/Simulation.js +0 -475
- package/dist/subsystems/particlesystem/Simulation.js.map +0 -1
- package/dist/subsystems/particlesystem/Visualization.js +0 -518
- package/dist/subsystems/particlesystem/Visualization.js.map +0 -1
- package/dist/subsystems/particlesystem/shaders/noise/CurlNoiseTexturePreviewShader.js +0 -56
- package/dist/subsystems/particlesystem/shaders/noise/CurlNoiseTexturePreviewShader.js.map +0 -1
- package/dist/subsystems/particlesystem/utils.js +0 -115
- package/dist/subsystems/particlesystem/utils.js.map +0 -1
- package/dist/subsystems/scripting/ScriptEngine.js +0 -1074
- package/dist/subsystems/scripting/ScriptEngine.js.map +0 -1
- package/dist/subsystems/scripting/ScriptRunner.js +0 -153
- package/dist/subsystems/scripting/ScriptRunner.js.map +0 -1
- package/dist/subsystems/scripting/ScriptRuntime.js +0 -244
- package/dist/subsystems/scripting/ScriptRuntime.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtAudio.js +0 -37
- package/dist/subsystems/scripting/runtime/RtAudio.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtBase.js +0 -117
- package/dist/subsystems/scripting/runtime/RtBase.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtCanvas.js +0 -326
- package/dist/subsystems/scripting/runtime/RtCanvas.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtComposer.js +0 -58
- package/dist/subsystems/scripting/runtime/RtComposer.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtConsole.js +0 -51
- package/dist/subsystems/scripting/runtime/RtConsole.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtControllers.js +0 -52
- package/dist/subsystems/scripting/runtime/RtControllers.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtEvents.js +0 -46
- package/dist/subsystems/scripting/runtime/RtEvents.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtImGui.js +0 -410
- package/dist/subsystems/scripting/runtime/RtImGui.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtItem.js +0 -297
- package/dist/subsystems/scripting/runtime/RtItem.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtLoader.js +0 -77
- package/dist/subsystems/scripting/runtime/RtLoader.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtObject.js +0 -34
- package/dist/subsystems/scripting/runtime/RtObject.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtPhysics.js +0 -69
- package/dist/subsystems/scripting/runtime/RtPhysics.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtPointer.js +0 -45
- package/dist/subsystems/scripting/runtime/RtPointer.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtProject.js +0 -66
- package/dist/subsystems/scripting/runtime/RtProject.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtRenderer.js +0 -138
- package/dist/subsystems/scripting/runtime/RtRenderer.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtSceneEntry.js +0 -67
- package/dist/subsystems/scripting/runtime/RtSceneEntry.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtSceneObject.js +0 -666
- package/dist/subsystems/scripting/runtime/RtSceneObject.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtStorage.js +0 -64
- package/dist/subsystems/scripting/runtime/RtStorage.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtSystem.js +0 -85
- package/dist/subsystems/scripting/runtime/RtSystem.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtTools.js +0 -37
- package/dist/subsystems/scripting/runtime/RtTools.js.map +0 -1
- package/dist/subsystems/scripting/runtime/RtVariables.js +0 -57
- package/dist/subsystems/scripting/runtime/RtVariables.js.map +0 -1
- package/dist/subsystems/scripting/runtime/items/RtCanvasTexture.js +0 -101
- package/dist/subsystems/scripting/runtime/items/RtCanvasTexture.js.map +0 -1
- package/dist/subsystems/scripting/runtime/items/RtMaterial.js +0 -34
- package/dist/subsystems/scripting/runtime/items/RtMaterial.js.map +0 -1
- package/dist/subsystems/scripting/runtime/items/RtMesh.js +0 -34
- package/dist/subsystems/scripting/runtime/items/RtMesh.js.map +0 -1
- package/dist/subsystems/scripting/runtime/items/RtTexture.js +0 -34
- package/dist/subsystems/scripting/runtime/items/RtTexture.js.map +0 -1
- package/dist/subsystems/scripting/runtime/items/RtVideo.js +0 -56
- package/dist/subsystems/scripting/runtime/items/RtVideo.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgAudio.js +0 -59
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgAudio.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgCamera.js +0 -134
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgCamera.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgMesh.js +0 -99
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgMesh.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgNavMesh.js +0 -114
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgNavMesh.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgParticles.js +0 -576
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgParticles.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgPositionalAudio.js +0 -56
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgPositionalAudio.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgRibbon.js +0 -42
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgRibbon.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgScriptedMesh.js +0 -65
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgScriptedMesh.js.map +0 -1
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgVehicle.js +0 -60
- package/dist/subsystems/scripting/runtime/sceneobjects/RtSgVehicle.js.map +0 -1
- package/dist/tools/AsyncInterval.js +0 -55
- package/dist/tools/AsyncInterval.js.map +0 -1
- package/dist/tools/Converters.js +0 -41
- package/dist/tools/Converters.js.map +0 -1
- package/dist/tools/DebugTools.js +0 -91
- package/dist/tools/DebugTools.js.map +0 -1
- package/dist/tools/FontTools.js +0 -43
- package/dist/tools/FontTools.js.map +0 -1
- package/dist/tools/FsShader.js +0 -112
- package/dist/tools/FsShader.js.map +0 -1
- package/dist/tools/GeometryTools.js +0 -373
- package/dist/tools/GeometryTools.js.map +0 -1
- package/dist/tools/ItemTools.js +0 -139
- package/dist/tools/ItemTools.js.map +0 -1
- package/dist/tools/MathHelpers.js +0 -125
- package/dist/tools/MathHelpers.js.map +0 -1
- package/dist/tools/Profiler.js +0 -174
- package/dist/tools/Profiler.js.map +0 -1
- package/dist/tools/Random.js +0 -48
- package/dist/tools/Random.js.map +0 -1
- package/dist/tools/RtDebugger.js +0 -84
- package/dist/tools/RtDebugger.js.map +0 -1
- package/dist/tools/StringExtensions.js +0 -72
- package/dist/tools/StringExtensions.js.map +0 -1
- package/dist/tools/TextureTools.js +0 -444
- package/dist/tools/TextureTools.js.map +0 -1
- package/dist/tools/Timer.js +0 -52
- package/dist/tools/Timer.js.map +0 -1
- package/dist/tools/audioVisualizers/WavyAudioVisualizer.js +0 -59
- package/dist/tools/audioVisualizers/WavyAudioVisualizer.js.map +0 -1
- /package/dist/renderers/{forwardrenderer.d.ts → ForwardRenderer.d.ts} +0 -0
- /package/dist/subsystems/imgui/{imgui.d.ts → ImGui.d.ts} +0 -0
- /package/dist/subsystems/importer/{imageconverter.d.ts → ImageConverter.d.ts} +0 -0
- /package/dist/subsystems/scripting/{scriptrunner.d.ts → ScriptRunner.d.ts} +0 -0
- /package/dist/subsystems/scripting/{scriptruntime.d.ts → ScriptRuntime.d.ts} +0 -0
- /package/dist/subsystems/scripting/runtime/{rtAudio.d.ts → RtAudio.d.ts} +0 -0
- /package/dist/subsystems/scripting/runtime/{rtComposer.d.ts → RtComposer.d.ts} +0 -0
- /package/dist/subsystems/scripting/runtime/{rtObject.d.ts → RtObject.d.ts} +0 -0
|
@@ -1,706 +0,0 @@
|
|
|
1
|
-
// -----------------------------------------------------------------------------------------------------------
|
|
2
|
-
// __ ______ __ __ ______ __ __ ______ ______ ______
|
|
3
|
-
// /\ \ /\ ___\ /\ "-./ \ /\ __ \ /\ "-.\ \ /\ __ \ /\__ _\ /\ ___\
|
|
4
|
-
// \ \ \____ \ \ __\ \ \ \-./\ \ \ \ \/\ \ \ \ \-. \ \ \ __ \ \/_/\ \/ \ \ __\
|
|
5
|
-
// \ \_____\ \ \_____\ \ \_\ \ \_\ \ \_____\ \ \_\\"\_\ \ \_\ \_\ \ \_\ \ \_____\
|
|
6
|
-
// \/_____/ \/_____/ \/_/ \/_/ \/_____/ \/_/ \/_/ \/_/\/_/ \/_/ \/_____/
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// Copyright 2023- Luminocity AG
|
|
10
|
-
//
|
|
11
|
-
// "I am the one who knocks!" - Far Cry 3: Blood Dragon (2013)
|
|
12
|
-
//
|
|
13
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14
|
-
// and associated documentation files (the “Software”), to deal in the Software without restriction,
|
|
15
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
16
|
-
// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
-
// subject to the following conditions:
|
|
18
|
-
//
|
|
19
|
-
// The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
20
|
-
// portions of the Software.
|
|
21
|
-
//
|
|
22
|
-
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
23
|
-
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
24
|
-
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
-
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
26
|
-
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
-
// -----------------------------------------------------------------------------------------------------------
|
|
28
|
-
import { Simulation } from "./Simulation";
|
|
29
|
-
import { Visualization } from "./Visualization";
|
|
30
|
-
import { CubeEmitter } from "./Emitters/CubeEmitter";
|
|
31
|
-
import { SphereEmitter } from "./Emitters/SphereEmitter";
|
|
32
|
-
import { HemiSphereEmitter } from "./Emitters/HemiSphereEmitter";
|
|
33
|
-
import { ConeEmitter } from "./Emitters/ConeEmitter";
|
|
34
|
-
import { TorusEmitter } from "./Emitters/TorusEmitter";
|
|
35
|
-
import { CircleEmitter } from "./Emitters/CircleEmitter";
|
|
36
|
-
import { EdgeEmitter } from "./Emitters/EdgeEmitter";
|
|
37
|
-
import { random } from "../../tools/Random";
|
|
38
|
-
import { Vector3, Vector2, Matrix4, Clock, PerspectiveCamera, OrthographicCamera } from "three";
|
|
39
|
-
import { CurlNoiseTexturePreview } from "./CurlNoiseTexturePreview";
|
|
40
|
-
// Debug mode will add two planes to the container
|
|
41
|
-
// to display the position and velocity particles data texture
|
|
42
|
-
const DEBUG = false;
|
|
43
|
-
export var VelocityModeEnum;
|
|
44
|
-
(function (VelocityModeEnum) {
|
|
45
|
-
VelocityModeEnum[VelocityModeEnum["Constant"] = 0] = "Constant";
|
|
46
|
-
VelocityModeEnum[VelocityModeEnum["Variable"] = 1] = "Variable";
|
|
47
|
-
})(VelocityModeEnum || (VelocityModeEnum = {}));
|
|
48
|
-
export var VelocityFunctionEnum;
|
|
49
|
-
(function (VelocityFunctionEnum) {
|
|
50
|
-
VelocityFunctionEnum[VelocityFunctionEnum["Linear"] = 0] = "Linear";
|
|
51
|
-
VelocityFunctionEnum[VelocityFunctionEnum["Exponential"] = 1] = "Exponential";
|
|
52
|
-
VelocityFunctionEnum[VelocityFunctionEnum["Inverse Exponential"] = 2] = "Inverse Exponential";
|
|
53
|
-
VelocityFunctionEnum[VelocityFunctionEnum["Ease-in, Ease-out"] = 3] = "Ease-in, Ease-out";
|
|
54
|
-
})(VelocityFunctionEnum || (VelocityFunctionEnum = {}));
|
|
55
|
-
export var ScaleModeEnum;
|
|
56
|
-
(function (ScaleModeEnum) {
|
|
57
|
-
ScaleModeEnum[ScaleModeEnum["Constant"] = 0] = "Constant";
|
|
58
|
-
ScaleModeEnum[ScaleModeEnum["Variable"] = 1] = "Variable";
|
|
59
|
-
ScaleModeEnum[ScaleModeEnum["Velocity"] = 2] = "Velocity";
|
|
60
|
-
})(ScaleModeEnum || (ScaleModeEnum = {}));
|
|
61
|
-
export var ScaleFunctionEnum;
|
|
62
|
-
(function (ScaleFunctionEnum) {
|
|
63
|
-
ScaleFunctionEnum[ScaleFunctionEnum["Linear"] = 0] = "Linear";
|
|
64
|
-
ScaleFunctionEnum[ScaleFunctionEnum["Exponential"] = 1] = "Exponential";
|
|
65
|
-
ScaleFunctionEnum[ScaleFunctionEnum["Inverse Exponential"] = 2] = "Inverse Exponential";
|
|
66
|
-
ScaleFunctionEnum[ScaleFunctionEnum["Ease-in, Ease-out"] = 3] = "Ease-in, Ease-out";
|
|
67
|
-
})(ScaleFunctionEnum || (ScaleFunctionEnum = {}));
|
|
68
|
-
export var FadeModeEnum;
|
|
69
|
-
(function (FadeModeEnum) {
|
|
70
|
-
FadeModeEnum[FadeModeEnum["Constant"] = 0] = "Constant";
|
|
71
|
-
FadeModeEnum[FadeModeEnum["Variable"] = 1] = "Variable";
|
|
72
|
-
})(FadeModeEnum || (FadeModeEnum = {}));
|
|
73
|
-
export var FadeFunctionEnum;
|
|
74
|
-
(function (FadeFunctionEnum) {
|
|
75
|
-
FadeFunctionEnum[FadeFunctionEnum["Linear"] = 0] = "Linear";
|
|
76
|
-
FadeFunctionEnum[FadeFunctionEnum["Exponential"] = 1] = "Exponential";
|
|
77
|
-
FadeFunctionEnum[FadeFunctionEnum["Inverse Exponential"] = 2] = "Inverse Exponential";
|
|
78
|
-
FadeFunctionEnum[FadeFunctionEnum["Ease-in, Ease-out"] = 3] = "Ease-in, Ease-out";
|
|
79
|
-
})(FadeFunctionEnum || (FadeFunctionEnum = {}));
|
|
80
|
-
export var RotationDirectionEnum;
|
|
81
|
-
(function (RotationDirectionEnum) {
|
|
82
|
-
RotationDirectionEnum[RotationDirectionEnum["Clockwise"] = 1] = "Clockwise";
|
|
83
|
-
RotationDirectionEnum[RotationDirectionEnum["Anticlockwise"] = -1] = "Anticlockwise";
|
|
84
|
-
})(RotationDirectionEnum || (RotationDirectionEnum = {}));
|
|
85
|
-
export class ParticleSystem {
|
|
86
|
-
renderer;
|
|
87
|
-
container; // TODO what is this container?
|
|
88
|
-
engine;
|
|
89
|
-
id;
|
|
90
|
-
particleCount;
|
|
91
|
-
width;
|
|
92
|
-
height;
|
|
93
|
-
time = new Clock();
|
|
94
|
-
elapsedTime = 0;
|
|
95
|
-
timeSinceLastSpawn = 0;
|
|
96
|
-
isRunning = true;
|
|
97
|
-
isEmitting = true;
|
|
98
|
-
isPaused = false;
|
|
99
|
-
emissionCounter = 0;
|
|
100
|
-
continuousEmissionFlag = false;
|
|
101
|
-
simulation;
|
|
102
|
-
visualization;
|
|
103
|
-
noiseTexture;
|
|
104
|
-
duration = -1; // run indefinitely
|
|
105
|
-
spawnAmount = 250;
|
|
106
|
-
spawnRate = 2.5; // seconds
|
|
107
|
-
maxEmission = -1;
|
|
108
|
-
prewarm = false;
|
|
109
|
-
prewarmAmount = 0;
|
|
110
|
-
emitterType = "point";
|
|
111
|
-
_initialVelocity = new Vector3();
|
|
112
|
-
_finalVelocity = new Vector3();
|
|
113
|
-
constructor(container, // TODO
|
|
114
|
-
renderer, particleCount, engine, id) {
|
|
115
|
-
this.renderer = renderer;
|
|
116
|
-
this.container = container;
|
|
117
|
-
this.engine = engine;
|
|
118
|
-
this.id = id;
|
|
119
|
-
this.particleCount = particleCount;
|
|
120
|
-
this.width = Math.ceil(Math.sqrt(particleCount));
|
|
121
|
-
this.height = Math.ceil(Math.sqrt(particleCount));
|
|
122
|
-
// Initialize simulation, visualization, and noise texture
|
|
123
|
-
this.simulation = new Simulation(this.renderer, this.width, this.height);
|
|
124
|
-
this.visualization = new Visualization(this.container, this.particleCount, this.simulation, DEBUG);
|
|
125
|
-
this.noiseTexture = new CurlNoiseTexturePreview(this.renderer, this.engine, this.id);
|
|
126
|
-
// Seed randomness
|
|
127
|
-
random.setSeed(123456789);
|
|
128
|
-
}
|
|
129
|
-
destroy() {
|
|
130
|
-
this.simulation.destroy();
|
|
131
|
-
this.visualization.destroy();
|
|
132
|
-
}
|
|
133
|
-
// The maximum size for a gl point is generally 63 pixels but this depends
|
|
134
|
-
// on the device. It's worthy to check that the given size is between this range
|
|
135
|
-
// to prevent artifacts
|
|
136
|
-
get pointSizeRange() {
|
|
137
|
-
const gl = this.renderer.getContext();
|
|
138
|
-
return gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
|
|
139
|
-
}
|
|
140
|
-
get emitter() {
|
|
141
|
-
// TODO we might want to return it as a json with emitter information for the API
|
|
142
|
-
return this.simulation.emitter;
|
|
143
|
-
}
|
|
144
|
-
get respawnFlag() {
|
|
145
|
-
return this.simulation.respawn;
|
|
146
|
-
}
|
|
147
|
-
set respawnFlag(value) {
|
|
148
|
-
this.simulation.respawn = value;
|
|
149
|
-
}
|
|
150
|
-
get localCoordsFlag() {
|
|
151
|
-
return this.simulation.useLocalCoords;
|
|
152
|
-
}
|
|
153
|
-
set localCoordsFlag(v) {
|
|
154
|
-
this.simulation.useLocalCoords = v;
|
|
155
|
-
}
|
|
156
|
-
get initialVelocity() {
|
|
157
|
-
return this._initialVelocity;
|
|
158
|
-
}
|
|
159
|
-
set initialVelocity(v) {
|
|
160
|
-
this._initialVelocity = v;
|
|
161
|
-
this.simulation.initialVelocity = v;
|
|
162
|
-
}
|
|
163
|
-
get finalVelocity() { return this.simulation.finalVelocity; }
|
|
164
|
-
set finalVelocity(v) { this.simulation.finalVelocity = v; }
|
|
165
|
-
get velocityMode() {
|
|
166
|
-
const value = this.simulation.velocityMode;
|
|
167
|
-
return Object.keys(VelocityModeEnum).find((k) => VelocityModeEnum[k] === value);
|
|
168
|
-
}
|
|
169
|
-
set velocityMode(v) {
|
|
170
|
-
if (typeof v === "string") {
|
|
171
|
-
const enumValue = VelocityModeEnum[v];
|
|
172
|
-
if (enumValue === undefined) {
|
|
173
|
-
throw new Error(`Invalid VelocityMode: ${v}`);
|
|
174
|
-
}
|
|
175
|
-
this.simulation.velocityMode = enumValue;
|
|
176
|
-
}
|
|
177
|
-
else if (typeof v === "number") {
|
|
178
|
-
this.simulation.velocityMode = v;
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
throw new Error("velocityMode must be a string or number");
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
get velocityFunction() {
|
|
185
|
-
const value = this.simulation.velocityFunction;
|
|
186
|
-
return Object.keys(VelocityFunctionEnum).find((k) => VelocityFunctionEnum[k] === value);
|
|
187
|
-
}
|
|
188
|
-
set velocityFunction(v) {
|
|
189
|
-
if (typeof v === "string") {
|
|
190
|
-
const enumValue = VelocityFunctionEnum[v];
|
|
191
|
-
if (enumValue === undefined) {
|
|
192
|
-
throw new Error(`Invalid VelocityFunction: ${v}`);
|
|
193
|
-
}
|
|
194
|
-
this.simulation.velocityFunction = enumValue;
|
|
195
|
-
}
|
|
196
|
-
else if (typeof v === "number") {
|
|
197
|
-
this.simulation.velocityFunction = v;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
throw new Error("velocityFunction must be a string or number");
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
get finalVelocityApproachValue() {
|
|
204
|
-
return this.simulation.approachSpeed;
|
|
205
|
-
}
|
|
206
|
-
set finalVelocityApproachValue(v) {
|
|
207
|
-
this.simulation.approachSpeed = v;
|
|
208
|
-
}
|
|
209
|
-
get target() {
|
|
210
|
-
return this.simulation.target;
|
|
211
|
-
}
|
|
212
|
-
set target(v) {
|
|
213
|
-
this.simulation.target = v;
|
|
214
|
-
}
|
|
215
|
-
get targetForce() {
|
|
216
|
-
return this.simulation.targetForce;
|
|
217
|
-
}
|
|
218
|
-
set targetForce(v) {
|
|
219
|
-
this.simulation.targetForce = v;
|
|
220
|
-
}
|
|
221
|
-
get targetDeletionThreshold() {
|
|
222
|
-
return this.simulation.targetDeletionThreshold;
|
|
223
|
-
}
|
|
224
|
-
set targetDeletionThreshold(v) {
|
|
225
|
-
this.simulation.targetDeletionThreshold = v;
|
|
226
|
-
}
|
|
227
|
-
get randomVelocity() {
|
|
228
|
-
return this.simulation.randomVelocityFactor;
|
|
229
|
-
}
|
|
230
|
-
set randomVelocity(v) {
|
|
231
|
-
this.simulation.randomVelocityFactor = v;
|
|
232
|
-
}
|
|
233
|
-
get normalVelocity() {
|
|
234
|
-
return this.simulation.emitter.normalVelocity;
|
|
235
|
-
}
|
|
236
|
-
set normalVelocity(v) {
|
|
237
|
-
this.simulation.emitter.normalVelocity = v;
|
|
238
|
-
}
|
|
239
|
-
get spread() {
|
|
240
|
-
return this.simulation.spread;
|
|
241
|
-
}
|
|
242
|
-
set spread(v) {
|
|
243
|
-
this.simulation.spread = v;
|
|
244
|
-
}
|
|
245
|
-
get angularVelocity() {
|
|
246
|
-
return this.visualization.angularVelocity;
|
|
247
|
-
}
|
|
248
|
-
set angularVelocity(v) {
|
|
249
|
-
this.visualization.angularVelocity = v;
|
|
250
|
-
}
|
|
251
|
-
get rotationDirection() {
|
|
252
|
-
const value = this.visualization.rotationDirection;
|
|
253
|
-
return Object.keys(RotationDirectionEnum).find(k => RotationDirectionEnum[k] === value);
|
|
254
|
-
}
|
|
255
|
-
set rotationDirection(v) {
|
|
256
|
-
if (typeof v === "string") {
|
|
257
|
-
const enumValue = RotationDirectionEnum[v];
|
|
258
|
-
if (enumValue === undefined) {
|
|
259
|
-
throw new Error(`Invalid RotationDirection: ${v}`);
|
|
260
|
-
}
|
|
261
|
-
this.visualization.rotationDirection = enumValue;
|
|
262
|
-
}
|
|
263
|
-
else if (typeof v === "number") {
|
|
264
|
-
this.visualization.rotationDirection = v;
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
throw new Error("rotationDirection must be a string or number");
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
get rotationRandomness() {
|
|
271
|
-
return this.visualization.rotationRandomness;
|
|
272
|
-
}
|
|
273
|
-
set rotationRandomness(v) {
|
|
274
|
-
this.visualization.rotationRandomness = v;
|
|
275
|
-
}
|
|
276
|
-
get gravity() {
|
|
277
|
-
return this.simulation.gravity;
|
|
278
|
-
}
|
|
279
|
-
set gravity(v) {
|
|
280
|
-
this.simulation.gravity = v;
|
|
281
|
-
}
|
|
282
|
-
get orbitalVelocity() {
|
|
283
|
-
return this.simulation.orbitalVelocity;
|
|
284
|
-
}
|
|
285
|
-
set orbitalVelocity(v) {
|
|
286
|
-
this.simulation.orbitalVelocity = v;
|
|
287
|
-
}
|
|
288
|
-
get orbitalDecay() {
|
|
289
|
-
return this.simulation.orbitalDecay;
|
|
290
|
-
}
|
|
291
|
-
set orbitalDecay(v) {
|
|
292
|
-
this.simulation.orbitalDecay = v;
|
|
293
|
-
}
|
|
294
|
-
get orbitalCenterPoint() {
|
|
295
|
-
return this.simulation.orbitalCenterPoint;
|
|
296
|
-
}
|
|
297
|
-
set orbitalCenterPoint(v) {
|
|
298
|
-
this.simulation.orbitalCenterPoint = v;
|
|
299
|
-
}
|
|
300
|
-
get orbitalPlane() {
|
|
301
|
-
return this.simulation.orbitalPlane;
|
|
302
|
-
}
|
|
303
|
-
set orbitalPlane(v) {
|
|
304
|
-
this.simulation.orbitalPlane = v;
|
|
305
|
-
}
|
|
306
|
-
get enableBBox() { return this.simulation.enableBBox; }
|
|
307
|
-
set enableBBox(v) { this.simulation.enableBBox = v; }
|
|
308
|
-
get bboxMin() { return this.simulation.bboxMin; }
|
|
309
|
-
set bboxMin(v) { this.simulation.bboxMin = v; }
|
|
310
|
-
get bboxMax() { return this.simulation.bboxMax; }
|
|
311
|
-
set bboxMax(v) { this.simulation.bboxMax = v; }
|
|
312
|
-
get bbox() {
|
|
313
|
-
return {
|
|
314
|
-
min: this.simulation.bboxMin,
|
|
315
|
-
max: this.simulation.bboxMax
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
set bbox(box) {
|
|
319
|
-
this.simulation.bboxMin = box.min;
|
|
320
|
-
this.simulation.bboxMax = box.max;
|
|
321
|
-
}
|
|
322
|
-
get noiseStrength() { return this.simulation.noiseStrength; }
|
|
323
|
-
set noiseStrength(v) {
|
|
324
|
-
this.simulation.noiseStrength = v;
|
|
325
|
-
this.noiseTexture.noiseStrength = v;
|
|
326
|
-
}
|
|
327
|
-
get noiseFrequency() { return this.simulation.noiseFrequency; }
|
|
328
|
-
set noiseFrequency(v) {
|
|
329
|
-
this.simulation.noiseFrequency = v;
|
|
330
|
-
this.noiseTexture.noiseFrequency = v;
|
|
331
|
-
}
|
|
332
|
-
get noiseOctaves() { return this.simulation.noiseOctaves; }
|
|
333
|
-
set noiseOctaves(v) {
|
|
334
|
-
this.simulation.noiseOctaves = v;
|
|
335
|
-
this.noiseTexture.noiseOctaves = v;
|
|
336
|
-
}
|
|
337
|
-
get particleLife() {
|
|
338
|
-
return this.simulation.emitter.baseLife;
|
|
339
|
-
}
|
|
340
|
-
set particleLife(v) {
|
|
341
|
-
this.simulation.emitter.baseLife = v;
|
|
342
|
-
}
|
|
343
|
-
get particleLifeRamdom() {
|
|
344
|
-
return this.simulation.emitter.lifeRandomness;
|
|
345
|
-
}
|
|
346
|
-
set particleLifeRamdom(v) {
|
|
347
|
-
this.simulation.emitter.lifeRandomness = v;
|
|
348
|
-
}
|
|
349
|
-
get particleColor() { return this.visualization.baseColor; }
|
|
350
|
-
set particleColor(v) { this.visualization.baseColor = v.divideScalar(255); }
|
|
351
|
-
get particleFinalColor() { return this.visualization.baseFinalColor; }
|
|
352
|
-
set particleFinalColor(v) { this.visualization.baseFinalColor = v.divideScalar(255); }
|
|
353
|
-
get randomColorFactor() { return this.visualization.randomColorFactor; }
|
|
354
|
-
set randomColorFactor(v) { this.visualization.randomColorFactor = v; }
|
|
355
|
-
get enableFinalColor() { return this.visualization.enableFinalColor; }
|
|
356
|
-
set enableFinalColor(v) { this.visualization.enableFinalColor = v; }
|
|
357
|
-
get enableTexture() { return this.visualization.enableTexture; }
|
|
358
|
-
set enableTexture(v) { this.visualization.enableTexture = v; }
|
|
359
|
-
get particleTexture() { return this.visualization.particleTexture; }
|
|
360
|
-
set particleTexture(v) { this.visualization.particleTexture = v; }
|
|
361
|
-
get enableSpriteFade() { return this.visualization.enableSpriteFade; }
|
|
362
|
-
set enableSpriteFade(v) { this.visualization.enableSpriteFade = v; }
|
|
363
|
-
get spriteSpeed() { return this.visualization.spriteSpeed; }
|
|
364
|
-
set spriteSpeed(v) { this.visualization.spriteSpeed = v; }
|
|
365
|
-
get rollSpriteWithLife() { return this.visualization.rollSpriteWithLife; }
|
|
366
|
-
set rollSpriteWithLife(v) { this.visualization.rollSpriteWithLife = v; }
|
|
367
|
-
get spriteCols() { return this.visualization.spriteCols; }
|
|
368
|
-
set spriteCols(v) { this.visualization.spriteCols = v; }
|
|
369
|
-
get spriteRows() { return this.visualization.spriteRows; }
|
|
370
|
-
set spriteRows(v) { this.visualization.spriteRows = v; }
|
|
371
|
-
get atlasWidth() { return this.visualization.atlasWidth; }
|
|
372
|
-
set atlasWidth(v) { this.visualization.atlasWidth = v; }
|
|
373
|
-
get atlasHeight() { return this.visualization.atlasHeight; }
|
|
374
|
-
set atlasHeight(v) { this.visualization.atlasHeight = v; }
|
|
375
|
-
set useCircularMask(value) { this.visualization.maskType = value ? 1 : 0; }
|
|
376
|
-
;
|
|
377
|
-
get maskType() { return this.visualization.maskType; }
|
|
378
|
-
set maskType(v) { this.visualization.maskType = v; }
|
|
379
|
-
get flipTextureY() {
|
|
380
|
-
return this.visualization.flipY;
|
|
381
|
-
}
|
|
382
|
-
set flipTextureY(v) {
|
|
383
|
-
this.visualization.flipY = v;
|
|
384
|
-
}
|
|
385
|
-
get textureBlendingFlag() {
|
|
386
|
-
return this.visualization.textureBlendingFlag;
|
|
387
|
-
}
|
|
388
|
-
set textureBlendingFlag(v) {
|
|
389
|
-
this.visualization.textureBlendingFlag = v;
|
|
390
|
-
}
|
|
391
|
-
get blendValue() {
|
|
392
|
-
return this.visualization.blendValue;
|
|
393
|
-
}
|
|
394
|
-
set blendValue(v) {
|
|
395
|
-
this.visualization.blendValue = v;
|
|
396
|
-
}
|
|
397
|
-
get blendingMode() {
|
|
398
|
-
return this.visualization.blendingMode;
|
|
399
|
-
}
|
|
400
|
-
set blendingMode(v) {
|
|
401
|
-
this.visualization.blendingMode = v;
|
|
402
|
-
}
|
|
403
|
-
get opacity() {
|
|
404
|
-
return this.visualization.opacity;
|
|
405
|
-
}
|
|
406
|
-
set opacity(v) {
|
|
407
|
-
this.visualization.opacity = v;
|
|
408
|
-
}
|
|
409
|
-
get preMultiplyAlphaFlag() {
|
|
410
|
-
return this.visualization.preMultiplyAlphaFlag;
|
|
411
|
-
}
|
|
412
|
-
set preMultiplyAlphaFlag(v) {
|
|
413
|
-
this.visualization.preMultiplyAlphaFlag = v;
|
|
414
|
-
}
|
|
415
|
-
get hueShift() {
|
|
416
|
-
return this.visualization.hueShift;
|
|
417
|
-
}
|
|
418
|
-
set hueShift(v) {
|
|
419
|
-
this.visualization.hueShift = v;
|
|
420
|
-
}
|
|
421
|
-
get fadeMode() {
|
|
422
|
-
const value = this.visualization.fadeMode;
|
|
423
|
-
return Object.keys(FadeModeEnum).find(k => FadeModeEnum[k] === value);
|
|
424
|
-
}
|
|
425
|
-
set fadeMode(v) {
|
|
426
|
-
if (typeof v === "string") {
|
|
427
|
-
const enumValue = FadeModeEnum[v];
|
|
428
|
-
if (enumValue === undefined) {
|
|
429
|
-
throw new Error(`Invalid FadeMode: ${v}`);
|
|
430
|
-
}
|
|
431
|
-
this.visualization.fadeMode = enumValue;
|
|
432
|
-
}
|
|
433
|
-
else if (typeof v === "number") {
|
|
434
|
-
this.visualization.fadeMode = v;
|
|
435
|
-
}
|
|
436
|
-
else {
|
|
437
|
-
throw new Error("fadeMode must be a string or number");
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
get fadeFunction() {
|
|
441
|
-
const value = this.visualization.fadeFunction;
|
|
442
|
-
return Object.keys(FadeFunctionEnum).find(k => FadeFunctionEnum[k] === value);
|
|
443
|
-
}
|
|
444
|
-
set fadeFunction(v) {
|
|
445
|
-
if (typeof v === "string") {
|
|
446
|
-
const enumValue = FadeFunctionEnum[v];
|
|
447
|
-
if (enumValue === undefined) {
|
|
448
|
-
throw new Error(`Invalid FadeFunction: ${v}`);
|
|
449
|
-
}
|
|
450
|
-
this.visualization.fadeFunction = enumValue;
|
|
451
|
-
}
|
|
452
|
-
else if (typeof v === "number") {
|
|
453
|
-
this.visualization.fadeFunction = v;
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
throw new Error("fadeFunction must be a string or number");
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
get fadeApproach() {
|
|
460
|
-
return this.visualization.fadeApproach;
|
|
461
|
-
}
|
|
462
|
-
set fadeApproach(v) {
|
|
463
|
-
this.visualization.fadeApproach = v;
|
|
464
|
-
}
|
|
465
|
-
get fadeRange() {
|
|
466
|
-
return this.visualization.fadeRange;
|
|
467
|
-
}
|
|
468
|
-
set fadeRange(v) {
|
|
469
|
-
this.visualization.fadeRange = v;
|
|
470
|
-
}
|
|
471
|
-
get fadeInitialOpacity() {
|
|
472
|
-
return this.visualization.fadeRange.x;
|
|
473
|
-
}
|
|
474
|
-
set fadeInitialOpacity(v) {
|
|
475
|
-
this.visualization.fadeRange.x = v;
|
|
476
|
-
}
|
|
477
|
-
get fadeFinalOpacity() {
|
|
478
|
-
return this.visualization.fadeRange.y;
|
|
479
|
-
}
|
|
480
|
-
set fadeFinalOpacity(v) {
|
|
481
|
-
this.visualization.fadeRange.y = v;
|
|
482
|
-
}
|
|
483
|
-
get particleSize() {
|
|
484
|
-
const scale = this.visualization.material.uniforms.scale.value;
|
|
485
|
-
const approach = this.visualization.material.uniforms.approachSize.value;
|
|
486
|
-
return {
|
|
487
|
-
minSize: scale.x,
|
|
488
|
-
maxSize: scale.y,
|
|
489
|
-
approach
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
set particleSize(v) {
|
|
493
|
-
const uniforms = this.visualization.material.uniforms;
|
|
494
|
-
uniforms.scale.value = new Vector2(v.minSize, v.maxSize);
|
|
495
|
-
uniforms.approachSize.value = v.approach;
|
|
496
|
-
}
|
|
497
|
-
get scaleFunction() {
|
|
498
|
-
const value = this.visualization.scaleFunction;
|
|
499
|
-
return Object.keys(ScaleFunctionEnum).find((k) => ScaleFunctionEnum[k] === value);
|
|
500
|
-
}
|
|
501
|
-
set scaleFunction(v) {
|
|
502
|
-
if (typeof v === "string") {
|
|
503
|
-
const enumValue = ScaleFunctionEnum[v];
|
|
504
|
-
if (enumValue === undefined) {
|
|
505
|
-
throw new Error(`Invalid ScaleFunction: ${v}`);
|
|
506
|
-
}
|
|
507
|
-
this.visualization.scaleFunction = enumValue;
|
|
508
|
-
}
|
|
509
|
-
else if (typeof v === "number") {
|
|
510
|
-
this.visualization.scaleFunction = v;
|
|
511
|
-
}
|
|
512
|
-
else {
|
|
513
|
-
throw new Error("scaleFunction must be a string or number");
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
get scaleRandomness() { return this.visualization.scaleRandomness; }
|
|
517
|
-
set scaleRandomness(v) { this.visualization.scaleRandomness = v; }
|
|
518
|
-
get scaleMode() {
|
|
519
|
-
// find the enum key by its value
|
|
520
|
-
const value = this.visualization.scaleMode;
|
|
521
|
-
return Object.keys(ScaleModeEnum).find((k) => ScaleModeEnum[k] === value);
|
|
522
|
-
}
|
|
523
|
-
set scaleMode(v) {
|
|
524
|
-
if (typeof v === "string") {
|
|
525
|
-
const enumValue = ScaleModeEnum[v];
|
|
526
|
-
if (enumValue === undefined) {
|
|
527
|
-
throw new Error(`Invalid ScaleMode: ${v}`);
|
|
528
|
-
}
|
|
529
|
-
this.visualization.scaleMode = enumValue;
|
|
530
|
-
}
|
|
531
|
-
else if (typeof v === "number") {
|
|
532
|
-
this.visualization.scaleMode = v;
|
|
533
|
-
}
|
|
534
|
-
else {
|
|
535
|
-
throw new Error("scaleMode must be a string or number");
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
setEmitter(shape, type, config) {
|
|
539
|
-
const previousEmitter = this.simulation.emitter;
|
|
540
|
-
const newEmitter = this.createEmitter(shape, config);
|
|
541
|
-
if (!newEmitter) {
|
|
542
|
-
console.warn('Unknown geometry type:', shape);
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
// Inherit previous emitter settings
|
|
546
|
-
if (previousEmitter) {
|
|
547
|
-
newEmitter.copyFrom(previousEmitter);
|
|
548
|
-
}
|
|
549
|
-
newEmitter.emissionType = type;
|
|
550
|
-
if (config.life !== undefined)
|
|
551
|
-
newEmitter.baseLife = config.life;
|
|
552
|
-
if (config.lifeRandomness !== undefined)
|
|
553
|
-
newEmitter.lifeRandomness = config.lifeRandomness;
|
|
554
|
-
this.simulation.emitter = newEmitter;
|
|
555
|
-
this.emitterType = type;
|
|
556
|
-
this.simulation.setEmitter(newEmitter);
|
|
557
|
-
this.simulation.updateShaderDefines();
|
|
558
|
-
}
|
|
559
|
-
createEmitter(shape, config) {
|
|
560
|
-
switch (shape) {
|
|
561
|
-
case 'point':
|
|
562
|
-
return new SphereEmitter(this.simulation, 0.0001);
|
|
563
|
-
case 'box':
|
|
564
|
-
return new CubeEmitter(this.simulation, config.size ?? 1);
|
|
565
|
-
case 'sphere':
|
|
566
|
-
return new SphereEmitter(this.simulation, config.radius ?? 1);
|
|
567
|
-
case 'hemisphere':
|
|
568
|
-
return new HemiSphereEmitter(this.simulation, config.radius ?? 1);
|
|
569
|
-
case 'torus':
|
|
570
|
-
return new TorusEmitter(this.simulation, config.radius ?? 1, config.outerRadius ?? 1);
|
|
571
|
-
case 'cone':
|
|
572
|
-
const newEmitter = new ConeEmitter(this.simulation, config.radius ?? 1, config.height ?? 1);
|
|
573
|
-
if (config.roundTip)
|
|
574
|
-
newEmitter.roundedCorners = config.roundTip;
|
|
575
|
-
return newEmitter;
|
|
576
|
-
case 'circle':
|
|
577
|
-
return new CircleEmitter(this.simulation, config.radius ?? 1);
|
|
578
|
-
case 'edge':
|
|
579
|
-
return new EdgeEmitter(this.simulation, config.width ?? 1, config.height ?? 1);
|
|
580
|
-
default:
|
|
581
|
-
console.warn("Unknown emitter shape:", shape);
|
|
582
|
-
return null;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
// Set or get whether the emitter uses local coordinates
|
|
586
|
-
set localCoords(value) {
|
|
587
|
-
this.simulation.useLocalCoords = value;
|
|
588
|
-
// Optional: killAllParticles if switching between local/world coordinates
|
|
589
|
-
// this.killAllParticles();
|
|
590
|
-
}
|
|
591
|
-
get localCoords() {
|
|
592
|
-
return this.simulation.useLocalCoords;
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Updates emitter transform.
|
|
596
|
-
* @param {Vector3} position - World-space position.
|
|
597
|
-
* @param {Quaternion} rotation - World-space rotation (must be a Quaternion).
|
|
598
|
-
* @param {Vector3} scale - World-space scale.
|
|
599
|
-
*/
|
|
600
|
-
updateEmitterTransform({ position, rotation, scale }) {
|
|
601
|
-
const emitterMatrix = new Matrix4().compose(position, rotation, scale);
|
|
602
|
-
const emitterInverseMatrix = new Matrix4().copy(emitterMatrix).invert();
|
|
603
|
-
// Use Simulation setters instead of directly touching uniforms
|
|
604
|
-
this.simulation.emitterMatrix = emitterMatrix;
|
|
605
|
-
this.simulation.emitterInverseMatrix = emitterInverseMatrix;
|
|
606
|
-
// Apply world transform in world space mode
|
|
607
|
-
if (!this.localCoords) {
|
|
608
|
-
this.visualization.mesh.matrix.copy(emitterInverseMatrix);
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
this.visualization.mesh.matrix.identity();
|
|
612
|
-
}
|
|
613
|
-
this.visualization.mesh.matrixAutoUpdate = false;
|
|
614
|
-
}
|
|
615
|
-
async generateNoisePreview() {
|
|
616
|
-
// Expensive operation; only call when needed
|
|
617
|
-
this.noiseTexture.render();
|
|
618
|
-
// Await the promise from getTexture
|
|
619
|
-
const jpegData = await this.noiseTexture.getTexture();
|
|
620
|
-
return jpegData;
|
|
621
|
-
}
|
|
622
|
-
setSize(width, height) {
|
|
623
|
-
this.visualization.setSize(width, height);
|
|
624
|
-
}
|
|
625
|
-
setCamera(camera) {
|
|
626
|
-
if (camera instanceof PerspectiveCamera) {
|
|
627
|
-
this.visualization.setCameraFOV(camera.fov);
|
|
628
|
-
this.visualization.isCameraPerspective = true;
|
|
629
|
-
}
|
|
630
|
-
else if (camera instanceof OrthographicCamera) {
|
|
631
|
-
this.visualization.setCameraFOV(0);
|
|
632
|
-
this.visualization.isCameraPerspective = false;
|
|
633
|
-
}
|
|
634
|
-
else {
|
|
635
|
-
console.error("Particle System: Unknown camera mode.");
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
restart() {
|
|
639
|
-
this.killAllParticles();
|
|
640
|
-
this.resetTimer();
|
|
641
|
-
if (this.isRunning)
|
|
642
|
-
this.showParticles();
|
|
643
|
-
}
|
|
644
|
-
resetTimer() {
|
|
645
|
-
this.elapsedTime = 0;
|
|
646
|
-
this.timeSinceLastSpawn = this.spawnRate; // force spawn at the next update
|
|
647
|
-
this.emissionCounter = 0;
|
|
648
|
-
this.time.start(); // reset the simulation clock
|
|
649
|
-
}
|
|
650
|
-
killAllParticles() {
|
|
651
|
-
this.simulation.killAllParticles();
|
|
652
|
-
}
|
|
653
|
-
hideParticles() {
|
|
654
|
-
this.visualization.hideParticles();
|
|
655
|
-
}
|
|
656
|
-
showParticles() {
|
|
657
|
-
this.visualization.showParticles();
|
|
658
|
-
}
|
|
659
|
-
emitAllParticles() {
|
|
660
|
-
// TODO that this emits the maximum number of particles
|
|
661
|
-
// which is the texture widthxheight and most likely does not
|
|
662
|
-
// correspond to the one specified by the user! it would be nice to support
|
|
663
|
-
// non-square texture data for position and velocity to have a better match.
|
|
664
|
-
this.simulation.writeInitialParticleData();
|
|
665
|
-
this.simulation.emitNewParticles(this.simulation.maxParticles, false, 0);
|
|
666
|
-
}
|
|
667
|
-
emitNewParticles(particleCount = 1, continuous = true) {
|
|
668
|
-
this.simulation.emitNewParticles(particleCount, continuous, this.spawnRate);
|
|
669
|
-
}
|
|
670
|
-
// delta: time difference in seconds
|
|
671
|
-
render(delta) {
|
|
672
|
-
if (!this.isRunning || this.isPaused)
|
|
673
|
-
return;
|
|
674
|
-
delta ??= this.time.getDelta();
|
|
675
|
-
if (this.duration !== -1 && this.elapsedTime > this.duration) {
|
|
676
|
-
this.killAllParticles();
|
|
677
|
-
this.hideParticles();
|
|
678
|
-
this.isRunning = false;
|
|
679
|
-
}
|
|
680
|
-
this.timeSinceLastSpawn = (this.timeSinceLastSpawn ?? 0) + delta;
|
|
681
|
-
const shouldEmit = () => {
|
|
682
|
-
const enoughTimePassed = this.timeSinceLastSpawn >= this.spawnRate && this.isEmitting;
|
|
683
|
-
const justStarted = this.elapsedTime === 0;
|
|
684
|
-
const underMaxEmission = this.emissionCounter < this.maxEmission || this.maxEmission === -1;
|
|
685
|
-
return (enoughTimePassed || justStarted) && underMaxEmission;
|
|
686
|
-
};
|
|
687
|
-
if (shouldEmit()) {
|
|
688
|
-
this.emitNewParticles(this.spawnAmount, this.continuousEmissionFlag);
|
|
689
|
-
this.timeSinceLastSpawn -= this.spawnRate;
|
|
690
|
-
this.emissionCounter += 1;
|
|
691
|
-
if (this.maxEmission !== -1 && this.emissionCounter >= this.maxEmission) {
|
|
692
|
-
this.isEmitting = false;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
// Delegate simulation update to Simulation class
|
|
696
|
-
this.simulation.render(this.elapsedTime, delta);
|
|
697
|
-
// Delegate visual update to Visualization class
|
|
698
|
-
this.visualization.render(this.elapsedTime, delta);
|
|
699
|
-
this.elapsedTime += delta;
|
|
700
|
-
// TODO it would be great to have a way to detect if there are particles alive so we can stop the system
|
|
701
|
-
// if (this.particlesAlive == 0) {
|
|
702
|
-
// this.isRunning = false;
|
|
703
|
-
// }
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
//# sourceMappingURL=ParticleSystem.js.map
|