@galacean/cli 2.0.0-alpha.24 → 2.0.0-alpha.26
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/cli.bundle.cjs +820 -957
- package/dist/preview-client/_static/{Accordion-f938dadf.js → Accordion-2cd014f1.js} +1 -1
- package/dist/preview-client/_static/{AmbientLightAsset-e34de607.js → AmbientLightAsset-be9e872c.js} +1 -1
- package/dist/preview-client/_static/{AnimationClipAsset-b084da2a.js → AnimationClipAsset-d7b37af0.js} +1 -1
- package/dist/preview-client/_static/{AnimatorControllerAsset-6cc04274.js → AnimatorControllerAsset-2716497a.js} +1 -1
- package/dist/preview-client/_static/{AnimatorStore-0bc90c37.js → AnimatorStore-883a28ad.js} +1 -1
- package/dist/preview-client/_static/{AssetViewer-d2c63b00.js → AssetViewer-3847c058.js} +1 -1
- package/dist/preview-client/_static/{AudioAsset-9c715952.js → AudioAsset-c28f33ab.js} +1 -1
- package/dist/preview-client/_static/{AudioComponent-80d06ef4.js → AudioComponent-3d6c73ce.js} +1 -1
- package/dist/preview-client/_static/{Callout-48e71f13.js → Callout-e2a89f6f.js} +1 -1
- package/dist/preview-client/_static/{CameraComponent-9c9db3fb.js → CameraComponent-3dc63451.js} +1 -1
- package/dist/preview-client/_static/{Component-b95aa2af.js → Component-0f881fc1.js} +1 -1
- package/dist/preview-client/_static/{DirectLight-b0490ef7.js → DirectLight-96dbba47.js} +1 -1
- package/dist/preview-client/_static/{FontAsset-6e9c0549.js → FontAsset-d34b5378.js} +1 -1
- package/dist/preview-client/_static/{FormItemArray-b2a3d249.js → FormItemArray-b8cda1d2.js} +1 -1
- package/dist/preview-client/_static/{GlTFAsset-83e8190e.js → GlTFAsset-5970e707.js} +2 -2
- package/dist/preview-client/_static/{IconPlus-172c6c17.js → IconPlus-def01e2b.js} +1 -1
- package/dist/preview-client/_static/{IconPointFilled-bad94cf1.js → IconPointFilled-62d3c3b2.js} +1 -1
- package/dist/preview-client/_static/{LightBaseComponent-b4854e8a.js → LightBaseComponent-d651a276.js} +1 -1
- package/dist/preview-client/_static/{LottieAnimationComponent-efd5da2b.js → LottieAnimationComponent-f10dc558.js} +1 -1
- package/dist/preview-client/_static/{MarkdownAsset-b42846c0.js → MarkdownAsset-b2a3fad5.js} +1 -1
- package/dist/preview-client/_static/{MaterialAsset-0b9d7eba.js → MaterialAsset-5353c4cb.js} +1 -1
- package/dist/preview-client/_static/{MaterialInspector-23ea0240.js → MaterialInspector-8d466d59.js} +1 -1
- package/dist/preview-client/_static/{Menu-05c1f0a4.js → Menu-c8e6194b.js} +1 -1
- package/dist/preview-client/_static/{MeshAsset-85e99837.js → MeshAsset-c2bf60c5.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererBaseComponent-5621d663.js → MeshRendererBaseComponent-fde6b6a5.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererComponent-c3c3c683.js → MeshRendererComponent-430774ef.js} +1 -1
- package/dist/preview-client/_static/{MeshThumbnail-b1283749.js → MeshThumbnail-07ffa076.js} +1 -1
- package/dist/preview-client/_static/ParticleRendererComponent-e106bd8c.js +26 -0
- package/dist/preview-client/_static/{PhysicsMaterialAsset-cb9afb6e.js → PhysicsMaterialAsset-a2f73b5c.js} +1 -1
- package/dist/preview-client/_static/{PhysicsStore-0a751fa0.js → PhysicsStore-818c2f61.js} +1 -1
- package/dist/preview-client/_static/{PointLight-a2bfed75.js → PointLight-add790ea.js} +1 -1
- package/dist/preview-client/_static/{PostProcessComponent-040cf521.js → PostProcessComponent-af270a77.js} +1 -1
- package/dist/preview-client/_static/{PrefabAsset-265f6f48.js → PrefabAsset-59743dbb.js} +1 -1
- package/dist/preview-client/_static/{PrimitiveMesh-70c93e7e.js → PrimitiveMesh-075dda8a.js} +1 -1
- package/dist/preview-client/_static/{ReferencedMaterial-831d0583.js → ReferencedMaterial-d11151b5.js} +1 -1
- package/dist/preview-client/_static/{RenderTargetAsset-b810caf3.js → RenderTargetAsset-b3cd1c49.js} +1 -1
- package/dist/preview-client/_static/{SceneAsset-d05b1a79.js → SceneAsset-08752701.js} +1 -1
- package/dist/preview-client/_static/{ShaderAsset-370b6f1c.js → ShaderAsset-a9d667f5.js} +1 -1
- package/dist/preview-client/_static/{ShaderChunkAsset-e3487bd1.js → ShaderChunkAsset-e43dde8a.js} +1 -1
- package/dist/preview-client/_static/{ShaderUIScriptAsset-ebf57ceb.js → ShaderUIScriptAsset-e1cd0b8b.js} +1 -1
- package/dist/preview-client/_static/{SkinnedMeshRendererComponent-ee33da25.js → SkinnedMeshRendererComponent-9756bd5f.js} +1 -1
- package/dist/preview-client/_static/{SpineAnimationComponent-12e694e8.js → SpineAnimationComponent-f3e0ff44.js} +1 -1
- package/dist/preview-client/_static/{SpineSkeletonDataAsset-0dffbb4d.js → SpineSkeletonDataAsset-43b731f1.js} +1 -1
- package/dist/preview-client/_static/{SpotLight-ada565f2.js → SpotLight-649b0e21.js} +1 -1
- package/dist/preview-client/_static/{SpriteBaseComponent-3156cb3b.js → SpriteBaseComponent-d2a7ab4c.js} +1 -1
- package/dist/preview-client/_static/{SpriteMaskComponent-a32024e1.js → SpriteMaskComponent-2c1cef5e.js} +1 -1
- package/dist/preview-client/_static/{SpriteRendererComponent-489486e0.js → SpriteRendererComponent-33b71997.js} +1 -1
- package/dist/preview-client/_static/{TextBaseComponent-520dea39.js → TextBaseComponent-9310e0c6.js} +1 -1
- package/dist/preview-client/_static/{TextRendererComponent-6be5f80c.js → TextRendererComponent-8dc0d7fb.js} +1 -1
- package/dist/preview-client/_static/{TextureAsset-9cd94531.js → TextureAsset-a7ff39b1.js} +1 -1
- package/dist/preview-client/_static/{Tooltip-71e5a4e7.js → Tooltip-b5be390f.js} +1 -1
- package/dist/preview-client/_static/{TrailRendererComponent-74bf88c0.js → TrailRendererComponent-c4635fab.js} +1 -1
- package/dist/preview-client/_static/{TransformBaseComponent-0d241199.js → TransformBaseComponent-1473deaa.js} +1 -1
- package/dist/preview-client/_static/{TransformComponent-49d279f5.js → TransformComponent-e544f7ac.js} +1 -1
- package/dist/preview-client/_static/{XRReferenceImageAsset-79e78558.js → XRReferenceImageAsset-96f516ba.js} +1 -1
- package/dist/preview-client/_static/{audio-5d0ddf55.js → audio-b5fbde34.js} +1 -1
- package/dist/preview-client/_static/{createOnModelChange-e65da908.js → createOnModelChange-370b83da.js} +1 -1
- package/dist/preview-client/_static/{createReactComponent-cb70ea50.js → createReactComponent-58d9f0dd.js} +1 -1
- package/dist/preview-client/_static/{index-7e414715.js → index-05b76766.js} +1 -1
- package/dist/preview-client/_static/{index-b13216a9.js → index-0dd5bb36.js} +1 -1
- package/dist/preview-client/_static/{index-d00c8bc3.js → index-29c59aff.js} +1 -1
- package/dist/preview-client/_static/index-3680d0e0.js +1 -0
- package/dist/preview-client/_static/index-42aa3a49.js +1 -0
- package/dist/preview-client/_static/index-496f331d.js +1 -0
- package/dist/preview-client/_static/{index-46c87b46.js → index-74bcfad9.js} +1 -1
- package/dist/preview-client/_static/{index-788e8750.js → index-88650db7.js} +1 -1
- package/dist/preview-client/_static/index-9f0122f0.js +1 -0
- package/dist/preview-client/_static/{index-b4bde36a.js → index-ab8556cb.js} +3 -3
- package/dist/preview-client/_static/{index-e44b357e.js → index-c3dec278.js} +11 -11
- package/dist/preview-client/_static/index-c6b7045c.js +1 -0
- package/dist/preview-client/_static/index-cdbb2f4d.js +1 -0
- package/dist/preview-client/_static/{index-ea7fe254.js → index-da16047f.js} +1 -1
- package/dist/preview-client/_static/{index-f7bd6fef.js → index-dd0763bf.js} +1 -1
- package/dist/preview-client/_static/index-dddcae01.js +1 -0
- package/dist/preview-client/_static/{ktx2-encoder-522fc017.js → ktx2-encoder-db93524f.js} +1 -1
- package/dist/preview-client/_static/{module-57b6e417.js → module-ada3dced.js} +1 -1
- package/dist/preview-client/_static/{module-5906e0d4.js → module-de7ee724.js} +1 -1
- package/dist/preview-client/_static/{module-5547be1c.js → module-ec094ef6.js} +1 -1
- package/dist/preview-client/_static/postmen-2853c0e6.js +2 -0
- package/dist/preview-client/_static/{shader-data-utils-000170ae.js → shader-data-utils-f0e4f5a3.js} +1 -1
- package/dist/preview-client/index.html +1 -1
- package/package.json +27 -32
- package/dist/preview-client/_static/ParticleRendererComponent-94656239.js +0 -26
- package/dist/preview-client/_static/index-0fef73f8.js +0 -1
- package/dist/preview-client/_static/index-1e036622.js +0 -1
- package/dist/preview-client/_static/index-1fd4207a.js +0 -1
- package/dist/preview-client/_static/index-6649d404.js +0 -1
- package/dist/preview-client/_static/index-87ef1c72.js +0 -1
- package/dist/preview-client/_static/index-d9ee84ce.js +0 -1
- package/dist/preview-client/_static/index-debbe073.js +0 -1
- package/dist/preview-client/_static/postmen-443b3e5f.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aJ as l,aM as c,av as m,aO as f,p as h}from"./index-
|
|
1
|
+
import{aJ as l,aM as c,av as m,aO as f,p as h}from"./index-c3dec278.js";import{u as d}from"./index-cdbb2f4d.js";import{c as u}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{c as M}from"./createOnModelChange-370b83da.js";import{R}from"./ReferencedMaterial-d11151b5.js";import{M as v}from"./MeshRendererBaseComponent-fde6b6a5.js";import"./MaterialInspector-8d466d59.js";import"./IconPointFilled-62d3c3b2.js";import"./createReactComponent-58d9f0dd.js";const x=l(function(o){const[r,s]=c.useState(null),e=o.data,{assetStore:t,inspectorFacade:n}=d();return c.useEffect(()=>{t.getAssetByRef(e.material).then(a=>{s(a)})},[e.material]),m.jsxs(m.Fragment,{children:[m.jsx(f.List,{model:e,configs:e.formSchema.items,onModelChange:M("component",e.id,n,e)}),r&&m.jsx(R,{materialAsset:r})]})});var C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,i=(o,r,s,e)=>{for(var t=e>1?void 0:e?j(r,s):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(e?a(r,s,t):a(t))||t);return e&&t&&C(r,s,t),t};let p=class extends v{constructor(o,r){super(o,r)}};i([h({assetType:["PrimitiveMesh","Mesh"]})],p.prototype,"mesh",2);p=i([u({type:"MeshRenderer",customInspector:x,componentsMenu:{label:"component.renderer.mesh.title"}})],p);export{p as MeshRendererComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var r=Object.defineProperty;var c=(i,e,t)=>e in i?r(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>(c(i,typeof e!="symbol"?e+"":e,t),t);import{y as h,z as o,R as d}from"./index-
|
|
1
|
+
var r=Object.defineProperty;var c=(i,e,t)=>e in i?r(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>(c(i,typeof e!="symbol"?e+"":e,t),t);import{y as h,z as o,R as d}from"./index-c3dec278.js";class a{static update(e,t){this.entity?this.entity.isActive=!0:this.initScene(e),this.meshRenderer.mesh=t.engineObject}static clear(){this.entity.isActive=!1}static initScene(e){const t=this.entity=e.createChild("mesh");t.transform.setRotation(16,-47.4,-16.7),this.meshRenderer=t.addComponent(h);const s=new o(e.engine);s.baseColor.set(.7,.7,.7,1),s.metallic=0,s.renderFace=d.Double,this.meshRenderer.setMaterial(s)}}n(a,"entity"),n(a,"meshRenderer");export{a as M};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var ea=Object.defineProperty;var ta=(a,e,t)=>e in a?ea(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var S=(a,e,t)=>(ta(a,typeof e!="symbol"?e+"":e,t),t);import{bB as Ie,b8 as Ee,av as l,aw as ae,b7 as we,cb as ve,bT as lt,bU as je,cc as ie,ca as le,eW as me,aJ as Z,aM as F,aO as aa,aK as q,bm as ze,cm as ee,bk as ct,fa as Ce,fb as de,bA as ra,bX as sa,bI as L,fc as oa,bD as Vt,fd as na,fe as ia,ff as la,fg as ca,fh as pa,fi as $,aH as ua,fj as ma,aI as It,aL as Ct,fk as da,fl as ha,fm as he,dr as fa,c8 as Te,c9 as _e,c5 as ge,ce as Ot,b3 as Et,cf as wt,f7 as ya,E as ba,C as R,fn as W,fo as K,fp as be,bl as va,e as m,x as J,f as V,aE as ga,p as C,s as O}from"./index-c3dec278.js";import{u as At}from"./index-cdbb2f4d.js";import{c as xa}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{c as Sa}from"./createOnModelChange-370b83da.js";import{R as Pa}from"./ReferencedMaterial-d11151b5.js";import"./TextureAsset-a7ff39b1.js";import"./GlTFAsset-5970e707.js";import"./MaterialAsset-5353c4cb.js";import{MeshAsset as Ma}from"./MeshAsset-c2bf60c5.js";import"./AnimatorControllerAsset-2716497a.js";import"./AnimationClipAsset-d7b37af0.js";import{I as za}from"./ShaderChunkAsset-e43dde8a.js";import"./AmbientLightAsset-be9e872c.js";import"./SpineSkeletonDataAsset-43b731f1.js";import"./FontAsset-d34b5378.js";import"./SceneAsset-08752701.js";import"./ShaderAsset-a9d667f5.js";import"./PrimitiveMesh-075dda8a.js";import"./XRReferenceImageAsset-96f516ba.js";import"./PrefabAsset-59743dbb.js";import"./PhysicsMaterialAsset-a2f73b5c.js";import"./RenderTargetAsset-b3cd1c49.js";import"./AudioAsset-c28f33ab.js";import"./index-da16047f.js";import"./MarkdownAsset-b2a3fad5.js";import{I as Ca}from"./IconPlus-def01e2b.js";import{B as rt}from"./index-dd0763bf.js";import{c as Oa}from"./createReactComponent-58d9f0dd.js";import"./MaterialInspector-8d466d59.js";import"./IconPointFilled-62d3c3b2.js";import"./ktx2-encoder-db93524f.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-b5be390f.js";import"./AssetViewer-3847c058.js";import"./glTFIO-45ff9a17.js";import"./shader-data-utils-f0e4f5a3.js";import"./index-05b76766.js";import"./MeshThumbnail-07ffa076.js";import"./bundlers-9b0d37fc.js";import"./module-ec094ef6.js";import"./module-ada3dced.js";import"./ShaderUIScriptAsset-e1cd0b8b.js";import"./FormItemArray-b8cda1d2.js";import"./Accordion-2cd014f1.js";import"./module-de7ee724.js";import"./Menu-c8e6194b.js";/**
|
|
2
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/var kt=Ie("outline","ease-in","IconEaseIn",[["path",{d:"M3 20c8 0 18 -16 18 -16",key:"svg-0"}]]);/**
|
|
7
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/var Dt=Ie("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
12
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/var Bt=Ie("outline","plus-minus","IconPlusMinus",[["path",{d:"M4 7h6",key:"svg-0"}],["path",{d:"M7 4v6",key:"svg-1"}],["path",{d:"M20 18h-6",key:"svg-2"}],["path",{d:"M5 19l14 -14",key:"svg-3"}]]);/**
|
|
17
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/var Ft=Ie("outline","vector-bezier-2","IconVectorBezier2",[["path",{d:"M3 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M17 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M7 5l7 0",key:"svg-2"}],["path",{d:"M10 19l7 0",key:"svg-3"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}],["path",{d:"M7 5.5a5 6.5 0 0 1 5 6.5a5 6.5 0 0 0 5 6.5",key:"svg-6"}]]);const jt=[{type:"constant",icon:l.jsx(Dt,{size:"14px"}),columns:"1fr 32px"},{type:"gradient",icon:l.jsx(kt,{size:"14px"}),columns:"1fr 32px"},{type:"two-constant",icon:l.jsx(Bt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-gradient",icon:l.jsx(Ft,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Ea(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:ie(r)}:t==="two-constant"?{type:t,label:e.label,value:[ie(r[0]),ie(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(s=>({value:ie(s.value),time:s.position})),alpha:r.alpha.map(s=>({value:s.value.a,time:s.position}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(s=>({value:ie(s.value),time:s.position})),alpha:r[0].alpha.map(s=>({value:s.value.a,time:s.position}))},{color:r[1].color.map(s=>({value:ie(s.value),time:s.position})),alpha:r[1].alpha.map(s=>({value:s.value.a,time:s.position}))}]}:e})}function wa(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:le(r)}:t==="two-constant"?{type:t,label:e.label,value:[le(r[0]),le(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(s=>({value:le(s.value),position:s.time})),alpha:r.alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(s=>({value:le(s.value),position:s.time})),alpha:r[0].alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))},{color:r[1].color.map(s=>({value:le(s.value),position:s.time})),alpha:r[1].alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))}]}:e})}function st({hdr:a,value:e,onValueChange:t,...r}){return a?l.jsx(ve,{...r,mode:"hdr",value:e,onValueChange:t}):l.jsx(ve,{...r,mode:"constant",value:e,onValueChange:t})}function Yt(a){var u;const{label:e,labelFirst:t,info:r,value:s,hdr:c=!1}=a,[o,n]=Ee({prop:wa(s),onChange:i=>{a.onValueChange&&a.onValueChange(Ea(i),d)}}),[d,b]=Ee({prop:a.type,defaultProp:"constant",onChange:i=>{a.onValueChange&&a.onValueChange(s,i)}});function v(i,g){var y;return g==="trigger"?(y=jt.find(M=>M.type===i))==null?void 0:y.icon:i}const p=i=>{n(g=>g.map(y=>y.type!==d?y:{...y,value:i}))},z=i=>g=>{n(y=>y.map(M=>{if(M.type!==d)return M;const{value:j}=M;if(M.type==="two-constant"){if(i===0)return{...M,value:[g,j[1]]};if(i===1)return{...M,value:[j[0],g]}}return M}))},h=i=>{n(g=>g.map(y=>y.type!==d?y:y.type==="gradient"?{...y,value:i}:y))},f=i=>g=>{n(y=>y.map(M=>{if(M.type!==d)return M;if(M.type==="two-gradient"){const{value:j}=M;if(i===0)return{...M,value:[g,j[1]]};if(i===1)return{...M,value:[j[0],g]}}return M}))};return l.jsxs(ae,{label:e,info:r,fieldCss:{gridTemplateColumns:(u=jt.find(i=>i.type===d))==null?void 0:u.columns},children:[o.map(i=>{const{type:g,value:y}=i;if(!g||d!==g)return null;switch(g){case"constant":return l.jsx(st,{fullsize:!0,hdr:c,value:y,onValueChange:p},"constant");case"gradient":return l.jsx(ve,{fullsize:!0,mode:"particle",value:y,onValueChange:h},"gradient");case"two-constant":return l.jsxs(we.Fragment,{children:[l.jsx(st,{fullsize:!0,hdr:c,value:y[0],onValueChange:z(0)}),l.jsx(st,{fullsize:!0,hdr:c,value:y[1],onValueChange:z(1)})]},"two-constant");case"two-gradient":return l.jsxs(we.Fragment,{children:[l.jsx(ve,{fullsize:!0,mode:"particle",value:y[0],onValueChange:f(0)}),l.jsx(ve,{fullsize:!0,mode:"particle",value:y[1],onValueChange:f(1)})]},"two-gradient");default:return null}}),l.jsx(lt,{defaultValue:"constant",position:"item-aligned",cornerArrow:!0,value:d,valueRenderer:v,onValueChange:i=>b(i),children:o.map(i=>l.jsx(je,{value:i.type,children:i.label||i.type},i.type))})]})}const Zt=[{type:"constant",icon:l.jsx(Dt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"curve",icon:l.jsx(kt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"two-constant",icon:l.jsx(Bt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-curve",icon:l.jsx(Ft,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function ja(a,e){var t;return e==="trigger"?(t=Zt.find(r=>r.type===a))==null?void 0:t.icon:a}const ot=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Le(a){var _;const{label:e,info:t,value:r,onValueChange:s,algo:c="bezier",yRangeMode:o,yTickScale:n,yTickScaleMin:d,yTickScaleMax:b,onYTickScaleChange:v,onYTickScaleCommit:p,hideTypeSelector:z,...h}=a,[f,u]=Ee({prop:a.type,defaultProp:"constant",onChange:E=>{s&&s(r,E)}}),[i,g]=Ee({prop:r,onChange:E=>{s&&s(E,f)},defaultProp:[{value:0,type:"constant"},{value:ot,type:"curve"},{value:[0,0],type:"two-constant"},{value:[ot,ot],type:"two-curve"}]}),y=E=>{g(I=>I.map(T=>T.type!==f?T:{...T,value:E}))},M=E=>I=>{g(T=>T.map(A=>{if(A.type!==f)return A;const{value:X}=A;return E===0?{...A,value:[I,X[1]]}:E===1?{...A,value:[X[0],I]}:A}))},j=E=>{g(I=>I.map(T=>T.type!==f?T:{...T,value:E}))},w=E=>I=>{g(T=>T.map(A=>{if(A.type!==f)return A;const{value:X}=A;return E===0?{...A,value:[I,X[1]]}:E===1?{...A,value:[X[0],I]}:A}))},B={algo:c,yRangeMode:o,yTickScale:n,yTickScaleMin:d,yTickScaleMax:b,onYTickScaleChange:v,onYTickScaleCommit:p};return l.jsxs(ae,{label:e,info:t,fieldCss:{gridTemplateColumns:(_=Zt.find(E=>E.type===f))==null?void 0:_.columns,columnGap:"$1"},...h,children:[i.map(E=>{const{type:I,value:T,min:A,max:X,step:U}=E;if(!I||f!==I)return null;switch(I){case"constant":return l.jsx(me,{min:A,max:X,dragStep:U,step:U,value:T,onValueChange:y},"constant");case"curve":return l.jsx(rt,{...B,value:T,onChange:j},"curve");case"two-constant":return l.jsxs(we.Fragment,{children:[l.jsx(me,{size:"sm",startSlot:"min",value:T[0],min:A,max:X,dragStep:U,step:U,onValueChange:M(0)}),l.jsx(me,{size:"sm",startSlot:"max",value:T[1],min:A,max:X,dragStep:U,step:U,onValueChange:M(1)})]},"two-constant");case"two-curve":return l.jsxs(we.Fragment,{children:[l.jsx(rt,{...B,value:T[0],onChange:w(0)}),l.jsx(rt,{...B,value:T[1],onChange:w(1)})]},"two-curve");default:return null}}),!z&&l.jsx(lt,{value:f,position:"item-aligned",cornerArrow:!0,valueRenderer:ja,onValueChange:E=>u(E),children:i.map(E=>l.jsx(je,{value:E.type,children:E.label||E.type},E.type))})]})}/**
|
|
22
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Ta=Oa("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);const _a=Z(function(a){const[e,t]=F.useState(null),r=a.data,{assetStore:s,inspectorFacade:c}=At();return F.useEffect(()=>{s.getAssetByRef(r.material).then(o=>{t(o)})},[r.material]),l.jsxs(l.Fragment,{children:[l.jsx(aa.List,{model:r,configs:r.formSchema.items,onModelChange:Sa("component",r.id,c,r)}),e&&l.jsx(Pa,{materialAsset:e})]})});async function La(a,e){await a.assetStore.getAssetByRef(e)}var k=(a=>(a.BoxShape="BoxShape",a.CircleShape="CircleShape",a.ConeShape="ConeShape",a.HemisphereShape="HemisphereShape",a.SphereShape="SphereShape",a.MeshShape="MeshShape",a))(k||{});function Y(a,e){return{class:a.class,props:{...a.props,...e}}}const Ra=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsx(l.Fragment,{children:l.jsx(ze,{label:t("effects.shape.size"),value:{x:a.props.size.x,y:a.props.size.y,z:a.props.size.z},onChange:(r,s)=>{const c=Y(a,{size:{...a.props.size,[s]:r[s]}});e==null||e("shape",c)}})})}),Va=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsxs(l.Fragment,{children:[l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const s=Y(a,{radius:r});e==null||e("shape",s)}}),l.jsx(ee,{label:t("effects.shape.arc"),min:0,max:360,value:a.props.arc,onChange:r=>{const s=Y(a,{arc:r});e==null||e("shape",s)}}),l.jsx(ct,{label:t("effects.shape.arc-mode.label"),options:[{label:t("effects.shape.loop"),value:Ce.Loop},{label:t("effects.shape.random"),value:Ce.Random}],value:a.props.arcMode,onChange:r=>{const s=Y(a,{arcMode:r});e==null||e("shape",s)}}),a.props.arcMode===Ce.Loop?l.jsx(ee,{label:t("effects.shape.arc-speed.label"),step:.1,dragStep:.1,value:a.props.arcSpeed,onChange:r=>{const s=Y(a,{arcSpeed:r});e==null||e("shape",s)}}):null]})}),Ia=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsxs(l.Fragment,{children:[l.jsx(ct,{label:t("effects.shape.emit-type.label"),options:[{label:t("effects.shape.cone-base"),value:de.Base},{label:t("effects.shape.volume"),value:de.Volume}],value:a.props.emitType,onChange:r=>{const s=Y(a,{emitType:r});e==null||e("shape",s)}}),l.jsx(ee,{label:t("effects.shape.angle"),min:1e-4,max:90,step:.05,dragStep:.05,value:a.props.angle,onChange:r=>{const s=Y(a,{angle:r});e==null||e("shape",s)}}),l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const s=Y(a,{radius:r});e==null||e("shape",s)}}),l.jsx(ee,{label:t("effects.shape.length"),min:1e-4,step:.1,dragStep:.1,value:a.props.length,disabled:a.props.emitType===de.Base,onChange:r=>{const s=Y(a,{length:r});e==null||e("shape",s)}})]})}),Aa=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsx(l.Fragment,{children:l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const s=Y(a,{radius:r});e==null||e("shape",s)}})})}),ka=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsx(l.Fragment,{children:l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const s=Y(a,{radius:r});e==null||e("shape",s)}})})}),Da=Z(({item:a,onModelChange:e})=>{const{t}=q(),{assetStore:r}=At(),s=Object.values(r.assets).filter(n=>n instanceof Ma),[c,o]=F.useState("");return F.useEffect(()=>{let n=!1;return(async()=>{if(!a.props.mesh){o("");return}try{const b=await r.getAssetByRef(a.props.mesh);n||o((b==null?void 0:b.name)??"")}catch{n||o("")}})(),()=>{n=!0}},[r,a.props.mesh]),l.jsx(ra,{label:t("effects.renderer.render-mode.options.mesh"),assets:s,dropLayer:0,value:c,onSelect:async n=>{o(n.name);const d=!!n.engineObject;d||sa.error("Mesh asset is not initialized");const b={class:a.class,props:{...a.props,mesh:n.getCurrentRef(),enabled:d}};e==null||e("shape",b)}})}),Ba=Z(({item:a,onModelChange:e})=>{const{t}=q();return l.jsx(ee,{label:t("effects.shape.random-direction-amount"),info:t("effects.shape.random-direction-amount-tip"),min:0,step:1,dragStep:.05,value:a.props.randomDirectionAmount||0,onChange:r=>{const s=Y(a,{randomDirectionAmount:r});e==null||e("shape",s)}})}),Fa=Z(({item:a,onModelChange:e})=>{const{t}=q(),r=a.props.position??{x:0,y:0,z:0},s=a.props.rotation??{x:0,y:0,z:0},c=a.props.scale??{x:1,y:1,z:1};return l.jsxs(l.Fragment,{children:[l.jsx(ze,{label:t("effects.shape.position"),value:{x:r.x,y:r.y,z:r.z},onChange:(o,n)=>{const d=Y(a,{position:{x:r.x,y:r.y,z:r.z,[n]:o[n]},rotation:{x:s.x,y:s.y,z:s.z},scale:{x:c.x,y:c.y,z:c.z}});e==null||e("shape",d)}}),l.jsx(ze,{label:t("effects.shape.rotation"),value:{x:s.x,y:s.y,z:s.z},onChange:(o,n)=>{const d=Y(a,{position:{x:r.x,y:r.y,z:r.z},rotation:{x:s.x,y:s.y,z:s.z,[n]:o[n]},scale:{x:c.x,y:c.y,z:c.z}});e==null||e("shape",d)}}),l.jsx(ze,{label:t("effects.shape.scale"),value:{x:c.x,y:c.y,z:c.z},onChange:(o,n)=>{const d=Y(a,{position:{x:r.x,y:r.y,z:r.z},rotation:{x:s.x,y:s.y,z:s.z},scale:{x:c.x,y:c.y,z:c.z,[n]:o[n]}});e==null||e("shape",d)}})]})}),it=new Map;function Ya(a,e){let t;switch(e.class){case k.BoxShape:{t=new pa;const r=t.size;r.copyFrom(e.props.size),t.size=r;break}case k.CircleShape:{t=new ca,t.radius=e.props.radius,t.arc=e.props.arc,t.arcMode=e.props.arcMode,t.arcSpeed=e.props.arcSpeed;break}case k.ConeShape:{t=new la,t.angle=e.props.angle,t.radius=e.props.radius,t.length=e.props.length,t.emitType=e.props.emitType;break}case k.HemisphereShape:{t=new ia,t.radius=e.props.radius;break}case k.SphereShape:{t=new na,t.radius=e.props.radius;break}case k.MeshShape:{t=new oa;const r=e.props.mesh;if(r!=null&&r.refId){const s=a.root.assetStore.assets[r.refId];t.mesh=s==null?void 0:s.engineObject}t.mesh||(t.mesh=Vt.createSphere(a.engineObject.engine));break}}if(t){if(e.props.randomDirectionAmount=e.props.randomDirectionAmount??0,t.randomDirectionAmount=e.props.randomDirectionAmount,t.enabled=e.props.enabled,e.props.position){const r=e.props.position;t.position.set(r.x,r.y,r.z)}if(e.props.rotation){const r=e.props.rotation;t.rotation.set(r.x,r.y,r.z)}if(e.props.scale){const r=e.props.scale;t.scale.set(r.x,r.y,r.z)}}return t}const Za=(a,e,t)=>{let r=it.get(`${a.id}-${t.class}`);r&&(r=JSON.parse(r),it.delete(`${a.id}-${t.class}`),Object.assign(t.props,r));const s=Ya(a,t);s&&a.applyEmissionShape(s)},Xa={BoxShape:Ra,CircleShape:Va,ConeShape:Ia,HemisphereShape:Aa,SphereShape:ka,MeshShape:Da},$a={BoxShape:{class:k.BoxShape,props:{size:{x:1,y:1,z:1},randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},CircleShape:{class:k.CircleShape,props:{radius:1,arc:360,arcMode:Ce.Random,arcSpeed:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},ConeShape:{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},HemisphereShape:{class:k.HemisphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},SphereShape:{class:k.SphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},MeshShape:{class:k.MeshShape,props:{randomDirectionAmount:0,enabled:!0,mesh:void 0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}}},qa=Z(({model:a,onModelChange:e})=>{const{t}=q(),r=a.shape;if(!r.class)return;const s=Xa[r.class];return l.jsxs(l.Fragment,{children:[l.jsx(ct,{label:t("effects.shape.type.label"),info:t("effects.shape.type.info"),value:r.class,options:[{label:t("effects.shape.options.box"),value:k.BoxShape},{label:t("effects.shape.options.circle"),value:k.CircleShape},{label:t("effects.shape.options.cone"),value:k.ConeShape},{label:t("effects.shape.options.hemisphere"),value:k.HemisphereShape},{label:t("effects.shape.options.sphere"),value:k.SphereShape},{label:t("effects.shape.options.mesh"),value:k.MeshShape}],onChange:c=>{const o=$a[c];if(a.shape&&a.shape.class!==c&&it.set(`${a.id}-${a.shape.class}`,JSON.stringify(a.shape.props)),o.class!==r.class){const n=L(o);e==null||e("shape",n)}}}),l.jsx(s,{item:r,component:a.engineObject,onModelChange:e}),l.jsx(Ba,{item:r,component:a.engineObject,onModelChange:e}),l.jsx(Fa,{item:r,component:a.engineObject,onModelChange:e})]})}),pt=["constant","two-constant","curve","two-curve"],te=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Re(a){return a.map(e=>({x:e.constructParams[0],y:e.constructParams[1]}))}const Tt={class:"ParticleCurve",constructParams:[{class:"CurveKey",constructParams:[0,0]},{class:"CurveKey",constructParams:[.25,.25]},{class:"CurveKey",constructParams:[.75,.75]},{class:"CurveKey",constructParams:[1,1]}]};function D(a,e=0,t=0,r=$.Constant){return{module:a,mode:r,constantMin:t,constantMax:e,curveMax:L(Tt),curveMin:L(Tt)}}function ce(a,e=0,t=0,r=$.Constant){return{enabled:!1,x:D(a,e,t,r),y:D(a,e,t,r),z:D(a,e,t,r)}}const Ka=a=>a===1/0?1/0:Math.max(1,Math.floor(a));function Na(a){if(!(a!=null&&a.constructParams))return;const e=a.constructParams[2];e===null?a.constructParams[2]=1/0:typeof e=="number"&&e!==1/0&&(a.constructParams[2]=Math.max(1,Math.floor(e)))}const Ve=1,ut=.01,Ga=ua("div",{height:"$6",display:"flex",alignItems:"center",paddingLeft:"$2",fontSize:"$sm",borderRadius:"$1",backgroundColor:"$softBg",color:"$gray9",userSelect:"none"}),Ha=l.jsx(Ta,{size:"14px"});function Wa(a,e){return e==="trigger"?Ha:a}const Ua={class:"Burst",constructParams:[0,{class:"ParticleCompositeCurve",constructParams:[15],props:{mode:$.Constant,constantMax:15,constantMin:0}},Ve,ut]},Ja=Z(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=q(),{label:s,info:c}=e,o=a.bursts,[n,d]=F.useState(-1),b=u=>{const i=L(o);u(i),t==null||t("bursts",i)},v=(u,i)=>{b(g=>{const y=g[u];y&&i(y)})},p=u=>{b(i=>{i.splice(u,1)})},z=()=>{b(u=>{u.push(L(Ua))})},h=[{title:r("effects.burst.time.label")},{title:r("effects.burst.count.label")},{title:r("effects.burst.cycles.label")},{title:r("effects.burst.interval.label")}],f=(u,i)=>{const g=Math.max(1,u.constructParams[1].props.constantMax??0,u.constructParams[1].props.constantMin??0);return{data:u,cells:[l.jsx(ae,{children:l.jsx(me,{min:0,max:a.duration,step:.05,dragStep:.05,value:u.constructParams[0],onValueChange:y=>{v(i,M=>{M.constructParams[0]=y})}})},`time-${i}`),l.jsx(Le,{type:pt[u.constructParams[1].props.mode],direction:"column",algo:"bezier",yRangeMode:"positive",yTickScale:g,yTickScaleMin:0,yTickScaleMax:g,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:u.constructParams[1].props.constantMax,type:"constant",min:0,step:1},{value:[u.constructParams[1].props.constantMin,u.constructParams[1].props.constantMax],type:"two-constant",min:0,step:1}],onValueChange:(y,M)=>{const j=y.find(w=>w.type===M);j&&v(i,w=>{switch(M){case"constant":{w.constructParams[1].props.mode=$.Constant,w.constructParams[1].props.constantMax=j.value;break}case"two-constant":{w.constructParams[1].props.mode=$.TwoConstants,w.constructParams[1].props.constantMin=j.value[0],w.constructParams[1].props.constantMax=j.value[1];break}}})}},`count-${i}`),l.jsxs(ae,{fieldCss:{gridTemplateColumns:"minmax(0, 1fr) 32px",columnGap:"$1"},children:[u.constructParams[2]===1/0?l.jsx(Ga,{children:"∞"}):l.jsx(me,{min:1,step:1,dragStep:1,value:u.constructParams[2]??Ve,onValueChange:y=>{v(i,M=>{M.constructParams[2]=Ka(y)})}}),l.jsxs(lt,{value:u.constructParams[2]===1/0?"infinity":"number",position:"item-aligned",cornerArrow:!0,valueRenderer:Wa,onValueChange:y=>{v(i,M=>{M.constructParams[2]=y==="infinity"?1/0:Ve})},children:[l.jsx(je,{value:"number",children:r("effects.burst.cycles.number")}),l.jsx(je,{value:"infinity",children:r("effects.burst.cycles.infinity")})]})]},`cycles-${i}`),l.jsx(ae,{children:l.jsx(me,{disabled:!u.constructParams[2]||u.constructParams[2]===1,min:.01,step:.01,dragStep:.01,value:u.constructParams[3]??ut,onValueChange:y=>{v(i,M=>{M.constructParams[3]=y})}})},`interval-${i}`)]}};return l.jsx(ma,{columns:h,items:o.map((u,i)=>f(u,i)),label:r(s),info:r(c),addable:!1,emptyText:r("effects.burst.empty","No bursts"),selectedIndex:n,onRowClick:d,sideSlot:l.jsxs(It,{direction:"column",gap:"xs",children:[l.jsx(Ct,{variant:"soft",onClick:z,css:{flex:1},children:l.jsx(Ca,{size:"14px"})}),l.jsx(Ct,{variant:"soft",css:{flex:1},onClick:()=>{const u=n>=0&&n<o.length?n:o.length-1;u>=0&&(p(u),d(Math.min(u,o.length-2)))},children:l.jsx(za,{size:"14px"})})]})})}),Qa=(a,e,t)=>{const r=a.engineObject.generator.emission,s=r.bursts;for(let c=s.length-1;c>=0;c--)r.removeBurst(s[c]);for(let c=0;c<t.length;c++){const o=t[c];if(!o||!Array.isArray(o.constructParams)||o.constructParams.length<2){console.warn(`Invalid burst item at index ${c}:`,o);continue}const n=o.constructParams[0],d=o.constructParams[1],b=o.constructParams[2]??Ve,v=o.constructParams[3]??ut;if(!d||!d.props){console.warn(`Invalid burst count data at index ${c}:`,d);continue}const p=d.props,z=new da(p.constantMax);z.mode=p.mode,z.constantMin=p.constantMin,z.constantMax=p.constantMax,z.constant=p.constantMax;const h=new ha(n,z);h.cycles=b,h.repeatInterval=v,r.addBurst(h)}};function _t(a="colorOverLifetime"){return{module:a,mode:he.Gradient,gradientMax:{class:"ParticleGradient",constructParams:[[{color:{r:1,g:1,b:1,a:1},time:0},{color:{r:1,g:1,b:1,a:1},time:.3},{color:{r:1,g:1,b:1,a:1},time:.6},{color:{r:1,g:1,b:1,a:1},time:1}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]},gradientMin:{class:"ParticleGradient",constructParams:[[{time:0,color:{r:1,g:1,b:1,a:1}},{time:.3,color:{r:1,g:1,b:1,a:1}},{time:.6,color:{r:1,g:1,b:1,a:1}},{time:1,color:{r:1,g:1,b:1,a:1}}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]}}}const Me=["x","y","z"],er={constant:$.Constant,"two-constant":$.TwoConstants,curve:$.Curve,"two-curve":$.TwoCurves},fe=Z(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=q(),s=e.property,{mainAxis:c}=e,o=a[s],[n,d]=F.useState({x:{max:te,min:te},y:{max:te,min:te},z:{max:te,min:te}}),[b,v]=F.useState(e.yTickScale??1),p=pt[o.x.mode];function z(i){return(g,y)=>{const M=g.find(_=>_.type===y);if(!M)return;const j=L(o),w=j[i],B=er[y];for(const _ of Me)j[_].mode=B;switch(y){case"constant":w.constantMax=M.value;break;case"two-constant":w.constantMin=M.value[0],w.constantMax=M.value[1];break;case"curve":{if(M.value.length>4)return;d(_=>({..._,[i]:{..._[i],max:M.value}})),M.value.forEach((_,E)=>{w.curveMax.constructParams[E].constructParams[0]=_.x,w.curveMax.constructParams[E].constructParams[1]=_.y*b});break}case"two-curve":{if(M.value[0].length>4||M.value[1].length>4)return;d(_=>({..._,[i]:{min:M.value[0],max:M.value[1]}})),M.value[0].forEach((_,E)=>{w.curveMin.constructParams[E].constructParams[0]=_.x,w.curveMin.constructParams[E].constructParams[1]=_.y*b}),M.value[1].forEach((_,E)=>{w.curveMax.constructParams[E].constructParams[0]=_.x,w.curveMax.constructParams[E].constructParams[1]=_.y*b});break}}a[s]=j,t==null||t(s,j)}}function h(i){return[{value:o[i].constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[o[i].constantMin,o[i].constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:n[i].max,type:"curve",label:r("effects.curve.curve")},{value:[n[i].min,n[i].max],type:"two-curve",label:r("effects.curve.two-curve")}]}const f=i=>{const g=i/b,y=L(o);for(const M of Me){const j=y[M];j.curveMax.constructParams.forEach(w=>{w.constructParams[1]*=g}),j.curveMin.constructParams.forEach(w=>{w.constructParams[1]*=g})}v(i),a[s]=y,t==null||t(s,y)},u={algo:"linear",yRangeMode:e.yRangeMode,yTickScale:b,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:f,onYTickScaleCommit:()=>{}};return F.useEffect(()=>{const i={};for(const g of Me)i[g]={max:Re(o[g].curveMax.constructParams).map(y=>({...y,y:y.y/b})),min:Re(o[g].curveMin.constructParams).map(y=>({...y,y:y.y/b}))};d(i)},[]),l.jsxs(l.Fragment,{children:[l.jsx(fa,{label:e.toggleLabel?r(e.toggleLabel):r("effects.curve.3d-prefix")+" "+r(e.label||s),info:r(e.info),value:o.enabled,onChange:i=>{const g=L(o);g.enabled=i,a[s]=g,t==null||t(s,g)}}),o.enabled?l.jsx(ae,{label:"",children:l.jsx(It,{direction:"column",gap:"xxs",children:Me.map((i,g)=>l.jsx(Le,{label:r(i).toLocaleUpperCase(),type:p,css:{gridTemplateColumns:"$4 repeat(3, minmax(0px, 1fr))"},...u,value:h(i),hideTypeSelector:g!==0,onValueChange:z(i)},i))})}):l.jsx(Le,{label:r(e.label||s),type:p,...u,value:h(c),onValueChange:z(c)})]})}),ye=a=>(e,t,r)=>{var o,n;const s=(n=(o=e.engineObject)==null?void 0:o.generator)==null?void 0:n[r.x.module];if(!s){console.warn(`Module container not found for: ${r.x.module}`);return}s[a]=r.enabled;const c={x:s[t+"X"],y:s[t+"Y"],z:s[t+"Z"]};for(const d in c){const b=r[d],v=c[d];if(!v){console.warn(`Axis module not found for: ${d} in ${t}`);continue}v.mode=b.mode,v.constantMax=b.constantMax,v.constantMin=b.constantMin,v.curveMax=new Te,b.curveMax.constructParams.forEach(p=>{const z=p.constructParams[0],h=p.constructParams[1];v.curveMax.addKey(new _e(z,h))}),v.curveMin=new Te,b.curveMin.constructParams.forEach(p=>{const z=p.constructParams[0],h=p.constructParams[1];v.curveMin.addKey(new _e(z,h))})}},N=Z(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=q(),s=e.property,c=a[s],[o,n]=F.useState(te),[d,b]=F.useState(te),[v,p]=F.useState(e.yTickScale??1);F.useEffect(()=>{const h=Re(c.curveMax.constructParams),f=Re(c.curveMin.constructParams);n(h),b(f)},[]);const z=(h,f)=>{const u=h.find(g=>g.type===f);if(!u)return;const i=L(c);switch(f){case"constant":i.mode=$.Constant,i.constantMax=u.value;break;case"two-constant":i.mode=$.TwoConstants,i.constantMin=u.value[0],i.constantMax=u.value[1];break;case"curve":{if(u.value.length>4)return;n(u.value),i.mode=$.Curve,u.value.forEach((g,y)=>{i.curveMax.constructParams[y].constructParams[0]=g.x,i.curveMax.constructParams[y].constructParams[1]=g.y});break}case"two-curve":{if(u.value[0].length>4||u.value[1].length>4)return;i.mode=$.TwoCurves,b(u.value[0]),n(u.value[1]),u.value[0].forEach((g,y)=>{i.curveMin.constructParams[y].constructParams[0]=g.x,i.curveMin.constructParams[y].constructParams[1]=g.y}),u.value[1].forEach((g,y)=>{i.curveMax.constructParams[y].constructParams[0]=g.x,i.curveMax.constructParams[y].constructParams[1]=g.y});break}}a[s]=i,t==null||t(s,i)};return l.jsx(l.Fragment,{children:l.jsx(Le,{label:r(e.label||e.property),info:r(e.info),type:pt[c.mode],algo:"linear",yRangeMode:e.yRangeMode,yTickScale:v,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:p,onYTickScaleCommit:()=>{},value:[{value:c.constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[c.constantMin,c.constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:o,type:"curve",label:r("effects.curve.curve")},{value:[d,o],type:"two-curve",label:r("effects.curve.two-curve")}],onValueChange:z})})}),G=(a,e,t)=>{var c,o;const r=(o=(c=a.engineObject)==null?void 0:c.generator)==null?void 0:o[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const s=r[e];if(!s){console.warn(`Module not found for property: ${e} in ${t.module}`);return}s.mode=t.mode,s.constantMax=t.constantMax,s.constantMin=t.constantMin,s.curveMax=new Te,t.curveMax.constructParams.forEach(n=>{const d=n.constructParams[0],b=n.constructParams[1];s.curveMax.addKey(new _e(d,b))}),s.curveMin=new Te,t.curveMin.constructParams.forEach(n=>{const d=n.constructParams[0],b=n.constructParams[1];s.curveMin.addKey(new _e(d,b))})},tr=["constant","two-constant"],ar=Z(({model:a,inspectorConfig:e,onModelChange:t})=>{var b,v;const{t:r}=q(),s=e.property,c=a[s],o={...ge(c.constantMax),intensity:((b=c.constantMax)==null?void 0:b.intensity)??1},n={...ge(c.constantMin),intensity:((v=c.constantMin)==null?void 0:v.intensity)??1},d=(p,z)=>{const h=p.find(u=>u.type===z);if(!h)return;const f=L(c);switch(z){case"constant":{f.mode=he.Constant,f.constantMax=h.value;break}case"two-constant":{const u=h.value[0],i=h.value[1];f.mode=he.TwoConstants,f.constantMin=u,f.constantMax=i;break}}a[s]=f,t==null||t(s,f)};return l.jsx(Yt,{label:r(e.label||e.property),type:tr[c.mode],info:r(e.info),hdr:!0,value:[{value:o,type:"constant",label:r("effects.curve.constant")},{value:[n,o],type:"two-constant",label:r("effects.curve.two-constant")}],onValueChange:d})}),rr=(a,e,t)=>{const r=a.engineObject.generator.main.startColor;r.mode=t.mode;const{constantMax:s,constantMin:c}=t,o=s.intensity??1,n=c.intensity??1;r.constantMax.set(s.r*o,s.g*o,s.b*o,s.a),r.constantMin.set(c.r*n,c.g*n,c.b*n,c.a)},sr=["gradient","two-gradient"],or=Z(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=q(),s=e.property,c=a[s],o=(n,d)=>{var p,z;if(!n.find(h=>h.type===d))return;const v=L(c);switch(d){case"gradient":{const h=n.find(f=>f.type===d);if(!((p=h==null?void 0:h.value)!=null&&p.color)||!((z=h==null?void 0:h.value)!=null&&z.alpha)){console.warn(`Invalid gradient value structure for ${s}`);return}if(h.value.color.length>4||h.value.alpha.length>4)return;v.mode=he.Gradient,v.gradientMax.constructParams=[h.value.color.map(f=>({color:f.value,time:f.time})),h.value.alpha.map(f=>({alpha:f.value,time:f.time}))];break}case"two-gradient":{const h=n.find(f=>f.type===d);if(h.value[0].color.length>4||h.value[0].alpha.length>4||h.value[1].color.length>4||h.value[1].alpha.length>4)return;v.mode=he.TwoGradients,v.gradientMin.constructParams=[h.value[0].color.map(f=>({color:f.value,time:f.time})),h.value[0].alpha.map(f=>({alpha:f.value,time:f.time}))],v.gradientMax.constructParams=[h.value[1].color.map(f=>({color:f.value,time:f.time})),h.value[1].alpha.map(f=>({alpha:f.value,time:f.time}))];break}}a[s]=v,t==null||t(s,v)};return l.jsx(l.Fragment,{children:l.jsx(Yt,{label:r(e.property),type:sr[c.mode-2],info:r(e.info),value:[{value:{color:c.gradientMax.constructParams[0].map(n=>({value:ge(n.color),time:n.time})),alpha:c.gradientMax.constructParams[1].map(n=>({value:n.alpha,time:n.time}))},type:"gradient",label:r("effects.curve.gradient")},{value:[{color:c.gradientMin.constructParams[0].map(n=>({value:ge(n.color),time:n.time})),alpha:c.gradientMin.constructParams[1].map(n=>({value:n.alpha,time:n.time}))},{color:c.gradientMax.constructParams[0].map(n=>({value:ge(n.color),time:n.time})),alpha:c.gradientMax.constructParams[1].map(n=>({value:n.alpha,time:n.time}))}],type:"two-gradient",label:r("effects.curve.two-gradient")}],onValueChange:o})})}),pe=[],ue=[],nr=(a,e,t)=>{var d,b,v;const r=(b=(d=a.engineObject)==null?void 0:d.generator)==null?void 0:b[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const s=r[e];if(!s){console.warn(`Module not found for property: ${e} in ${t.module}`);return}if(s.mode=t.mode,pe.length=0,ue.length=0,!((v=t.gradientMax)!=null&&v.constructParams)||!Array.isArray(t.gradientMax.constructParams)){console.warn(`Invalid gradientMax.constructParams for ${e}`);return}const c=t.gradientMax.constructParams,o=c[0]||[],n=c[1]||[];Array.isArray(o)&&o.forEach(p=>{if(p&&p.color&&typeof p.time=="number"){const z=p.color;pe.push(new Ot(p.time,new Et(z.r??0,z.g??0,z.b??0,z.a??1)))}}),Array.isArray(n)&&n.forEach(p=>{p&&typeof p.time=="number"&&typeof p.alpha=="number"&&ue.push(new wt(p.time,p.alpha))}),s.gradientMax.setKeys(pe,ue),pe.length=0,ue.length=0,t.gradientMin.constructParams[0].forEach(p=>{pe.push(new Ot(p.time,new Et(p.color.r,p.color.g,p.color.b,p.color.a)))}),t.gradientMin.constructParams[1].forEach(p=>{ue.push(new wt(p.time,p.alpha))}),s.gradientMin.setKeys(pe,ue)};function Oe(a){return a-Math.floor(a*(1/289))*289}function H(a){return Oe((34*a+1)*a)}function nt(a,e,t){const r=.16666666666666666,s=1/3,c=(a+e+t)*s,o=Math.floor(a+c),n=Math.floor(e+c),d=Math.floor(t+c),b=(o+n+d)*r,v=a-o+b,p=e-n+b,z=t-d+b;let h,f,u,i,g,y;v>=p?p>=z?(h=1,f=0,u=0,i=1,g=1,y=0):v>=z?(h=1,f=0,u=0,i=1,g=0,y=1):(h=0,f=0,u=1,i=1,g=0,y=1):p<z?(h=0,f=0,u=1,i=0,g=1,y=1):v<z?(h=0,f=1,u=0,i=0,g=1,y=1):(h=0,f=1,u=0,i=1,g=1,y=0);const M=v-h+r,j=p-f+r,w=z-u+r,B=v-i+s,_=p-g+s,E=z-y+s,I=v-.5,T=p-.5,A=z-.5,X=Oe(o),U=Oe(n),xe=Oe(d),Xt=H(H(H(xe)+U)+X),$t=H(H(H(xe+u)+U+f)+X+h),qt=H(H(H(xe+y)+U+g)+X+i),Kt=H(H(H(xe+1)+U+1)+X+1),Ae=.142857142857,mt=Ae*2-0,dt=Ae*.5-1,ke=Ae*1-0;function Se(bt){const vt=bt-49*Math.floor(bt*ke*ke),gt=Math.floor(vt*ke),Ut=Math.floor(vt-7*gt),xt=gt*mt+dt,St=Ut*mt+dt,Pe=1-Math.abs(xt)-Math.abs(St),Pt=xt,Mt=St,Jt=Math.floor(Pt)*2+1,Qt=Math.floor(Mt)*2+1,zt=-(Pe<0?1:0),et=Pt+Jt*zt,tt=Mt+Qt*zt,at=1.79284291400159-.85373472095314*(et*et+tt*tt+Pe*Pe);return[et*at,tt*at,Pe*at]}const re=Se(Xt),se=Se($t),oe=Se(qt),ne=Se(Kt),De=Math.max(.6-(v*v+p*p+z*z),0),Be=Math.max(.6-(M*M+j*j+w*w),0),Fe=Math.max(.6-(B*B+_*_+E*E),0),Ye=Math.max(.6-(I*I+T*T+A*A),0),Ze=De*De,Xe=Be*Be,$e=Fe*Fe,qe=Ye*Ye,Ke=Ze*Ze,Ne=Xe*Xe,Ge=$e*$e,He=qe*qe,Nt=re[0]*v+re[1]*p+re[2]*z,Gt=se[0]*M+se[1]*j+se[2]*w,Ht=oe[0]*B+oe[1]*_+oe[2]*E,Wt=ne[0]*I+ne[1]*T+ne[2]*A,We=Ze*De*Nt,Ue=Xe*Be*Gt,Je=$e*Fe*Ht,Qe=qe*Ye*Wt;let ht=-8*(We*v+Ue*M+Je*B+Qe*I),ft=-8*(We*p+Ue*j+Je*_+Qe*T),yt=-8*(We*z+Ue*w+Je*E+Qe*A);return ht+=Ke*re[0]+Ne*se[0]+Ge*oe[0]+He*ne[0],ft+=Ke*re[1]+Ne*se[1]+Ge*oe[1]+He*ne[1],yt+=Ke*re[2]+Ne*se[2]+Ge*oe[2]+He*ne[2],[ht*42,ft*42,yt*42]}function Lt(a,e,t){nt(t,e,a);const s=nt(a+100,t,e);return nt(e,a+100,t)[1]-s[2]}function ir(a,e,t,r,s,c,o){let n=Lt(a*r,e*r,t*r),d=1,b=r,v=1;for(let p=1;p<s;p++)v*=o,b*=c,d+=v,n+=v*Lt(a*b,e*b,t*b);return n/d}const Q=80,Rt=5,lr=({model:a})=>{const e=F.useRef(null),t=F.useRef(0);return F.useEffect(()=>{const r=e.current;if(!r)return;const s=r.getContext("2d");if(!s)return;const c=ya(()=>{var f,u;const o=((u=(f=a.noiseStrength)==null?void 0:f.x)==null?void 0:u.constantMax)??1,n=a.noiseFrequency??.5,d=a.noiseScrollSpeed??0,b=a.noiseOctaveCount??1,v=a.noiseOctaveIntensityMultiplier??.5,p=a.noiseOctaveFrequencyMultiplier??2;cancelAnimationFrame(t.current);const z=performance.now(),h=i=>{const g=(i-z)/1e3*d,y=s.createImageData(Q,Q),M=y.data;for(let j=0;j<Q;j++){const w=(1-j/Q)*Rt;for(let B=0;B<Q;B++){const _=B/Q*Rt,E=ir(_,w,g,n,b,p,v),I=Math.max(0,Math.min(255,Math.round((E*o*(.5/7)+.5)*255))),T=(j*Q+B)*4;M[T]=I,M[T+1]=I,M[T+2]=I,M[T+3]=255}}s.putImageData(y,0,0),d>0&&(t.current=requestAnimationFrame(h))};t.current=requestAnimationFrame(h)});return()=>{cancelAnimationFrame(t.current),c()}},[a]),l.jsx(ae,{label:" ",labelCss:{visibility:"hidden"},children:l.jsxs("div",{style:{position:"relative",width:80,height:80},children:[l.jsx("canvas",{ref:e,width:Q,height:Q,style:{width:80,height:80,borderRadius:4,border:"1px solid var(--color-border-default, rgba(255,255,255,0.12))",display:"block"}}),l.jsx("span",{style:{position:"absolute",bottom:2,left:0,right:0,textAlign:"center",fontSize:9,color:"rgba(255,255,255,0.6)",textShadow:"0 1px 2px rgba(0,0,0,0.8)",pointerEvents:"none"},children:"Preview"})]})})};var cr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,P=(a,e,t,r)=>{for(var s=r>1?void 0:r?pr(e,t):e,c=a.length-1,o;c>=0;c--)(o=a[c])&&(s=(r?o(e,t,s):o(s))||s);return r&&s&&cr(e,t,s),s};let x=class extends ba{constructor(e,t){super(e,t);S(this,"_emissionModuleEnabled",!0);S(this,"_emissionShapeModuleEnabled",!0);S(this,"_rotationOverLifetimeModuleEnabled",!1);S(this,"_sizeOverLifetimeModuleEnabled",!1);S(this,"_textureSheetAnimationModuleEnabled",!1);S(this,"_velocityOverLifetimeModuleEnabled",!1);S(this,"_forceOverLifetimeModuleEnabled",!1);S(this,"_limitVelocityOverLifetimeModuleEnabled",!1);S(this,"_colorOverLifetimeModuleEnabled",!1);S(this,"_noiseModuleEnabled",!1);S(this,"material",{refId:"0000202"});S(this,"priority",0);S(this,"velocityScale",0);S(this,"lengthScale",2);S(this,"pivot",{x:0,y:0,z:0});S(this,"renderMode",W.Billboard);S(this,"mesh",null);S(this,"duration",5);S(this,"isLoop",!0);S(this,"startDelay",D("main"));S(this,"startLifetime",D("main",5));S(this,"startSpeed",D("main",5));S(this,"startSize",ce("main",1));S(this,"startRotation",ce("main"));S(this,"flipRotation",0);S(this,"startColor",{module:"main",mode:he.Constant,constantMax:{r:1,g:1,b:1,a:1,intensity:1},constantMin:{r:1,g:1,b:1,a:1,intensity:1}});S(this,"gravityModifier",D("main"));S(this,"simulationSpace",K.Local);S(this,"simulationSpeed",1);S(this,"scalingMode",be.Local);S(this,"playOnEnabled",!0);S(this,"maxParticles",1e3);S(this,"rateOverTime",D("emission",10));S(this,"shape",{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!0}});S(this,"bursts",[]);S(this,"size",ce("sizeOverLifetime",1));S(this,"rotation",ce("rotationOverLifetime",45));S(this,"textureSheetAnimationType",0);S(this,"cycleCount",1);S(this,"tiling",{x:1,y:1});S(this,"frameOverTime",D("textureSheetAnimation",1,0,$.Curve));S(this,"spaceMode",K.Local);S(this,"forceSpaceMode",K.Local);S(this,"velocityX",D("velocityOverLifetime"));S(this,"velocityY",D("velocityOverLifetime"));S(this,"velocityZ",D("velocityOverLifetime"));S(this,"speed",ce("limitVelocityOverLifetime",1));S(this,"limitVelocitySpaceMode",K.Local);S(this,"dampen",0);S(this,"drag",D("limitVelocityOverLifetime"));S(this,"multiplyDragByParticleSize",!1);S(this,"multiplyDragByParticleVelocity",!1);S(this,"forceX",D("forceOverLifetime"));S(this,"forceY",D("forceOverLifetime"));S(this,"forceZ",D("forceOverLifetime"));S(this,"color",_t());S(this,"noisePreview",null);S(this,"noiseStrength",ce("noise",1));S(this,"noiseFrequency",.5);S(this,"noiseScrollSpeed",0);S(this,"noiseOctaveCount",1);S(this,"noiseOctaveIntensityMultiplier",.5);S(this,"noiseOctaveFrequencyMultiplier",2);const r=this.formSchema,s=(o,n,d,b,v,p)=>{const z=m(o);r.addGroup(z,n,{controlOpenKey:d,defaultOpen:p,sectionTitle:{title:z,onToggle:h=>{v==null||v(h),this.root.inspectorFacade.componentChange(this.id,d,h),this.applyBoundPathChange(b,R.Toggle,h)}}})};s("effects.renderer.sections.emission",["rateOverTime","bursts"],"_emissionModuleEnabled","generator.emission.enabled"),s("effects.renderer.sections.shape",["shape"],"_emissionShapeModuleEnabled","generator.emission.shape.enabled",o=>{this.shape.props.enabled=o}),s("effects.renderer.sections.size-over-lifetime",["size"],"_sizeOverLifetimeModuleEnabled","generator.sizeOverLifetime.enabled"),s("effects.renderer.sections.rotation-over-lifetime",["rotation"],"_rotationOverLifetimeModuleEnabled","generator.rotationOverLifetime.enabled"),s("effects.renderer.sections.force-over-lifetime",["forceSpaceMode","forceX","forceY","forceZ"],"_forceOverLifetimeModuleEnabled","generator.forceOverLifetime.enabled"),s("effects.renderer.sections.velocity-over-lifetime",["spaceMode","velocityX","velocityY","velocityZ"],"_velocityOverLifetimeModuleEnabled","generator.velocityOverLifetime.enabled"),s("effects.renderer.sections.limit-velocity-over-lifetime",["speed","limitVelocitySpaceMode","dampen","drag","multiplyDragByParticleSize","multiplyDragByParticleVelocity"],"_limitVelocityOverLifetimeModuleEnabled","generator.limitVelocityOverLifetime.enabled"),s("effects.renderer.sections.texture-sheet-animation",["textureSheetAnimationType","cycleCount","tiling","frameOverTime"],"_textureSheetAnimationModuleEnabled","generator.textureSheetAnimation.enabled"),s("effects.renderer.sections.color-over-lifetime",["color"],"_colorOverLifetimeModuleEnabled","generator.colorOverLifetime.enabled"),s("effects.renderer.sections.noise",["noisePreview","noiseStrength","noiseFrequency","noiseScrollSpeed","noiseOctaveCount","noiseOctaveIntensityMultiplier","noiseOctaveFrequencyMultiplier"],"_noiseModuleEnabled","generator.noise.enabled");const c=m("effects.renderer.sections.rendering");r.addGroup(c,["renderMode","mesh","material","velocityScale","lengthScale","pivot","priority"],{sectionTitle:{title:c}})}applyEmissionShape(e){this.applyBoundPathChange("generator.emission.shape",R.Input,e)}onInitComplete(){this._applyEditorRuntimeState()}_applyRendererMeshFromRef(){this.applyBoundPathChange("mesh",R.AssetPicker,this.mesh??null)}_applyEditorRuntimeState(){const{_engineObject:{generator:e}}=this;if(this.applyBoundPathChange("enabled",R.Toggle,this._enabled),this.applyBoundPathChange("renderMode",R.Select,this.renderMode),e.emission.enabled=this._emissionModuleEnabled,e.emission.shape.enabled=this._emissionShapeModuleEnabled,this.shape.class===k.MeshShape){const t=e.emission.shape,r=this.shape.props.mesh;r?(t.enabled=!1,La(this.root,r).then(()=>{this.applyBoundPathChange("generator.emission.shape.mesh",R.AssetPicker,r),t.enabled=this._emissionShapeModuleEnabled})):this.applyBoundPathChange("generator.emission.shape.mesh",R.Input,Vt.createSphere(this.engineObject.engine))}e.rotationOverLifetime.enabled=this._rotationOverLifetimeModuleEnabled,e.sizeOverLifetime.enabled=this._sizeOverLifetimeModuleEnabled,e.textureSheetAnimation.enabled=this._textureSheetAnimationModuleEnabled,e.velocityOverLifetime.enabled=this._velocityOverLifetimeModuleEnabled,e.limitVelocityOverLifetime.enabled=this._limitVelocityOverLifetimeModuleEnabled,e.forceOverLifetime.enabled=this._forceOverLifetimeModuleEnabled,e.main.simulationSpeed=0,e.colorOverLifetime.enabled=this._colorOverLifetimeModuleEnabled,e.noise.enabled=this._noiseModuleEnabled,this.renderMode===W.Mesh&&this._applyRendererMeshFromRef()}async bindEngineObject(e){e.enabled=!1,await super.bindEngineObject(e)}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1,this._applyEditorRuntimeState()}deserialize(e){var r,s,c;const t=e.props;if(this._enabled=(t==null?void 0:t.enabled)??!0,t!=null&&t.generator){this.priority=t.priority??this.priority,this.velocityScale=t.velocityScale??this.velocityScale,this.lengthScale=t.lengthScale??this.lengthScale,this.pivot=t.pivot??this.pivot,this.renderMode=t.renderMode??this.renderMode,this.mesh=t.mesh??null;const{main:o,emission:n,sizeOverLifetime:d,rotationOverLifetime:b,velocityOverLifetime:v,limitVelocityOverLifetime:p,colorOverLifetime:z,textureSheetAnimation:h,forceOverLifetime:f,noise:u}=t.generator;this.duration=(o==null?void 0:o.duration)??this.duration,this.isLoop=(o==null?void 0:o.isLoop)??this.isLoop,this.startDelay=(o==null?void 0:o.startDelay)??this.startDelay,this.startLifetime=(o==null?void 0:o.startLifetime)??this.startLifetime,this.startSpeed=(o==null?void 0:o.startSpeed)??this.startSpeed,this.startSize.enabled=(o==null?void 0:o.startSize3D)??this.startSize.enabled,this.startSize.x=(o==null?void 0:o.startSizeX)??this.startSize.x,this.startSize.y=(o==null?void 0:o.startSizeY)??this.startSize.y,this.startSize.z=(o==null?void 0:o.startSizeZ)??this.startSize.z,this.startRotation.enabled=(o==null?void 0:o.startRotation3D)??this.startRotation.enabled,this.startRotation.x=(o==null?void 0:o.startRotationX)??this.startRotation.x,this.startRotation.y=(o==null?void 0:o.startRotationY)??this.startRotation.y,this.startRotation.z=(o==null?void 0:o.startRotationZ)??this.startRotation.z,this.flipRotation=(o==null?void 0:o.flipRotation)??this.flipRotation,this.startColor=(o==null?void 0:o.startColor)??this.startColor,this.gravityModifier=(o==null?void 0:o.gravityModifier)??this.gravityModifier,this.simulationSpace=(o==null?void 0:o.simulationSpace)??this.simulationSpace,this.simulationSpeed=(o==null?void 0:o.simulationSpeed)??this.simulationSpeed,this.scalingMode=(o==null?void 0:o.scalingMode)??this.scalingMode,this.playOnEnabled=(o==null?void 0:o.playOnEnabled)??this.playOnEnabled,this.maxParticles=(o==null?void 0:o.maxParticles)??this.maxParticles,this._emissionModuleEnabled=(n==null?void 0:n.enabled)??this._emissionModuleEnabled,this.rateOverTime=(n==null?void 0:n.rateOverTime)??this.rateOverTime,(n==null?void 0:n.shape)===null||((r=n==null?void 0:n.shape)==null?void 0:r.class)==="Null"?(this.shape={class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!1}},this._emissionShapeModuleEnabled=!1):(this.shape=(n==null?void 0:n.shape)??this.shape,this._emissionShapeModuleEnabled=((c=(s=n==null?void 0:n.shape)==null?void 0:s.props)==null?void 0:c.enabled)??this._emissionShapeModuleEnabled),this.bursts=Array.isArray(n==null?void 0:n.bursts)?n.bursts.map(y=>(Na(y),y)):[],this._sizeOverLifetimeModuleEnabled=(d==null?void 0:d.enabled)??this._sizeOverLifetimeModuleEnabled,this.size.enabled=(d==null?void 0:d.separateAxes)??this.size.enabled,this.size.x=d!=null&&d.sizeX?{...d.sizeX,module:"sizeOverLifetime"}:{...L(this.size.x),module:"sizeOverLifetime"},this.size.y=d!=null&&d.sizeY?{...d.sizeY,module:"sizeOverLifetime"}:{...L(this.size.y),module:"sizeOverLifetime"},this.size.z=d!=null&&d.sizeZ?{...d.sizeZ,module:"sizeOverLifetime"}:{...L(this.size.z),module:"sizeOverLifetime"},this._rotationOverLifetimeModuleEnabled=(b==null?void 0:b.enabled)??this._rotationOverLifetimeModuleEnabled,this.rotation.enabled=(b==null?void 0:b.separateAxes)??this.rotation.enabled,this.rotation.x=b!=null&&b.rotationX?{...b.rotationX,module:"rotationOverLifetime"}:{...L(this.rotation.x),module:"rotationOverLifetime"},this.rotation.y=b!=null&&b.rotationY?{...b.rotationY,module:"rotationOverLifetime"}:{...L(this.rotation.y),module:"rotationOverLifetime"},this.rotation.z=b!=null&&b.rotationZ?{...b.rotationZ,module:"rotationOverLifetime"}:{...L(this.rotation.z),module:"rotationOverLifetime"},this._velocityOverLifetimeModuleEnabled=(v==null?void 0:v.enabled)??this._velocityOverLifetimeModuleEnabled,this.velocityX=(v==null?void 0:v.velocityX)??L(this.velocityX),this.velocityY=(v==null?void 0:v.velocityY)??L(this.velocityY),this.velocityZ=(v==null?void 0:v.velocityZ)??L(this.velocityZ),this.spaceMode=(v==null?void 0:v.space)??this.spaceMode,this._limitVelocityOverLifetimeModuleEnabled=(p==null?void 0:p.enabled)??this._limitVelocityOverLifetimeModuleEnabled,this.speed.enabled=(p==null?void 0:p.separateAxes)??this.speed.enabled;const i=(p==null?void 0:p.speedX)??(p==null?void 0:p.speed);this.speed.x=i?{...i,module:"limitVelocityOverLifetime"}:{...L(this.speed.x),module:"limitVelocityOverLifetime"},this.speed.y=p!=null&&p.speedY?{...p.speedY,module:"limitVelocityOverLifetime"}:{...L(this.speed.y),module:"limitVelocityOverLifetime"},this.speed.z=p!=null&&p.speedZ?{...p.speedZ,module:"limitVelocityOverLifetime"}:{...L(this.speed.z),module:"limitVelocityOverLifetime"},this.dampen=(p==null?void 0:p.dampen)??this.dampen,this.drag=p!=null&&p.drag?{...p.drag,module:"limitVelocityOverLifetime"}:D("limitVelocityOverLifetime"),this.multiplyDragByParticleSize=(p==null?void 0:p.multiplyDragByParticleSize)??this.multiplyDragByParticleSize,this.multiplyDragByParticleVelocity=(p==null?void 0:p.multiplyDragByParticleVelocity)??this.multiplyDragByParticleVelocity,this.limitVelocitySpaceMode=(p==null?void 0:p.space)??this.limitVelocitySpaceMode,this._forceOverLifetimeModuleEnabled=(f==null?void 0:f.enabled)??this._forceOverLifetimeModuleEnabled,this.forceX=(f==null?void 0:f.forceX)??D("forceOverLifetime"),this.forceY=(f==null?void 0:f.forceY)??D("forceOverLifetime"),this.forceZ=(f==null?void 0:f.forceZ)??D("forceOverLifetime"),this.forceSpaceMode=(f==null?void 0:f.space)??this.forceSpaceMode,z?(this._colorOverLifetimeModuleEnabled=z.enabled??this._colorOverLifetimeModuleEnabled,this.color=z.color??this.color):(this._colorOverLifetimeModuleEnabled=!0,this.color=_t()),this._textureSheetAnimationModuleEnabled=(h==null?void 0:h.enabled)??this._textureSheetAnimationModuleEnabled,this.textureSheetAnimationType=(h==null?void 0:h.type)??this.textureSheetAnimationType,this.cycleCount=(h==null?void 0:h.cycleCount)??this.cycleCount,this.tiling=(h==null?void 0:h.tiling)??this.tiling,this.frameOverTime=(h==null?void 0:h.frameOverTime)??this.frameOverTime,this._noiseModuleEnabled=(u==null?void 0:u.enabled)??this._noiseModuleEnabled,this.noiseStrength.enabled=(u==null?void 0:u.separateAxes)??this.noiseStrength.enabled;const g=u==null?void 0:u.strengthX;this.noiseStrength.x=g?{...g,module:"noise"}:{...L(this.noiseStrength.x),module:"noise"},this.noiseStrength.y=u!=null&&u.strengthY?{...u.strengthY,module:"noise"}:{...L(this.noiseStrength.y),module:"noise"},this.noiseStrength.z=u!=null&&u.strengthZ?{...u.strengthZ,module:"noise"}:{...L(this.noiseStrength.z),module:"noise"},this.noiseFrequency=(u==null?void 0:u.frequency)??this.noiseFrequency,this.noiseScrollSpeed=(u==null?void 0:u.scrollSpeed)??this.noiseScrollSpeed,this.noiseOctaveCount=(u==null?void 0:u.octaveCount)??this.noiseOctaveCount,this.noiseOctaveIntensityMultiplier=(u==null?void 0:u.octaveIntensityMultiplier)??this.noiseOctaveIntensityMultiplier,this.noiseOctaveFrequencyMultiplier=(u==null?void 0:u.octaveFrequencyMultiplier)??this.noiseOctaveFrequencyMultiplier}super.deserialize(e)}toJSON(){const e=this.bursts.map(r=>{var c;if(((c=r==null?void 0:r.constructParams)==null?void 0:c[2])!==1/0)return r;const s=L(r);return s.constructParams[2]=null,s});return{type:this.type,props:va({enabled:this.enabled,priority:this.priority,velocityScale:this.velocityScale,lengthScale:this.lengthScale,pivot:this.pivot,renderMode:this.renderMode,mesh:this.mesh,material:this.material,generator:{main:{duration:this.duration,isLoop:this.isLoop,startDelay:this.startDelay,startLifetime:this.startLifetime,startSpeed:this.startSpeed,startSize3D:this.startSize.enabled,startSizeX:this.startSize.x,startSizeY:this.startSize.y,startSizeZ:this.startSize.z,startRotation3D:this.startRotation.enabled,startRotationX:this.startRotation.x,startRotationY:this.startRotation.y,startRotationZ:this.startRotation.z,flipRotation:this.flipRotation,startColor:this.startColor,gravityModifier:this.gravityModifier,simulationSpace:this.simulationSpace,simulationSpeed:this.simulationSpeed,scalingMode:this.scalingMode,playOnEnabled:this.playOnEnabled,maxParticles:this.maxParticles},emission:{enabled:this._emissionModuleEnabled,rateOverTime:this.rateOverTime,shape:this.shape,bursts:e},sizeOverLifetime:{enabled:this._sizeOverLifetimeModuleEnabled,separateAxes:this.size.enabled,sizeX:this.size.x,sizeY:this.size.y,sizeZ:this.size.z},rotationOverLifetime:{enabled:this._rotationOverLifetimeModuleEnabled,separateAxes:this.rotation.enabled,rotationX:this.rotation.x,rotationY:this.rotation.y,rotationZ:this.rotation.z},velocityOverLifetime:{enabled:this._velocityOverLifetimeModuleEnabled,space:this.spaceMode,velocityX:this.velocityX,velocityY:this.velocityY,velocityZ:this.velocityZ},limitVelocityOverLifetime:{enabled:this._limitVelocityOverLifetimeModuleEnabled,separateAxes:this.speed.enabled,speedX:this.speed.x,speedY:this.speed.y,speedZ:this.speed.z,dampen:this.dampen,drag:this.drag,multiplyDragByParticleSize:this.multiplyDragByParticleSize,multiplyDragByParticleVelocity:this.multiplyDragByParticleVelocity,space:this.limitVelocitySpaceMode},forceOverLifetime:{enabled:this._forceOverLifetimeModuleEnabled,space:this.forceSpaceMode,forceX:this.forceX,forceY:this.forceY,forceZ:this.forceZ},colorOverLifetime:{enabled:this._colorOverLifetimeModuleEnabled,color:this.color},textureSheetAnimation:{enabled:this._textureSheetAnimationModuleEnabled,type:this.textureSheetAnimationType,cycleCount:this.cycleCount,tiling:this.tiling,frameOverTime:this.frameOverTime},noise:{enabled:this._noiseModuleEnabled,separateAxes:this.noiseStrength.enabled,strengthX:this.noiseStrength.x,strengthY:this.noiseStrength.y,strengthZ:this.noiseStrength.z,frequency:this.noiseFrequency,scrollSpeed:this.noiseScrollSpeed,octaveCount:this.noiseOctaveCount,octaveIntensityMultiplier:this.noiseOctaveIntensityMultiplier,octaveFrequencyMultiplier:this.noiseOctaveFrequencyMultiplier}}})}}};P([J],x.prototype,"_emissionModuleEnabled",2);P([J],x.prototype,"_emissionShapeModuleEnabled",2);P([J],x.prototype,"_rotationOverLifetimeModuleEnabled",2);P([J],x.prototype,"_sizeOverLifetimeModuleEnabled",2);P([J],x.prototype,"_textureSheetAnimationModuleEnabled",2);P([J],x.prototype,"_velocityOverLifetimeModuleEnabled",2);P([J],x.prototype,"_forceOverLifetimeModuleEnabled",2);P([J],x.prototype,"_limitVelocityOverLifetimeModuleEnabled",2);P([J],x.prototype,"_colorOverLifetimeModuleEnabled",2);P([J],x.prototype,"_noiseModuleEnabled",2);P([V({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:ga.ReferResource,getEngineValue:a=>a.getMaterial()}),C({type:R.AssetPicker,assetType:"Material",customFilter:a=>{var e;return((e=a.engineObject.shader)==null?void 0:e.name)==="Effect/Particle"},priority:-100,label:m("effects.renderer.material.label"),info:m("effects.renderer.material.info")}),O()],x.prototype,"material",2);P([C({bindPath:"priority",min:0,step:1,dragStep:1,priority:-100,label:m("effects.renderer.priority.label"),info:m("effects.renderer.priority.info")}),O()],x.prototype,"priority",2);P([C({bindPath:"velocityScale",priority:-100,label:m("effects.renderer.velocity-scale.label"),info:m("effects.renderer.velocity-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],x.prototype,"velocityScale",2);P([C({bindPath:"lengthScale",priority:-100,label:m("effects.renderer.length-scale.label"),info:m("effects.renderer.length-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],x.prototype,"lengthScale",2);P([C({type:R.Vector3,bindPath:"pivot",label:m("effects.renderer.pivot.label"),priority:-100}),O()],x.prototype,"pivot",2);P([V({getPath:"renderMode",setPath:"renderMode"}),C({type:R.Select,value:W.Billboard,label:m("effects.renderer.render-mode.label"),options:[{label:m("effects.renderer.render-mode.options.billboard"),value:W.Billboard},{label:m("effects.renderer.render-mode.options.stretch-billboard"),value:W.StretchBillboard},{label:m("effects.renderer.render-mode.options.horizontal-billboard"),value:W.HorizontalBillboard},{label:m("effects.renderer.render-mode.options.mesh"),value:W.Mesh},{label:m("effects.renderer.render-mode.options.none"),value:W.None}],onChange(a){a.renderMode===W.Mesh&&a._applyRendererMeshFromRef()},priority:-100}),O()],x.prototype,"renderMode",2);P([C({type:R.AssetPicker,assetType:"Mesh",label:m("effects.renderer.mesh.label"),info:m("effects.renderer.mesh.info"),when:a=>a.renderMode===W.Mesh,onChange:async(a,e,t)=>{a.mesh=t?t.getCurrentRef():null;try{await a.applyBoundPathChange("mesh",R.AssetPicker,a.mesh)}catch(r){console.warn(r)}},priority:-100}),O()],x.prototype,"mesh",2);P([V({getPath:"generator.main.duration",setPath:"generator.main.duration"}),C({bindPath:"generator.main.duration",min:.05,step:.05,dragStep:.05,label:m("effects.renderer.duration.label"),info:m("effects.renderer.duration.info")}),O()],x.prototype,"duration",2);P([V({getPath:"generator.main.isLoop",setPath:"generator.main.isLoop"}),C({bindPath:"generator.main.isLoop",label:m("effects.renderer.loop.label"),info:m("effects.renderer.loop.info")}),O()],x.prototype,"isLoop",2);P([C({customComponent:N,min:0,yRangeMode:"positive",onChange:G,info:m("effects.renderer.start.delay.info"),label:m("effects.renderer.start.delay.label")}),O()],x.prototype,"startDelay",2);P([C({customComponent:N,onChange:G,min:1e-4,yRangeMode:"positive",label:m("effects.renderer.start.lifetime.label"),info:m("effects.renderer.start.lifetime.info")}),O()],x.prototype,"startLifetime",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.start.speed.label")}),O()],x.prototype,"startSpeed",2);P([C({module:"main",toggleProps:"startSize3D",axisX:"startSizeX",axisY:"startSizeY",axisZ:"startSizeZ",mainAxis:"x",customComponent:fe,onChange:ye("startSize3D"),label:m("effects.renderer.start.size.label"),info:m("effects.renderer.start.size.info"),min:0,yRangeMode:"positive"}),O()],x.prototype,"startSize",2);P([C({module:"main",toggleProps:"startRotation3D",axisX:"startRotationX",axisY:"startRotationY",axisZ:"startRotationZ",mainAxis:"z",customComponent:fe,onChange:ye("startRotation3D"),label:m("effects.renderer.start.rotation.label"),info:m("effects.renderer.start.rotation.info"),step:1}),O()],x.prototype,"startRotation",2);P([V({getPath:"generator.main.flipRotation",setPath:"generator.main.flipRotation"}),C({bindPath:"generator.main.flipRotation",min:0,max:1,step:.05,dragStep:.05,label:m("effects.renderer.flip-rotation.label")}),O()],x.prototype,"flipRotation",2);P([C({customComponent:ar,onChange:rr,label:m("effects.renderer.start.color.label")}),O()],x.prototype,"startColor",2);P([C({customComponent:N,info:m("effects.renderer.gravity-modifier.info"),onChange:G,label:m("effects.renderer.gravity-modifier.label")}),O()],x.prototype,"gravityModifier",2);P([V({getPath:"generator.main.simulationSpace",setPath:"generator.main.simulationSpace"}),C({type:R.Select,bindPath:"generator.main.simulationSpace",value:K.Local,label:m("effects.renderer.simulation.space.label"),info:m("effects.renderer.simulation.space.info"),options:[{label:m("effects.renderer.simulation.space.options.local"),value:K.Local},{label:m("effects.renderer.simulation.space.options.world"),value:K.World}]}),O()],x.prototype,"simulationSpace",2);P([V({getPath:"generator.main.simulationSpeed",setPath:"generator.main.simulationSpeed"}),C({bindPath:"generator.main.simulationSpeed",step:.05,dragStep:.05,label:m("effects.renderer.simulation.speed.label"),info:m("effects.renderer.simulation.speed.info")}),O()],x.prototype,"simulationSpeed",2);P([V({getPath:"generator.main.scalingMode",setPath:"generator.main.scalingMode"}),C({type:R.Select,bindPath:"generator.main.scalingMode",label:m("effects.renderer.scaling-mode.label"),info:m("effects.renderer.scaling-mode.info"),value:be.Local,options:[{label:m("effects.renderer.scaling-mode.options.world"),value:be.World},{label:m("effects.renderer.scaling-mode.options.local"),value:be.Local},{label:m("effects.renderer.scaling-mode.options.shape"),value:be.Shape}]}),O()],x.prototype,"scalingMode",2);P([V({getPath:"generator.main.playOnEnabled",setPath:"generator.main.playOnEnabled"}),C({type:R.Toggle,bindPath:"generator.main.playOnEnabled",label:m("effects.renderer.play-on-enabled.label"),info:m("effects.renderer.play-on-enabled.info")}),O()],x.prototype,"playOnEnabled",2);P([V({getPath:"generator.main.maxParticles",setPath:"generator.main.maxParticles"}),C({type:R.Number,bindPath:"generator.main.maxParticles",min:1,dragStep:1,label:m("effects.renderer.max-particles.label"),info:m("effects.renderer.max-particles.info")}),O()],x.prototype,"maxParticles",2);P([C({customComponent:N,onChange:G,min:0,yRangeMode:"positive",label:m("effects.renderer.rate-over-time.label"),info:m("effects.renderer.rate-over-time.info")}),O()],x.prototype,"rateOverTime",2);P([C({customComponent:qa,onChange:Za}),O()],x.prototype,"shape",2);P([O(),C({label:m("effects.renderer.bursts.label"),info:m("effects.renderer.bursts.info"),customComponent:Ja,onChange:Qa})],x.prototype,"bursts",2);P([C({module:"sizeOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"sizeX",axisY:"sizeY",axisZ:"sizeZ",mainAxis:"x",customComponent:fe,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:m("effects.renderer.over-lifetime.size.label")}),O()],x.prototype,"size",2);P([C({module:"rotationOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"rotationX",axisY:"rotationY",axisZ:"rotationZ",mainAxis:"z",customComponent:fe,onChange:ye("separateAxes"),step:1,yTickScale:45,label:m("effects.renderer.over-lifetime.rotation.label")}),O()],x.prototype,"rotation",2);P([V({getPath:"generator.textureSheetAnimation.type",setPath:"generator.textureSheetAnimation.type"}),C({type:R.Select,value:0,label:m("effects.renderer.texture-sheet.type.label"),info:m("effects.renderer.texture-sheet.type.info"),options:[{label:m("effects.renderer.texture-sheet.type.options.whole-sheet"),value:0},{label:m("effects.renderer.texture-sheet.type.options.single-row"),value:1}]}),O()],x.prototype,"textureSheetAnimationType",2);P([V({getPath:"generator.textureSheetAnimation.cycleCount",setPath:"generator.textureSheetAnimation.cycleCount"}),C({bindPath:"generator.textureSheetAnimation.cycleCount",min:1e-4,step:1,dragStep:1,label:m("effects.renderer.texture-sheet.cycle-count.label"),info:m("effects.renderer.texture-sheet.cycle-count.info")}),O()],x.prototype,"cycleCount",2);P([C({type:R.Vector2,min:1,label:m("effects.renderer.texture-sheet.tiling.label"),info:m("effects.renderer.texture-sheet.tiling.info"),onChange(a,e,t){a.applyBoundPathChange("generator.textureSheetAnimation.tiling",R.Vector2,t)}}),O()],x.prototype,"tiling",2);P([C({customComponent:N,onChange:G,min:0,max:1,yRangeMode:"positive",label:m("effects.renderer.over-lifetime.frame.label")}),O()],x.prototype,"frameOverTime",2);P([V({getPath:"generator.velocityOverLifetime.space",setPath:"generator.velocityOverLifetime.space"}),C({type:R.Select,bindPath:"generator.velocityOverLifetime.space",value:0,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.space-mode.info"),options:[{label:m("effects.renderer.space-mode.options.local"),value:K.Local},{label:m("effects.renderer.space-mode.options.world"),value:K.World}]}),O()],x.prototype,"spaceMode",2);P([V({getPath:"generator.forceOverLifetime.space",setPath:"generator.forceOverLifetime.space"}),C({type:R.Select,bindPath:"generator.forceOverLifetime.space",value:0,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.space-mode.info-force"),options:[{label:"Local",value:K.Local},{label:"World",value:K.World}]}),O()],x.prototype,"forceSpaceMode",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.x.label"),info:m("effects.renderer.velocity.x.info")}),O()],x.prototype,"velocityX",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.y.label")}),O()],x.prototype,"velocityY",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.z.label")}),O()],x.prototype,"velocityZ",2);P([C({module:"limitVelocityOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"speedX",axisY:"speedY",axisZ:"speedZ",mainAxis:"x",customComponent:fe,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:m("effects.renderer.limit-velocity.limit.label")}),O()],x.prototype,"speed",2);P([V({getPath:"generator.limitVelocityOverLifetime.space",setPath:"generator.limitVelocityOverLifetime.space"}),C({type:R.Select,bindPath:"generator.limitVelocityOverLifetime.space",value:0,when:a=>a.speed.enabled,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.limit-velocity.space.info"),options:[{label:m("effects.renderer.space-mode.options.local"),value:K.Local},{label:m("effects.renderer.space-mode.options.world"),value:K.World}]}),O()],x.prototype,"limitVelocitySpaceMode",2);P([V({getPath:"generator.limitVelocityOverLifetime.dampen",setPath:"generator.limitVelocityOverLifetime.dampen"}),C({bindPath:"generator.limitVelocityOverLifetime.dampen",min:0,max:1,step:.01,dragStep:.01,label:m("effects.renderer.limit-velocity.dampen.label"),info:m("effects.renderer.limit-velocity.dampen.info")}),O()],x.prototype,"dampen",2);P([C({customComponent:N,onChange:G,min:0,yRangeMode:"positive",label:m("effects.renderer.limit-velocity.drag.label"),info:m("effects.renderer.limit-velocity.drag.info")}),O()],x.prototype,"drag",2);P([V({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize"}),C({type:R.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",label:m("effects.renderer.limit-velocity.multiply-drag-by-size.label"),info:m("effects.renderer.limit-velocity.multiply-drag-by-size.info")}),O()],x.prototype,"multiplyDragByParticleSize",2);P([V({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity"}),C({type:R.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",label:m("effects.renderer.limit-velocity.multiply-drag-by-velocity.label"),info:m("effects.renderer.limit-velocity.multiply-drag-by-velocity.info")}),O()],x.prototype,"multiplyDragByParticleVelocity",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceX",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceY",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceZ",2);P([C({customComponent:or,onChange:nr,label:m("effects.renderer.color-over-lifetime.label")}),O()],x.prototype,"color",2);P([C({customComponent:lr,label:m("effects.renderer.noise.preview.label")})],x.prototype,"noisePreview",2);P([C({module:"noise",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"strengthX",axisY:"strengthY",axisZ:"strengthZ",mainAxis:"x",customComponent:fe,onChange:(a,e,t)=>{ye("separateAxes")(a,"strength",t)},label:m("effects.renderer.noise.strength.label")}),O()],x.prototype,"noiseStrength",2);P([V({getPath:"generator.noise.frequency",setPath:"generator.noise.frequency"}),C({bindPath:"generator.noise.frequency",min:1e-6,step:.1,dragStep:.1,label:m("effects.renderer.noise.frequency.label")}),O()],x.prototype,"noiseFrequency",2);P([V({getPath:"generator.noise.scrollSpeed",setPath:"generator.noise.scrollSpeed"}),C({bindPath:"generator.noise.scrollSpeed",min:0,step:.01,dragStep:.01,label:m("effects.renderer.noise.scroll-speed.label")}),O()],x.prototype,"noiseScrollSpeed",2);P([V({getPath:"generator.noise.octaveCount",setPath:"generator.noise.octaveCount"}),C({bindPath:"generator.noise.octaveCount",min:1,max:3,step:1,dragStep:1,label:m("effects.renderer.noise.octave-count.label")}),O()],x.prototype,"noiseOctaveCount",2);P([V({getPath:"generator.noise.octaveIntensityMultiplier",setPath:"generator.noise.octaveIntensityMultiplier"}),C({bindPath:"generator.noise.octaveIntensityMultiplier",min:0,max:1,step:.01,dragStep:.01,when:a=>a.noiseOctaveCount>1,label:m("effects.renderer.noise.octave-intensity-multiplier.label")}),O()],x.prototype,"noiseOctaveIntensityMultiplier",2);P([V({getPath:"generator.noise.octaveFrequencyMultiplier",setPath:"generator.noise.octaveFrequencyMultiplier"}),C({bindPath:"generator.noise.octaveFrequencyMultiplier",min:1,max:4,step:.1,dragStep:.1,when:a=>a.noiseOctaveCount>1,label:m("effects.renderer.noise.octave-frequency-multiplier.label")}),O()],x.prototype,"noiseOctaveFrequencyMultiplier",2);x=P([xa({type:"ParticleRenderer",customInspector:_a,componentsMenu:{group:"effects",label:m("component.particle-renderer.title")}})],x);export{x as ParticleRendererComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var y=Object.defineProperty;var M=(t,i,e)=>i in t?y(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>(M(t,typeof i!="symbol"?i+"":i,e),e);import{j as h,P as a,k as d,p as l,C as b,m,n as v,e as C,o as F,q as P}from"./index-
|
|
1
|
+
var y=Object.defineProperty;var M=(t,i,e)=>i in t?y(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>(M(t,typeof i!="symbol"?i+"":i,e),e);import{j as h,P as a,k as d,p as l,C as b,m,n as v,e as C,o as F,q as P}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import"./postmen-2853c0e6.js";var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,c=(t,i,e,n)=>{for(var o=n>1?void 0:n?g(i,e):i,p=t.length-1,u;p>=0;p--)(u=t[p])&&(o=(n?u(i,e,o):u(o))||o);return n&&o&&f(i,e,o),o};let s=class extends h{constructor(i){super(i);r(this,"dynamicFriction",.6);r(this,"staticFriction",.6);r(this,"bounciness",0);r(this,"frictionCombine",a.Average);r(this,"bounceCombine",a.Average)}async initByMain(i){const e=JSON.parse(await i.text()),n=new d;n.dynamicFriction=this.dynamicFriction=e.dynamicFriction,n.staticFriction=this.staticFriction=e.staticFriction,n.bounciness=this.bounciness=e.bounciness,n.frictionCombine=this.frictionCombine=e.frictionCombine,n.bounceCombine=this.bounceCombine=e.bounceCombine,this.bindEngineObject(n)}async initByCreation(){return this.getMainData()}destroy(){var i;super.destroy(),(i=this.engineObject)==null||i.destroy()}};c([l({type:b.Number,label:"DynamicFriction",bindPath:"dynamicFriction"}),m()],s.prototype,"dynamicFriction",2);c([l({type:b.Number,label:"StaticFriction",bindPath:"staticFriction"}),m()],s.prototype,"staticFriction",2);c([l({type:b.Number,min:0,max:1,label:"Bounciness",bindPath:"bounciness"}),m()],s.prototype,"bounciness",2);c([l({type:b.Select,label:"FrictionCombine",bindPath:"frictionCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"frictionCombine",2);c([l({type:b.Select,label:"BounceCombine",bindPath:"bounceCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),m()],s.prototype,"bounceCombine",2);s=c([v({type:"PhysicsMaterial",label:C("asset.physics-material.title"),extname:"physMat",importMenuConfig:{type:F.Add},dragLayer:P.PhysicsMaterial,async bundle({content:t}){return{content:t}}})],s);export{s as PhysicsMaterialAsset};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var pe=Object.defineProperty;var de=(o,e,t)=>e in o?pe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(de(o,typeof e!="symbol"?e+"":e,t),t);import{aJ as j,aK as z,av as l,bm as X,cm as P,bk as se,eD as I,dr as re,bA as ye,q as me,cB as K,eE as $,eF as G,eG as L,eH as J,bI as N,f as he,aE as ue,s as y,p as m,e as r,E as ae,eI as W,eJ as S,eK as B,C as h,eL as Y,eM as fe,eN as Z,e1 as le,eO as be,eP as ge,bq as Ce,cz as Q,bs as xe,bt as Se}from"./index-e44b357e.js";import{r as H}from"./index-debbe073.js";import{c as F}from"./Component-b95aa2af.js";import"./postmen-443b3e5f.js";import{F as Pe}from"./FormItemArray-b2a3d249.js";const je={BoxColliderShape:["size","isTrigger","position","rotation","material"],CapsuleColliderShape:["radius","height","upAxis","isTrigger","position","rotation","material"],PlaneColliderShape:["isTrigger","position","rotation","material"],SphereColliderShape:["radius","isTrigger","position","rotation","material"]};function ve(o){const e={};return Object.keys(o.props).forEach(t=>{je[o.class].includes(t)&&(e[t]=o.props[t])}),e}const ze=async(o,e,t)=>{const i=o.engineObject,n=i.shapes;if(n.length===t.length&&t.every((s,a)=>Oe(s.class,n[a]))){for(let s=0;s<t.length;s++)await k(n[s],t[s]),ee(n[s],t[s]);return}i.clearShapes();for(let s=0;s<t.length;s++){const a=t[s],d=_e(a);await k(d,a),ee(d,a),i.addShape(d)}};async function k(o,e){const t=e.props.material;if(t!=null&&t.refId)try{const i=await H.assetStore.getAssetByRef(t);i!=null&&i.engineObject&&(o.material=i.engineObject)}catch(i){console.error(i)}}function Oe(o,e){switch(o){case"BoxColliderShape":return e instanceof J;case"CapsuleColliderShape":return e instanceof L;case"PlaneColliderShape":return e instanceof G;case"SphereColliderShape":return e instanceof $;default:return!1}}function _e(o){switch(o.class){case"BoxColliderShape":return new J;case"CapsuleColliderShape":return new L;case"PlaneColliderShape":return new G;case"SphereColliderShape":return new $}}function ee(o,e){const t=e.props;if(o instanceof J&&t.size){const s=o.size;s.copyFrom(t.size),o.size=s}else o instanceof L?(t.radius!==void 0&&(o.radius=t.radius),t.height!==void 0&&(o.height=t.height),t.upAxis!==void 0&&(o.upAxis=t.upAxis)):o instanceof $&&t.radius!==void 0&&(o.radius=t.radius);o.isTrigger=t.isTrigger;const i=o.position;i.copyFrom(t.position),o.position=i;const n=o.rotation;n.copyFrom(t.rotation),o.rotation=n}const De=o=>o.map(e=>{if(e instanceof J)return{class:"BoxColliderShape",props:{isTrigger:e.isTrigger,size:{x:e.size.x,y:e.size.y,z:e.size.z},position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof L)return{class:"CapsuleColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,height:e.height,upAxis:e.upAxis,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof G)return{class:"PlaneColliderShape",props:{isTrigger:e.isTrigger,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof $)return{class:"SphereColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}}}),Te=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(X,{label:t("physics.shape.box.size.title"),info:t("physics.shape.box.size.info"),min:0,value:{x:o.props.size.x,y:o.props.size.y,z:o.props.size.z},onChange:(i,n)=>{const s=i==null?void 0:i[n];typeof s=="number"&&e(a=>{a.props.size={...a.props.size,[n]:s}})}})})}),we=j(()=>l.jsx(l.Fragment,{})),Ae=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(P,{label:t("physics.shape.sphere.radius.title"),info:t("physics.shape.sphere.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}})})}),Me=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsxs(l.Fragment,{children:[l.jsx(P,{label:t("physics.shape.capsule.radius.title"),info:t("physics.shape.capsule.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}}),l.jsx(P,{label:t("physics.shape.capsule.height.title"),info:t("physics.shape.capsule.height.info"),value:o.props.height,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.height=i})}}),l.jsx(se,{label:t("physics.shape.capsule.up-axis.title"),info:t("physics.shape.capsule.up-axis.info"),options:[{label:"X",value:I.X},{label:"Y",value:I.Y},{label:"Z",value:I.Z}],value:o.props.upAxis,onChange:i=>{e(n=>{n.props.upAxis=i})}})]})}),Fe={BoxColliderShape:Te,CapsuleColliderShape:Me,PlaneColliderShape:we,SphereColliderShape:Ae},q={BoxColliderShape:{class:"BoxColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},size:{x:1,y:1,z:1},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},CapsuleColliderShape:{class:"CapsuleColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,height:2,upAxis:I.Y,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},PlaneColliderShape:{class:"PlaneColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},SphereColliderShape:{class:"SphereColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}}},Ve=j(({item:o,onItemChange:e})=>{var d;const{t}=z(),i=Fe[o.class],n=H.assetStore,s=Object.values(n.assets).filter(c=>c.getMetaConfig().type==="PhysicsMaterial"),a=n.assets[(d=o.props.material)==null?void 0:d.refId];return l.jsxs(l.Fragment,{children:[l.jsx(re,{label:t("physics.collider.trigger.title"),info:t("physics.collider.trigger.info"),value:o.props.isTrigger,onChange:c=>{e(f=>{f.props.isTrigger=c})}}),l.jsx(ye,{label:t("physics.collider.material.title"),info:t("physics.collider.material.info"),dropLayer:me.PhysicsMaterial,value:a==null?void 0:a.name,assets:s,onSelect:c=>{e(f=>{f.props.material=c.getCurrentRef()})},onLocate:()=>{a&&a.id&&n.selectAsset(a.id)}}),l.jsx(i,{item:o,onItemChange:e}),l.jsx(X,{label:t("physics.collider.local-position.title"),info:t("physics.collider.local-position.info"),value:{x:o.props.position.x,y:o.props.position.y,z:o.props.position.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.position={...b.props.position,[f]:u}})}}),l.jsx(X,{label:t("physics.collider.rotation.title"),info:t("physics.collider.rotation.info"),value:{x:o.props.rotation.x,y:o.props.rotation.y,z:o.props.rotation.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.rotation={...b.props.rotation,[f]:u}})}})]})}),Be=j(({collider:o,item:e,index:t,onModelChange:i})=>{const{t:n}=z(),s=[{label:n("physics.shape.box.title"),value:"BoxColliderShape"},{label:n("physics.shape.capsule.title"),value:"CapsuleColliderShape"}];o.engineObject instanceof K||(s.push({label:n("physics.shape.plane.title"),value:"PlaneColliderShape"}),s.push({label:n("physics.shape.sphere.title"),value:"SphereColliderShape"}));const d=c=>{const f=o.colliderShapes,u=N(f),b=u[t];b&&(c(b),i==null||i("colliderShapes",u))};return l.jsxs(l.Fragment,{children:[l.jsx(se,{label:n("physics.shape.type.title"),info:n("physics.shape.type.info"),value:e.class,options:s,onChange:c=>{q[c].class!==e.class&&d(u=>{Object.assign(u,N(q[c]))})}}),l.jsx(Ve,{item:e,onItemChange:d})]})}),Ee=j(({model:o,inspectorConfig:e,onModelChange:t})=>{const{label:i}=e,n=o.colliderShapes,{t:s}=z(),a=d=>{const c=N(n);d(c),t==null||t("colliderShapes",c)};return l.jsx(Pe,{label:i,items:n.map((d,c)=>({removable:!0,children:l.jsx(Be,{collider:o,item:d,index:c,onModelChange:t}),id:`${c}`,name:s("physics.shape.item-name",{index:c})})),addable:!0,onAdd:()=>{a(d=>{d.push(N(q.BoxColliderShape))})},onDelete:d=>{a(c=>{c.splice(+d.id,1)})},addItemText:s("physics.shape.add")})});var Ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,$e=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ne(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ie(e,t,n),n};class R extends ae{constructor(){super(...arguments);p(this,"colliderShapes",[])}}$e([he({engineKey:"addShape",editorKey:"colliderShapes",getPath:"shapes",valueType:ue.Object,getEngineValue:o=>o.shapes,getEditorValue:De}),y({type:"methods",key:"colliderShapes",canonicalizeToProps:!0,onSerialize:o=>o.map(e=>({$type:e.class,...ve(e)})),onDeserialize:o=>o.map(e=>{const{$type:t,...i}=e;return{class:t,props:i}})}),m({label:r("physics.collider.title"),info:r("physics.collider.info"),customComponent:Ee,onChange:ze})],R.prototype,"colliderShapes",2);var Le=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Re=(o,e,t,i)=>{for(var n=i>1?void 0:i?Je(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Le(e,t,n),n};let te=class extends R{constructor(o,e){super(o,e)}};te=Re([F({type:"StaticCollider",componentsMenu:{group:"physics",label:"component.static-collider.title"}})],te);const ie=o=>Object.keys(S).filter(e=>(o&S[e])!==0).map(e=>String(S[e])),Xe=j(({model:o,onModelChange:e})=>{const t=n=>{const a=n.map(d=>parseInt(d)).reduce((d,c)=>d|c,S.None);e==null||e("constraints",a)},{t:i}=z();return l.jsxs(l.Fragment,{children:[l.jsx(W,{label:i("physics.collider-constraints.freeze-position.title"),info:i("physics.collider-constraints.freeze-position.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezePositionX.toString(),label:"X"},{value:S.FreezePositionY.toString(),label:"Y"},{value:S.FreezePositionZ.toString(),label:"Z"}],onChange:t}),l.jsx(W,{label:i("physics.collider-constraints.freeze-rotation.title"),info:i("physics.collider-constraints.freeze-rotation.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezeRotationX.toString(),label:"X"},{value:S.FreezeRotationY.toString(),label:"Y"},{value:S.FreezeRotationZ.toString(),label:"Z"}],onChange:t})]})});var Ke=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,C=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ye(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ke(e,t,n),n};let g=class extends R{constructor(e,t){super(e,t);p(this,"isKinematic",!1);p(this,"collisionDetectionMode",B.Discrete);p(this,"constraints",S.None);p(this,"mass",1);p(this,"useGravity",!0);p(this,"linearDamping",0);p(this,"angularDamping",.05);p(this,"automaticCenterOfMass",!0);p(this,"centerOfMass",{x:0,y:0,z:0});p(this,"automaticInertiaTensor",!0);p(this,"inertiaTensor",{x:1,y:1,z:1});p(this,"linearVelocity",{x:0,y:0,z:0});p(this,"angularVelocity",{x:0,y:0,z:0});p(this,"maxAngularVelocity",100);p(this,"maxDepenetrationVelocity",10000000331813535e16);p(this,"sleepThreshold",.005);p(this,"solverIterations",4)}onEnabled(){this._applyEditorRuntimeState()}onInitComplete(){this._applyEditorRuntimeState()}rebindEngineObject(e){super.rebindEngineObject(e),this._applyEditorRuntimeState()}_applyEditorRuntimeState(){this.applyBoundPathChange("enabled",h.Toggle,!1)}};C([y(),m({label:r("physics.dynamic-collider.kinematic.title"),info:r("physics.dynamic-collider.kinematic.info"),type:h.Boolean,bindPath:"isKinematic"})],g.prototype,"isKinematic",2);C([y(),m({label:r("physics.dynamic-collider.collision-detection-mode.title"),type:h.Select,bindPath:"collisionDetectionMode",options:[{label:r("physics.dynamic-collider.collision-detection-mode.discrete"),value:B.Discrete},{label:r("physics.dynamic-collider.collision-detection-mode.continuous"),value:B.Continuous},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-dynamic"),value:B.ContinuousDynamic},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-speculative"),value:B.ContinuousSpeculative}]})],g.prototype,"collisionDetectionMode",2);C([y(),m({label:r("physics.dynamic-collider.constraints.title"),info:r("physics.dynamic-collider.constraints.info"),customComponent:Xe,bindPath:"constraints"})],g.prototype,"constraints",2);C([y(),m({label:r("physics.dynamic-collider.mass.title"),info:r("physics.dynamic-collider.mass.info"),bindPath:"mass",min:0,type:h.Number})],g.prototype,"mass",2);C([y(),m({label:r("physics.dynamic-collider.gravity.title"),info:r("physics.dynamic-collider.gravity.info"),bindPath:"useGravity",type:h.Boolean})],g.prototype,"useGravity",2);C([y(),m({label:r("physics.dynamic-collider.linear-damping.title"),info:r("physics.dynamic-collider.linear-damping.info"),bindPath:"linearDamping",min:0,type:h.Number})],g.prototype,"linearDamping",2);C([y(),m({label:r("physics.dynamic-collider.angular-damping.title"),info:r("physics.dynamic-collider.angular-damping.info"),bindPath:"angularDamping",min:0,type:h.Number})],g.prototype,"angularDamping",2);C([y(),m({label:r("physics.dynamic-collider.automatic-center-of-mass.title"),info:r("physics.dynamic-collider.automatic-center-of-mass.info"),bindPath:"automaticCenterOfMass",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.centerOfMass;o.centerOfMass={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticCenterOfMass",2);C([y(),m({label:r("physics.dynamic-collider.center-of-mass.title"),info:r("physics.dynamic-collider.center-of-mass.info"),type:h.Vector3,bindPath:"centerOfMass",when:o=>!o.automaticCenterOfMass})],g.prototype,"centerOfMass",2);C([y(),m({label:r("physics.dynamic-collider.automatic-inertia-tensor.title"),info:r("physics.dynamic-collider.automatic-inertia-tensor.info"),bindPath:"automaticInertiaTensor",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.inertiaTensor;o.inertiaTensor={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticInertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.inertia-tensor.title"),info:r("physics.dynamic-collider.inertia-tensor.info"),type:h.Vector3,bindPath:"inertiaTensor",when:o=>!o.automaticInertiaTensor})],g.prototype,"inertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.linear-velocity.title"),info:r("physics.dynamic-collider.linear-velocity.info"),type:h.Vector3,bindPath:"linearVelocity"})],g.prototype,"linearVelocity",2);C([y(),m({label:r("physics.dynamic-collider.angular-velocity.title"),info:r("physics.dynamic-collider.angular-velocity.info"),type:h.Vector3,bindPath:"angularVelocity"})],g.prototype,"angularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-angular-velocity.title"),info:r("physics.dynamic-collider.max-angular-velocity.info"),bindPath:"maxAngularVelocity",min:0,type:h.Number})],g.prototype,"maxAngularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-depenetration-velocity.title"),info:r("physics.dynamic-collider.max-depenetration-velocity.info"),bindPath:"maxDepenetrationVelocity",min:0,type:h.Number})],g.prototype,"maxDepenetrationVelocity",2);C([y(),m({label:r("physics.dynamic-collider.sleep-threshold.title"),info:r("physics.dynamic-collider.sleep-threshold.info"),bindPath:"sleepThreshold",min:0,type:h.Number})],g.prototype,"sleepThreshold",2);C([y(),m({label:r("physics.dynamic-collider.solver-iterations.title"),info:r("physics.dynamic-collider.solver-iterations.info"),bindPath:"solverIterations",min:0,max:10,dragStep:1,type:h.Slider})],g.prototype,"solverIterations",2);g=C([F({type:"DynamicCollider",componentsMenu:{group:"physics",label:"component.dynamic-collider.title"}})],g);var qe=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,E=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ge(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&qe(e,t,n),n};let M=class extends R{constructor(e,t){super(e,t);p(this,"stepOffset",.5);p(this,"upDirection",{x:0,y:1,z:0});p(this,"slopeLimit",45);p(this,"nonWalkableMode",Y.PreventClimbing)}async bindEngineObject(e){await super.bindEngineObject(e),e.enabled=!1}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1}};E([y(),m({label:r("physics.character.step-offset.title"),info:r("physics.character.step-offset.info"),bindPath:"stepOffset",min:0,type:h.Number})],M.prototype,"stepOffset",2);E([y(),m({label:r("physics.character.up-direction.title"),info:r("physics.character.up-direction.info"),type:h.Vector3,bindPath:"upDirection"})],M.prototype,"upDirection",2);E([y(),m({label:r("physics.character.slop-limit.title"),info:r("physics.character.slop-limit.info"),bindPath:"slopeLimit",min:0,max:180,type:h.Number})],M.prototype,"slopeLimit",2);E([y(),m({label:r("physics.character.non-walkable-mode.title"),info:r("physics.character.non-walkable-mode.info"),bindPath:"nonWalkableMode",type:h.Select,options:[{label:r("physics.character.non-walkable-mode.prevent-climbing"),value:Y.PreventClimbing},{label:r("physics.character.non-walkable-mode.prevent-climbing-and-force-sliding"),value:Y.PreventClimbingAndForceSliding}]})],M.prototype,"nonWalkableMode",2);M=E([F({type:"CharacterController",componentsMenu:{label:r("component.physics.character.title"),group:"physics"}})],M);const Ze=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,disabled:a,info:d}=e,{ownerId:c}=t[n]||{},f=c&&o.model.root.sceneStore.getEntityModel(c),u=O=>{const _=O?H.sceneStore.getEntityModel(O):null,U=(_==null?void 0:_.getComponentByTypeName("DynamicCollider"))||(_==null?void 0:_.getComponentByTypeName("StaticCollider")),ce=U?{ownerId:O,componentId:U.id}:null;i==null||i(n,ce)},{t:b}=z(),x=Array.from(t.root.sceneStore.iterateEntityModels(),([,O])=>O);return l.jsx(l.Fragment,{children:l.jsx(fe,{label:b(s),info:b(d),entities:x,value:c,disabled:a,customFilter:O=>{let _=null;return t.entityModelId!==O.id&&(_=O.getComponentByTypeName("DynamicCollider")||O.getComponentByTypeName("StaticCollider")),_},displayValue:f==null?void 0:f.name,placeholder:b("physics.collider-picker.placeholder"),onSelect:u,onLocate:()=>{o.model.root.sceneStore.selectEntity(c)},onDelete:()=>{u(null)}})})});var He=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,T=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ue(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&He(e,t,n),n};class v extends ae{constructor(){super(...arguments);p(this,"connectedCollider",null);p(this,"anchor",{x:0,y:0,z:0});p(this,"automaticConnectedAnchor",!0);p(this,"connectedAnchor",{x:0,y:0,z:0});p(this,"breakForce",Number.MAX_VALUE);p(this,"breakTorque",Number.MAX_VALUE);p(this,"massScale",1);p(this,"connectedMassScale",1)}async applyBoundPathChange(t,i,n){var s,a;if(t==="connectedCollider"){const d=n,c=((a=(s=this.root.sceneStore.getEntityModel(d==null?void 0:d.ownerId))==null?void 0:s.getComponentById(d==null?void 0:d.componentId))==null?void 0:a.engineObject)??null;await super.applyBoundPathChange(t,i,c);return}await super.applyBoundPathChange(t,i,n)}}T([y(),m({label:r("physics.joint.connected-collider.title"),info:r("physics.joint.connected-collider.info"),customComponent:Ze,bindPath:"connectedCollider"})],v.prototype,"connectedCollider",2);T([y(),m({label:r("physics.joint.anchor.title"),type:h.Vector3,bindPath:"anchor",onChange(o,e,t){if(o.automaticConnectedAnchor){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"anchor",2);T([y(),m({label:r("physics.joint.automatic-connected-anchor.title"),type:h.Boolean,bindPath:"automaticConnectedAnchor",onChange(o,e,t){if(t){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"automaticConnectedAnchor",2);T([y(),m({label:r("physics.joint.connected-anchor.title"),type:h.Vector3,bindPath:"connectedAnchor",when:o=>!o.automaticConnectedAnchor})],v.prototype,"connectedAnchor",2);T([y(),m({label:r("physics.joint.break-force.title"),type:h.Number,bindPath:"breakForce"})],v.prototype,"breakForce",2);T([y(),m({label:r("physics.joint.break-torque.title"),type:h.Number,bindPath:"breakTorque"})],v.prototype,"breakTorque",2);T([y(),m({label:r("physics.joint.mass-scale.title"),type:h.Number,bindPath:"massScale"})],v.prototype,"massScale",2);T([y(),m({label:r("physics.joint.connected-mass-scale.title"),type:h.Number,bindPath:"connectedMassScale"})],v.prototype,"connectedMassScale",2);var We=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,ke=(o,e,t,i)=>{for(var n=i>1?void 0:i?Qe(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&We(e,t,n),n};let oe=class extends v{constructor(o,e){super(o,e)}};oe=ke([F({type:"FixedJoint",componentsMenu:{label:r("component.physics.fixed-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],oe);const et=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useLimits,c=t.useSpring,f=t[n],u=f.props,{t:b}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:b(s),info:b(a),children:[l.jsx(P,{label:b("physics.joint-limits.min"),value:u.min,onChange:x=>{u.max<x&&(u.max=x),u.min=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.max"),value:u.max,onChange:x=>{x<u.min&&(x=u.min),u.max=x,i(n,f)}}),c?l.jsxs(l.Fragment,{children:[l.jsx(P,{label:b("physics.joint-limits.stiffness"),value:u.stiffness,onChange:x=>{u.stiffness=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.damping"),value:u.damping,onChange:x=>{u.damping=x,i(n,f)}})]}):l.jsx(P,{label:b("physics.joint-limits.contact-distance"),value:u.contactDistance,onChange:x=>{u.contactDistance=x,i(n,f)}})]}):null})}),tt=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useMotor,c=t[n],f=c.props,{t:u}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:u(s),info:u(a),children:[l.jsx(P,{label:u("physics.joint-motor.target-velocity"),value:f.targetVelocity,onChange:b=>{f.targetVelocity=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.force-limit"),value:f.forceLimit,onChange:b=>{f.forceLimit=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.gear-ratio"),value:f.gearRatio,onChange:b=>{f.gearRatio=b,i(n,c)}}),l.jsx(re,{label:u("physics.joint-motor.free-spin"),value:f.freeSpin,onChange:b=>{f.freeSpin=b,i(n,c)}})]}):null})});var it=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var n=i>1?void 0:i?ot(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&it(e,t,n),n};let D=class extends v{constructor(e,t){super(e,t);p(this,"axis",{x:1,y:0,z:0});p(this,"useLimits",!1);p(this,"useSpring",!1);p(this,"limits",{class:"JointLimits",props:{max:0,min:0,contactDistance:-1,stiffness:0,damping:0}});p(this,"useMotor",!1);p(this,"motor",{class:"JointMotor",props:{targetVelocity:0,forceLimit:Number.MAX_VALUE,gearRatio:1,freeSpin:!1}})}async applyBoundPathChange(e,t,i){if(e==="limits"){const n=this._buildLimitsFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}if(e==="motor"){const n=this._buildMotorFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}await super.applyBoundPathChange(e,t,i)}_buildLimitsFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new be;return i.max=t.max,i.min=t.min,i.contactDistance=t.contactDistance,i.stiffness=t.stiffness,i.damping=t.damping,i}_buildMotorFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new ge;return i.targetVelocity=t.targetVelocity,i.forceLimit=t.forceLimit,i.gearRatio=t.gearRatio,i.freeSpin=t.freeSpin,i}};A([y(),m({label:r("physics.hinge-joint.axis.title"),type:h.Vector3,bindPath:"axis"})],D.prototype,"axis",2);A([y(),m({label:r("physics.hinge-joint.use-limits.title"),type:h.Boolean,bindPath:"useLimits"})],D.prototype,"useLimits",2);A([y(),m({label:r("physics.hinge-joint.use-spring.title"),type:h.Boolean,bindPath:"useSpring"})],D.prototype,"useSpring",2);A([y(),m({label:r("physics.hinge-joint.limits.title"),customComponent:et,bindPath:"limits"})],D.prototype,"limits",2);A([y(),m({label:r("physics.hinge-joint.use-motor.title"),type:h.Boolean,bindPath:"useMotor"})],D.prototype,"useMotor",2);A([y(),m({label:r("physics.hinge-joint.motor.title"),customComponent:tt,bindPath:"motor"})],D.prototype,"motor",2);D=A([F({type:"HingeJoint",componentsMenu:{label:r("component.physics.hinge-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],D);var nt=Object.defineProperty,st=Object.getOwnPropertyDescriptor,V=(o,e,t,i)=>{for(var n=i>1?void 0:i?st(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&nt(e,t,n),n};let w=class extends v{constructor(e,t){super(e,t);p(this,"spring",10);p(this,"damper",.2);p(this,"minDistance",0);p(this,"maxDistance",0);p(this,"tolerance",.025)}};V([y(),m({label:r("physics.spring-joint.spring.title"),type:h.Number,bindPath:"spring"})],w.prototype,"spring",2);V([y(),m({label:r("physics.spring-joint.damper.title"),type:h.Number,bindPath:"damper"})],w.prototype,"damper",2);V([y(),m({label:r("physics.spring-joint.min-distance.title"),type:h.Number,bindPath:"minDistance"})],w.prototype,"minDistance",2);V([y(),m({label:r("physics.spring-joint.max-distance.title"),type:h.Number,bindPath:"maxDistance"})],w.prototype,"maxDistance",2);V([y(),m({label:r("physics.spring-joint.tolerance.title"),type:h.Number,bindPath:"tolerance"})],w.prototype,"tolerance",2);w=V([F({type:"SpringJoint",componentsMenu:{label:r("component.physics.spring-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],w);class rt extends Ce{constructor(){super(...arguments);p(this,"_isPlaying",!1)}onPlay(t){this._isPlaying=t,this._toggleAll(t)}onAddComponent(t){!this._isPlaying&&(t instanceof Q||t instanceof K)&&(t.enabled=!1)}_toggleAll(t){var a;const i=(a=this.engine.sceneManager.activeScene)==null?void 0:a.rootEntities;if(!i)return;const n=[],s=[];i.forEach(d=>{d.getComponentsIncludeChildren(Q,n),d.getComponentsIncludeChildren(K,s)}),n.forEach(d=>{d.enabled=t}),s.forEach(d=>{d.enabled=t})}}var at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ct=(o,e,t,i)=>{for(var n=i>1?void 0:i?lt(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&at(e,t,n),n};let ne=class{constructor(){p(this,"script")}init(){this.script=xe.addScript(rt)}};ne=ct([Se({type:"physicsStore"})],ne);export{M as C,g as D,oe as F,D as H,ne as P,te as S,w as a};
|
|
1
|
+
var pe=Object.defineProperty;var de=(o,e,t)=>e in o?pe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(de(o,typeof e!="symbol"?e+"":e,t),t);import{aJ as j,aK as z,av as l,bm as X,cm as P,bk as se,eD as I,dr as re,bA as ye,q as me,cB as K,eE as $,eF as G,eG as L,eH as J,bI as N,f as he,aE as ue,s as y,p as m,e as r,E as ae,eI as W,eJ as S,eK as B,C as h,eL as Y,eM as fe,eN as Z,e1 as le,eO as be,eP as ge,bq as Ce,cz as Q,bs as xe,bt as Se}from"./index-c3dec278.js";import{r as H}from"./index-cdbb2f4d.js";import{c as F}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{F as Pe}from"./FormItemArray-b8cda1d2.js";const je={BoxColliderShape:["size","isTrigger","position","rotation","material"],CapsuleColliderShape:["radius","height","upAxis","isTrigger","position","rotation","material"],PlaneColliderShape:["isTrigger","position","rotation","material"],SphereColliderShape:["radius","isTrigger","position","rotation","material"]};function ve(o){const e={};return Object.keys(o.props).forEach(t=>{je[o.class].includes(t)&&(e[t]=o.props[t])}),e}const ze=async(o,e,t)=>{const i=o.engineObject,n=i.shapes;if(n.length===t.length&&t.every((s,a)=>Oe(s.class,n[a]))){for(let s=0;s<t.length;s++)await k(n[s],t[s]),ee(n[s],t[s]);return}i.clearShapes();for(let s=0;s<t.length;s++){const a=t[s],d=_e(a);await k(d,a),ee(d,a),i.addShape(d)}};async function k(o,e){const t=e.props.material;if(t!=null&&t.refId)try{const i=await H.assetStore.getAssetByRef(t);i!=null&&i.engineObject&&(o.material=i.engineObject)}catch(i){console.error(i)}}function Oe(o,e){switch(o){case"BoxColliderShape":return e instanceof J;case"CapsuleColliderShape":return e instanceof L;case"PlaneColliderShape":return e instanceof G;case"SphereColliderShape":return e instanceof $;default:return!1}}function _e(o){switch(o.class){case"BoxColliderShape":return new J;case"CapsuleColliderShape":return new L;case"PlaneColliderShape":return new G;case"SphereColliderShape":return new $}}function ee(o,e){const t=e.props;if(o instanceof J&&t.size){const s=o.size;s.copyFrom(t.size),o.size=s}else o instanceof L?(t.radius!==void 0&&(o.radius=t.radius),t.height!==void 0&&(o.height=t.height),t.upAxis!==void 0&&(o.upAxis=t.upAxis)):o instanceof $&&t.radius!==void 0&&(o.radius=t.radius);o.isTrigger=t.isTrigger;const i=o.position;i.copyFrom(t.position),o.position=i;const n=o.rotation;n.copyFrom(t.rotation),o.rotation=n}const De=o=>o.map(e=>{if(e instanceof J)return{class:"BoxColliderShape",props:{isTrigger:e.isTrigger,size:{x:e.size.x,y:e.size.y,z:e.size.z},position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof L)return{class:"CapsuleColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,height:e.height,upAxis:e.upAxis,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof G)return{class:"PlaneColliderShape",props:{isTrigger:e.isTrigger,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}};if(e instanceof $)return{class:"SphereColliderShape",props:{isTrigger:e.isTrigger,radius:e.radius,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x,y:e.rotation.y,z:e.rotation.z}}}}),Te=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(X,{label:t("physics.shape.box.size.title"),info:t("physics.shape.box.size.info"),min:0,value:{x:o.props.size.x,y:o.props.size.y,z:o.props.size.z},onChange:(i,n)=>{const s=i==null?void 0:i[n];typeof s=="number"&&e(a=>{a.props.size={...a.props.size,[n]:s}})}})})}),we=j(()=>l.jsx(l.Fragment,{})),Ae=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsx(l.Fragment,{children:l.jsx(P,{label:t("physics.shape.sphere.radius.title"),info:t("physics.shape.sphere.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}})})}),Me=j(({item:o,onItemChange:e})=>{const{t}=z();return l.jsxs(l.Fragment,{children:[l.jsx(P,{label:t("physics.shape.capsule.radius.title"),info:t("physics.shape.capsule.radius.info"),value:o.props.radius,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.radius=i})}}),l.jsx(P,{label:t("physics.shape.capsule.height.title"),info:t("physics.shape.capsule.height.info"),value:o.props.height,min:0,onChange:i=>{typeof i=="number"&&e(n=>{n.props.height=i})}}),l.jsx(se,{label:t("physics.shape.capsule.up-axis.title"),info:t("physics.shape.capsule.up-axis.info"),options:[{label:"X",value:I.X},{label:"Y",value:I.Y},{label:"Z",value:I.Z}],value:o.props.upAxis,onChange:i=>{e(n=>{n.props.upAxis=i})}})]})}),Fe={BoxColliderShape:Te,CapsuleColliderShape:Me,PlaneColliderShape:we,SphereColliderShape:Ae},q={BoxColliderShape:{class:"BoxColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},size:{x:1,y:1,z:1},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},CapsuleColliderShape:{class:"CapsuleColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,height:2,upAxis:I.Y,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},PlaneColliderShape:{class:"PlaneColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}},SphereColliderShape:{class:"SphereColliderShape",props:{isTrigger:!1,material:{refId:"0000401"},radius:.5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}}},Ve=j(({item:o,onItemChange:e})=>{var d;const{t}=z(),i=Fe[o.class],n=H.assetStore,s=Object.values(n.assets).filter(c=>c.getMetaConfig().type==="PhysicsMaterial"),a=n.assets[(d=o.props.material)==null?void 0:d.refId];return l.jsxs(l.Fragment,{children:[l.jsx(re,{label:t("physics.collider.trigger.title"),info:t("physics.collider.trigger.info"),value:o.props.isTrigger,onChange:c=>{e(f=>{f.props.isTrigger=c})}}),l.jsx(ye,{label:t("physics.collider.material.title"),info:t("physics.collider.material.info"),dropLayer:me.PhysicsMaterial,value:a==null?void 0:a.name,assets:s,onSelect:c=>{e(f=>{f.props.material=c.getCurrentRef()})},onLocate:()=>{a&&a.id&&n.selectAsset(a.id)}}),l.jsx(i,{item:o,onItemChange:e}),l.jsx(X,{label:t("physics.collider.local-position.title"),info:t("physics.collider.local-position.info"),value:{x:o.props.position.x,y:o.props.position.y,z:o.props.position.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.position={...b.props.position,[f]:u}})}}),l.jsx(X,{label:t("physics.collider.rotation.title"),info:t("physics.collider.rotation.info"),value:{x:o.props.rotation.x,y:o.props.rotation.y,z:o.props.rotation.z},onChange:(c,f)=>{const u=c==null?void 0:c[f];typeof u=="number"&&e(b=>{b.props.rotation={...b.props.rotation,[f]:u}})}})]})}),Be=j(({collider:o,item:e,index:t,onModelChange:i})=>{const{t:n}=z(),s=[{label:n("physics.shape.box.title"),value:"BoxColliderShape"},{label:n("physics.shape.capsule.title"),value:"CapsuleColliderShape"}];o.engineObject instanceof K||(s.push({label:n("physics.shape.plane.title"),value:"PlaneColliderShape"}),s.push({label:n("physics.shape.sphere.title"),value:"SphereColliderShape"}));const d=c=>{const f=o.colliderShapes,u=N(f),b=u[t];b&&(c(b),i==null||i("colliderShapes",u))};return l.jsxs(l.Fragment,{children:[l.jsx(se,{label:n("physics.shape.type.title"),info:n("physics.shape.type.info"),value:e.class,options:s,onChange:c=>{q[c].class!==e.class&&d(u=>{Object.assign(u,N(q[c]))})}}),l.jsx(Ve,{item:e,onItemChange:d})]})}),Ee=j(({model:o,inspectorConfig:e,onModelChange:t})=>{const{label:i}=e,n=o.colliderShapes,{t:s}=z(),a=d=>{const c=N(n);d(c),t==null||t("colliderShapes",c)};return l.jsx(Pe,{label:i,items:n.map((d,c)=>({removable:!0,children:l.jsx(Be,{collider:o,item:d,index:c,onModelChange:t}),id:`${c}`,name:s("physics.shape.item-name",{index:c})})),addable:!0,onAdd:()=>{a(d=>{d.push(N(q.BoxColliderShape))})},onDelete:d=>{a(c=>{c.splice(+d.id,1)})},addItemText:s("physics.shape.add")})});var Ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,$e=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ne(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ie(e,t,n),n};class R extends ae{constructor(){super(...arguments);p(this,"colliderShapes",[])}}$e([he({engineKey:"addShape",editorKey:"colliderShapes",getPath:"shapes",valueType:ue.Object,getEngineValue:o=>o.shapes,getEditorValue:De}),y({type:"methods",key:"colliderShapes",canonicalizeToProps:!0,onSerialize:o=>o.map(e=>({$type:e.class,...ve(e)})),onDeserialize:o=>o.map(e=>{const{$type:t,...i}=e;return{class:t,props:i}})}),m({label:r("physics.collider.title"),info:r("physics.collider.info"),customComponent:Ee,onChange:ze})],R.prototype,"colliderShapes",2);var Le=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Re=(o,e,t,i)=>{for(var n=i>1?void 0:i?Je(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Le(e,t,n),n};let te=class extends R{constructor(o,e){super(o,e)}};te=Re([F({type:"StaticCollider",componentsMenu:{group:"physics",label:"component.static-collider.title"}})],te);const ie=o=>Object.keys(S).filter(e=>(o&S[e])!==0).map(e=>String(S[e])),Xe=j(({model:o,onModelChange:e})=>{const t=n=>{const a=n.map(d=>parseInt(d)).reduce((d,c)=>d|c,S.None);e==null||e("constraints",a)},{t:i}=z();return l.jsxs(l.Fragment,{children:[l.jsx(W,{label:i("physics.collider-constraints.freeze-position.title"),info:i("physics.collider-constraints.freeze-position.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezePositionX.toString(),label:"X"},{value:S.FreezePositionY.toString(),label:"Y"},{value:S.FreezePositionZ.toString(),label:"Z"}],onChange:t}),l.jsx(W,{label:i("physics.collider-constraints.freeze-rotation.title"),info:i("physics.collider-constraints.freeze-rotation.info"),type:"multiple",value:ie(o.constraints),options:[{value:S.FreezeRotationX.toString(),label:"X"},{value:S.FreezeRotationY.toString(),label:"Y"},{value:S.FreezeRotationZ.toString(),label:"Z"}],onChange:t})]})});var Ke=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,C=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ye(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ke(e,t,n),n};let g=class extends R{constructor(e,t){super(e,t);p(this,"isKinematic",!1);p(this,"collisionDetectionMode",B.Discrete);p(this,"constraints",S.None);p(this,"mass",1);p(this,"useGravity",!0);p(this,"linearDamping",0);p(this,"angularDamping",.05);p(this,"automaticCenterOfMass",!0);p(this,"centerOfMass",{x:0,y:0,z:0});p(this,"automaticInertiaTensor",!0);p(this,"inertiaTensor",{x:1,y:1,z:1});p(this,"linearVelocity",{x:0,y:0,z:0});p(this,"angularVelocity",{x:0,y:0,z:0});p(this,"maxAngularVelocity",100);p(this,"maxDepenetrationVelocity",10000000331813535e16);p(this,"sleepThreshold",.005);p(this,"solverIterations",4)}onEnabled(){this._applyEditorRuntimeState()}onInitComplete(){this._applyEditorRuntimeState()}rebindEngineObject(e){super.rebindEngineObject(e),this._applyEditorRuntimeState()}_applyEditorRuntimeState(){this.applyBoundPathChange("enabled",h.Toggle,!1)}};C([y(),m({label:r("physics.dynamic-collider.kinematic.title"),info:r("physics.dynamic-collider.kinematic.info"),type:h.Boolean,bindPath:"isKinematic"})],g.prototype,"isKinematic",2);C([y(),m({label:r("physics.dynamic-collider.collision-detection-mode.title"),type:h.Select,bindPath:"collisionDetectionMode",options:[{label:r("physics.dynamic-collider.collision-detection-mode.discrete"),value:B.Discrete},{label:r("physics.dynamic-collider.collision-detection-mode.continuous"),value:B.Continuous},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-dynamic"),value:B.ContinuousDynamic},{label:r("physics.dynamic-collider.collision-detection-mode.continuous-speculative"),value:B.ContinuousSpeculative}]})],g.prototype,"collisionDetectionMode",2);C([y(),m({label:r("physics.dynamic-collider.constraints.title"),info:r("physics.dynamic-collider.constraints.info"),customComponent:Xe,bindPath:"constraints"})],g.prototype,"constraints",2);C([y(),m({label:r("physics.dynamic-collider.mass.title"),info:r("physics.dynamic-collider.mass.info"),bindPath:"mass",min:0,type:h.Number})],g.prototype,"mass",2);C([y(),m({label:r("physics.dynamic-collider.gravity.title"),info:r("physics.dynamic-collider.gravity.info"),bindPath:"useGravity",type:h.Boolean})],g.prototype,"useGravity",2);C([y(),m({label:r("physics.dynamic-collider.linear-damping.title"),info:r("physics.dynamic-collider.linear-damping.info"),bindPath:"linearDamping",min:0,type:h.Number})],g.prototype,"linearDamping",2);C([y(),m({label:r("physics.dynamic-collider.angular-damping.title"),info:r("physics.dynamic-collider.angular-damping.info"),bindPath:"angularDamping",min:0,type:h.Number})],g.prototype,"angularDamping",2);C([y(),m({label:r("physics.dynamic-collider.automatic-center-of-mass.title"),info:r("physics.dynamic-collider.automatic-center-of-mass.info"),bindPath:"automaticCenterOfMass",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.centerOfMass;o.centerOfMass={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticCenterOfMass",2);C([y(),m({label:r("physics.dynamic-collider.center-of-mass.title"),info:r("physics.dynamic-collider.center-of-mass.info"),type:h.Vector3,bindPath:"centerOfMass",when:o=>!o.automaticCenterOfMass})],g.prototype,"centerOfMass",2);C([y(),m({label:r("physics.dynamic-collider.automatic-inertia-tensor.title"),info:r("physics.dynamic-collider.automatic-inertia-tensor.info"),bindPath:"automaticInertiaTensor",type:h.Boolean,onChange:(o,e,t)=>{if(t){const i=o.engineObject.inertiaTensor;o.inertiaTensor={x:i.x,y:i.y,z:i.z}}}})],g.prototype,"automaticInertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.inertia-tensor.title"),info:r("physics.dynamic-collider.inertia-tensor.info"),type:h.Vector3,bindPath:"inertiaTensor",when:o=>!o.automaticInertiaTensor})],g.prototype,"inertiaTensor",2);C([y(),m({label:r("physics.dynamic-collider.linear-velocity.title"),info:r("physics.dynamic-collider.linear-velocity.info"),type:h.Vector3,bindPath:"linearVelocity"})],g.prototype,"linearVelocity",2);C([y(),m({label:r("physics.dynamic-collider.angular-velocity.title"),info:r("physics.dynamic-collider.angular-velocity.info"),type:h.Vector3,bindPath:"angularVelocity"})],g.prototype,"angularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-angular-velocity.title"),info:r("physics.dynamic-collider.max-angular-velocity.info"),bindPath:"maxAngularVelocity",min:0,type:h.Number})],g.prototype,"maxAngularVelocity",2);C([y(),m({label:r("physics.dynamic-collider.max-depenetration-velocity.title"),info:r("physics.dynamic-collider.max-depenetration-velocity.info"),bindPath:"maxDepenetrationVelocity",min:0,type:h.Number})],g.prototype,"maxDepenetrationVelocity",2);C([y(),m({label:r("physics.dynamic-collider.sleep-threshold.title"),info:r("physics.dynamic-collider.sleep-threshold.info"),bindPath:"sleepThreshold",min:0,type:h.Number})],g.prototype,"sleepThreshold",2);C([y(),m({label:r("physics.dynamic-collider.solver-iterations.title"),info:r("physics.dynamic-collider.solver-iterations.info"),bindPath:"solverIterations",min:0,max:10,dragStep:1,type:h.Slider})],g.prototype,"solverIterations",2);g=C([F({type:"DynamicCollider",componentsMenu:{group:"physics",label:"component.dynamic-collider.title"}})],g);var qe=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,E=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ge(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&qe(e,t,n),n};let M=class extends R{constructor(e,t){super(e,t);p(this,"stepOffset",.5);p(this,"upDirection",{x:0,y:1,z:0});p(this,"slopeLimit",45);p(this,"nonWalkableMode",Y.PreventClimbing)}async bindEngineObject(e){await super.bindEngineObject(e),e.enabled=!1}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1}};E([y(),m({label:r("physics.character.step-offset.title"),info:r("physics.character.step-offset.info"),bindPath:"stepOffset",min:0,type:h.Number})],M.prototype,"stepOffset",2);E([y(),m({label:r("physics.character.up-direction.title"),info:r("physics.character.up-direction.info"),type:h.Vector3,bindPath:"upDirection"})],M.prototype,"upDirection",2);E([y(),m({label:r("physics.character.slop-limit.title"),info:r("physics.character.slop-limit.info"),bindPath:"slopeLimit",min:0,max:180,type:h.Number})],M.prototype,"slopeLimit",2);E([y(),m({label:r("physics.character.non-walkable-mode.title"),info:r("physics.character.non-walkable-mode.info"),bindPath:"nonWalkableMode",type:h.Select,options:[{label:r("physics.character.non-walkable-mode.prevent-climbing"),value:Y.PreventClimbing},{label:r("physics.character.non-walkable-mode.prevent-climbing-and-force-sliding"),value:Y.PreventClimbingAndForceSliding}]})],M.prototype,"nonWalkableMode",2);M=E([F({type:"CharacterController",componentsMenu:{label:r("component.physics.character.title"),group:"physics"}})],M);const Ze=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,disabled:a,info:d}=e,{ownerId:c}=t[n]||{},f=c&&o.model.root.sceneStore.getEntityModel(c),u=O=>{const _=O?H.sceneStore.getEntityModel(O):null,U=(_==null?void 0:_.getComponentByTypeName("DynamicCollider"))||(_==null?void 0:_.getComponentByTypeName("StaticCollider")),ce=U?{ownerId:O,componentId:U.id}:null;i==null||i(n,ce)},{t:b}=z(),x=Array.from(t.root.sceneStore.iterateEntityModels(),([,O])=>O);return l.jsx(l.Fragment,{children:l.jsx(fe,{label:b(s),info:b(d),entities:x,value:c,disabled:a,customFilter:O=>{let _=null;return t.entityModelId!==O.id&&(_=O.getComponentByTypeName("DynamicCollider")||O.getComponentByTypeName("StaticCollider")),_},displayValue:f==null?void 0:f.name,placeholder:b("physics.collider-picker.placeholder"),onSelect:u,onLocate:()=>{o.model.root.sceneStore.selectEntity(c)},onDelete:()=>{u(null)}})})});var He=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,T=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ue(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&He(e,t,n),n};class v extends ae{constructor(){super(...arguments);p(this,"connectedCollider",null);p(this,"anchor",{x:0,y:0,z:0});p(this,"automaticConnectedAnchor",!0);p(this,"connectedAnchor",{x:0,y:0,z:0});p(this,"breakForce",Number.MAX_VALUE);p(this,"breakTorque",Number.MAX_VALUE);p(this,"massScale",1);p(this,"connectedMassScale",1)}async applyBoundPathChange(t,i,n){var s,a;if(t==="connectedCollider"){const d=n,c=((a=(s=this.root.sceneStore.getEntityModel(d==null?void 0:d.ownerId))==null?void 0:s.getComponentById(d==null?void 0:d.componentId))==null?void 0:a.engineObject)??null;await super.applyBoundPathChange(t,i,c);return}await super.applyBoundPathChange(t,i,n)}}T([y(),m({label:r("physics.joint.connected-collider.title"),info:r("physics.joint.connected-collider.info"),customComponent:Ze,bindPath:"connectedCollider"})],v.prototype,"connectedCollider",2);T([y(),m({label:r("physics.joint.anchor.title"),type:h.Vector3,bindPath:"anchor",onChange(o,e,t){if(o.automaticConnectedAnchor){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"anchor",2);T([y(),m({label:r("physics.joint.automatic-connected-anchor.title"),type:h.Boolean,bindPath:"automaticConnectedAnchor",onChange(o,e,t){if(t){const i=o.engineObject.connectedAnchor;o.connectedAnchor={x:i.x,y:i.y,z:i.z}}}})],v.prototype,"automaticConnectedAnchor",2);T([y(),m({label:r("physics.joint.connected-anchor.title"),type:h.Vector3,bindPath:"connectedAnchor",when:o=>!o.automaticConnectedAnchor})],v.prototype,"connectedAnchor",2);T([y(),m({label:r("physics.joint.break-force.title"),type:h.Number,bindPath:"breakForce"})],v.prototype,"breakForce",2);T([y(),m({label:r("physics.joint.break-torque.title"),type:h.Number,bindPath:"breakTorque"})],v.prototype,"breakTorque",2);T([y(),m({label:r("physics.joint.mass-scale.title"),type:h.Number,bindPath:"massScale"})],v.prototype,"massScale",2);T([y(),m({label:r("physics.joint.connected-mass-scale.title"),type:h.Number,bindPath:"connectedMassScale"})],v.prototype,"connectedMassScale",2);var We=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,ke=(o,e,t,i)=>{for(var n=i>1?void 0:i?Qe(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&We(e,t,n),n};let oe=class extends v{constructor(o,e){super(o,e)}};oe=ke([F({type:"FixedJoint",componentsMenu:{label:r("component.physics.fixed-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],oe);const et=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useLimits,c=t.useSpring,f=t[n],u=f.props,{t:b}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:b(s),info:b(a),children:[l.jsx(P,{label:b("physics.joint-limits.min"),value:u.min,onChange:x=>{u.max<x&&(u.max=x),u.min=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.max"),value:u.max,onChange:x=>{x<u.min&&(x=u.min),u.max=x,i(n,f)}}),c?l.jsxs(l.Fragment,{children:[l.jsx(P,{label:b("physics.joint-limits.stiffness"),value:u.stiffness,onChange:x=>{u.stiffness=x,i(n,f)}}),l.jsx(P,{label:b("physics.joint-limits.damping"),value:u.damping,onChange:x=>{u.damping=x,i(n,f)}})]}):l.jsx(P,{label:b("physics.joint-limits.contact-distance"),value:u.contactDistance,onChange:x=>{u.contactDistance=x,i(n,f)}})]}):null})}),tt=j(o=>{const{inspectorConfig:e,model:t,onModelChange:i}=o,{property:n,label:s,info:a}=e,d=t.useMotor,c=t[n],f=c.props,{t:u}=z();return l.jsx(l.Fragment,{children:d?l.jsxs(le,{label:u(s),info:u(a),children:[l.jsx(P,{label:u("physics.joint-motor.target-velocity"),value:f.targetVelocity,onChange:b=>{f.targetVelocity=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.force-limit"),value:f.forceLimit,onChange:b=>{f.forceLimit=b,i(n,c)}}),l.jsx(P,{label:u("physics.joint-motor.gear-ratio"),value:f.gearRatio,onChange:b=>{f.gearRatio=b,i(n,c)}}),l.jsx(re,{label:u("physics.joint-motor.free-spin"),value:f.freeSpin,onChange:b=>{f.freeSpin=b,i(n,c)}})]}):null})});var it=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var n=i>1?void 0:i?ot(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&it(e,t,n),n};let D=class extends v{constructor(e,t){super(e,t);p(this,"axis",{x:1,y:0,z:0});p(this,"useLimits",!1);p(this,"useSpring",!1);p(this,"limits",{class:"JointLimits",props:{max:0,min:0,contactDistance:-1,stiffness:0,damping:0}});p(this,"useMotor",!1);p(this,"motor",{class:"JointMotor",props:{targetVelocity:0,forceLimit:Number.MAX_VALUE,gearRatio:1,freeSpin:!1}})}async applyBoundPathChange(e,t,i){if(e==="limits"){const n=this._buildLimitsFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}if(e==="motor"){const n=this._buildMotorFromModel(i);if(!n)return;await super.applyBoundPathChange(e,t,n);return}await super.applyBoundPathChange(e,t,i)}_buildLimitsFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new be;return i.max=t.max,i.min=t.min,i.contactDistance=t.contactDistance,i.stiffness=t.stiffness,i.damping=t.damping,i}_buildMotorFromModel(e){const t=e==null?void 0:e.props;if(!t)return null;const i=new ge;return i.targetVelocity=t.targetVelocity,i.forceLimit=t.forceLimit,i.gearRatio=t.gearRatio,i.freeSpin=t.freeSpin,i}};A([y(),m({label:r("physics.hinge-joint.axis.title"),type:h.Vector3,bindPath:"axis"})],D.prototype,"axis",2);A([y(),m({label:r("physics.hinge-joint.use-limits.title"),type:h.Boolean,bindPath:"useLimits"})],D.prototype,"useLimits",2);A([y(),m({label:r("physics.hinge-joint.use-spring.title"),type:h.Boolean,bindPath:"useSpring"})],D.prototype,"useSpring",2);A([y(),m({label:r("physics.hinge-joint.limits.title"),customComponent:et,bindPath:"limits"})],D.prototype,"limits",2);A([y(),m({label:r("physics.hinge-joint.use-motor.title"),type:h.Boolean,bindPath:"useMotor"})],D.prototype,"useMotor",2);A([y(),m({label:r("physics.hinge-joint.motor.title"),customComponent:tt,bindPath:"motor"})],D.prototype,"motor",2);D=A([F({type:"HingeJoint",componentsMenu:{label:r("component.physics.hinge-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],D);var nt=Object.defineProperty,st=Object.getOwnPropertyDescriptor,V=(o,e,t,i)=>{for(var n=i>1?void 0:i?st(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&nt(e,t,n),n};let w=class extends v{constructor(e,t){super(e,t);p(this,"spring",10);p(this,"damper",.2);p(this,"minDistance",0);p(this,"maxDistance",0);p(this,"tolerance",.025)}};V([y(),m({label:r("physics.spring-joint.spring.title"),type:h.Number,bindPath:"spring"})],w.prototype,"spring",2);V([y(),m({label:r("physics.spring-joint.damper.title"),type:h.Number,bindPath:"damper"})],w.prototype,"damper",2);V([y(),m({label:r("physics.spring-joint.min-distance.title"),type:h.Number,bindPath:"minDistance"})],w.prototype,"minDistance",2);V([y(),m({label:r("physics.spring-joint.max-distance.title"),type:h.Number,bindPath:"maxDistance"})],w.prototype,"maxDistance",2);V([y(),m({label:r("physics.spring-joint.tolerance.title"),type:h.Number,bindPath:"tolerance"})],w.prototype,"tolerance",2);w=V([F({type:"SpringJoint",componentsMenu:{label:r("component.physics.spring-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:Z.AutoAdd}})],w);class rt extends Ce{constructor(){super(...arguments);p(this,"_isPlaying",!1)}onPlay(t){this._isPlaying=t,this._toggleAll(t)}onAddComponent(t){!this._isPlaying&&(t instanceof Q||t instanceof K)&&(t.enabled=!1)}_toggleAll(t){var a;const i=(a=this.engine.sceneManager.activeScene)==null?void 0:a.rootEntities;if(!i)return;const n=[],s=[];i.forEach(d=>{d.getComponentsIncludeChildren(Q,n),d.getComponentsIncludeChildren(K,s)}),n.forEach(d=>{d.enabled=t}),s.forEach(d=>{d.enabled=t})}}var at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ct=(o,e,t,i)=>{for(var n=i>1?void 0:i?lt(e,t):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&at(e,t,n),n};let ne=class{constructor(){p(this,"script")}init(){this.script=xe.addScript(rt)}};ne=ct([Se({type:"physicsStore"})],ne);export{M as C,g as D,oe as F,D as H,ne as P,te as S,w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty;var c=(o,t,e)=>t in o?m(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var a=(o,t,e)=>(c(o,typeof t!="symbol"?t+"":t,e),e);import{s as f,p as h,C as g}from"./index-
|
|
1
|
+
var m=Object.defineProperty;var c=(o,t,e)=>t in o?m(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var a=(o,t,e)=>(c(o,typeof t!="symbol"?t+"":t,e),e);import{s as f,p as h,C as g}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import{c as b}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{L as u}from"./LightBaseComponent-d651a276.js";var P=Object.defineProperty,d=Object.getOwnPropertyDescriptor,l=(o,t,e,p)=>{for(var n=p>1?void 0:p?d(t,e):t,i=o.length-1,r;i>=0;i--)(r=o[i])&&(n=(p?r(t,e,n):r(n))||n);return p&&n&&P(t,e,n),n};let s=class extends u{constructor(t,e){super(t,e);a(this,"distance",60)}};l([f(),h({type:g.Number,bindPath:"distance",label:"light.point.distance.label",info:"light.point.distance.info"})],s.prototype,"distance",2);s=l([b({type:"PointLight",componentsMenu:{group:"light",label:"component.light.point.title"}})],s);export{s as PointLightComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var R=Object.defineProperty;var $=(e,s,o)=>s in e?R(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o;var x=(e,s,o)=>($(e,typeof s!="symbol"?s+"":s,o),o);import{aM as _,av as l,aP as q,e as u,aw as G,aI as w,de as J,aL as A,aJ as N,df as z,dg as Q,dh as W,di as H,bm as K,dj as U,dk as X,dl as Y,bA as Z,q as ee,dm as te,dn as se,dp as oe,bk as re,t as ne,dq as ae,dr as ce,ds as le,cm as ie,dt as fe,du as pe,bI as me,E as ue,a as T,s as C,p as k,C as D,l as be,g as de}from"./index-
|
|
1
|
+
var R=Object.defineProperty;var $=(e,s,o)=>s in e?R(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o;var x=(e,s,o)=>($(e,typeof s!="symbol"?s+"":s,o),o);import{aM as _,av as l,aP as q,e as u,aw as G,aI as w,de as J,aL as A,aJ as N,df as z,dg as Q,dh as W,di as H,bm as K,dj as U,dk as X,dl as Y,bA as Z,q as ee,dm as te,dn as se,dp as oe,bk as re,t as ne,dq as ae,dr as ce,ds as le,cm as ie,dt as fe,du as pe,bI as me,E as ue,a as T,s as C,p as k,C as D,l as be,g as de}from"./index-c3dec278.js";import{u as he}from"./index-cdbb2f4d.js";import{c as ye}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{I as ge}from"./IconPlus-def01e2b.js";import{D as Pe,M as je}from"./Menu-c8e6194b.js";import{c as B}from"./createReactComponent-58d9f0dd.js";import{A as xe,a as Ee}from"./Accordion-2cd014f1.js";/**
|
|
2
2
|
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license.
|