@galacean/cli 2.0.0-alpha.29 → 2.0.0-alpha.30
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 +192793 -186137
- package/dist/preview-client/_static/{Accordion-6f002a96.js → Accordion-6346d8c5.js} +1 -1
- package/dist/preview-client/_static/{AmbientLightAsset-57a59fc2.js → AmbientLightAsset-ded8af87.js} +1 -1
- package/dist/preview-client/_static/{AnimationClipAsset-0a1f63eb.js → AnimationClipAsset-a767bb7a.js} +1 -1
- package/dist/preview-client/_static/{AnimatorControllerAsset-9192e596.js → AnimatorControllerAsset-c04c5158.js} +1 -1
- package/dist/preview-client/_static/{AnimatorStore-484b10cf.js → AnimatorStore-fd28fd44.js} +1 -1
- package/dist/preview-client/_static/{AssetViewer-9f395efb.js → AssetViewer-f505fb55.js} +1 -1
- package/dist/preview-client/_static/{AudioAsset-0ea4ba7b.js → AudioAsset-8b8ab944.js} +1 -1
- package/dist/preview-client/_static/{AudioComponent-9bf5944c.js → AudioComponent-4f62f1d6.js} +1 -1
- package/dist/preview-client/_static/{Callout-45631a14.js → Callout-7d87c30e.js} +1 -1
- package/dist/preview-client/_static/{CameraComponent-039457d1.js → CameraComponent-04ebed15.js} +1 -1
- package/dist/preview-client/_static/{Component-c3c0c167.js → Component-85241517.js} +1 -1
- package/dist/preview-client/_static/{DirectLight-7b1f4b9f.js → DirectLight-a2b904ed.js} +1 -1
- package/dist/preview-client/_static/{FontAsset-10273d05.js → FontAsset-5cd70e43.js} +1 -1
- package/dist/preview-client/_static/{FormItemArray-9d4196d8.js → FormItemArray-a06224b4.js} +1 -1
- package/dist/preview-client/_static/{GlTFAsset-917bf1ee.js → GlTFAsset-34fdaded.js} +1 -1
- package/dist/preview-client/_static/{IconPlus-2bfc60da.js → IconPlus-7690a910.js} +1 -1
- package/dist/preview-client/_static/{IconPointFilled-192e99c9.js → IconPointFilled-181a0586.js} +1 -1
- package/dist/preview-client/_static/{LightBaseComponent-948d3192.js → LightBaseComponent-6817bd8c.js} +1 -1
- package/dist/preview-client/_static/{LottieAnimationComponent-da226765.js → LottieAnimationComponent-fb9564f9.js} +1 -1
- package/dist/preview-client/_static/{MarkdownAsset-602f93bf.js → MarkdownAsset-ede9d841.js} +1 -1
- package/dist/preview-client/_static/{MaterialAsset-aa93db51.js → MaterialAsset-010030a2.js} +1 -1
- package/dist/preview-client/_static/{MaterialInspector-45e208c7.js → MaterialInspector-ebbe39d5.js} +1 -1
- package/dist/preview-client/_static/{Menu-beacc39d.js → Menu-7006a0c9.js} +1 -1
- package/dist/preview-client/_static/{MeshAsset-585f4b18.js → MeshAsset-3032a2d3.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererBaseComponent-0bc9f5b3.js → MeshRendererBaseComponent-ea33dbe8.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererComponent-84208d23.js → MeshRendererComponent-eaf512af.js} +1 -1
- package/dist/preview-client/_static/{MeshThumbnail-9bbe01dc.js → MeshThumbnail-3bb8bccf.js} +1 -1
- package/dist/preview-client/_static/ParticleRendererComponent-eb636961.js +31 -0
- package/dist/preview-client/_static/{PhysicsMaterialAsset-2dd013f8.js → PhysicsMaterialAsset-a768f5b6.js} +1 -1
- package/dist/preview-client/_static/PhysicsStore-8bca890a.js +1 -0
- package/dist/preview-client/_static/{PointLight-d9ace100.js → PointLight-1da0b361.js} +1 -1
- package/dist/preview-client/_static/{PostProcessComponent-2b5255d9.js → PostProcessComponent-366ce132.js} +1 -1
- package/dist/preview-client/_static/{PrefabAsset-8c923465.js → PrefabAsset-9e17aab2.js} +1 -1
- package/dist/preview-client/_static/{PrimitiveMesh-fde624a6.js → PrimitiveMesh-81a302d9.js} +1 -1
- package/dist/preview-client/_static/{ReferencedMaterial-890492a2.js → ReferencedMaterial-240e1be6.js} +1 -1
- package/dist/preview-client/_static/{RenderTargetAsset-bf38a725.js → RenderTargetAsset-81649762.js} +1 -1
- package/dist/preview-client/_static/{SceneAsset-7a9dbdd8.js → SceneAsset-68286235.js} +1 -1
- package/dist/preview-client/_static/{ShaderAsset-2f2c1e95.js → ShaderAsset-b2ea36b6.js} +25 -25
- package/dist/preview-client/_static/{ShaderChunkAsset-a3ff3959.js → ShaderChunkAsset-e32e6108.js} +1 -1
- package/dist/preview-client/_static/{ShaderUIScriptAsset-d3a2d680.js → ShaderUIScriptAsset-4adc4d41.js} +1 -1
- package/dist/preview-client/_static/{SkinnedMeshRendererComponent-96740600.js → SkinnedMeshRendererComponent-c0f2037a.js} +1 -1
- package/dist/preview-client/_static/{SpineAnimationComponent-3d4eec48.js → SpineAnimationComponent-ec1ed804.js} +1 -1
- package/dist/preview-client/_static/{SpineSkeletonDataAsset-a8598103.js → SpineSkeletonDataAsset-0fdb1ffc.js} +1 -1
- package/dist/preview-client/_static/{SpotLight-680a6e17.js → SpotLight-7da01a5f.js} +1 -1
- package/dist/preview-client/_static/{SpriteBaseComponent-96a500d7.js → SpriteBaseComponent-5027461c.js} +1 -1
- package/dist/preview-client/_static/{SpriteMaskComponent-58c35ea2.js → SpriteMaskComponent-ea250ae6.js} +1 -1
- package/dist/preview-client/_static/{SpriteRendererComponent-5c89f7dd.js → SpriteRendererComponent-fc459130.js} +1 -1
- package/dist/preview-client/_static/{TextBaseComponent-248ea222.js → TextBaseComponent-269e86ed.js} +1 -1
- package/dist/preview-client/_static/{TextRendererComponent-78458825.js → TextRendererComponent-e1a70d05.js} +1 -1
- package/dist/preview-client/_static/{TextureAsset-bf69040b.js → TextureAsset-adf746d9.js} +1 -1
- package/dist/preview-client/_static/{Tooltip-0268ffac.js → Tooltip-c84e8c00.js} +1 -1
- package/dist/preview-client/_static/{TrailRendererComponent-838e0118.js → TrailRendererComponent-7c1adc57.js} +1 -1
- package/dist/preview-client/_static/{TransformBaseComponent-c92aa259.js → TransformBaseComponent-bc3d99f0.js} +1 -1
- package/dist/preview-client/_static/{TransformComponent-d28b4035.js → TransformComponent-828e97ca.js} +1 -1
- package/dist/preview-client/_static/{XRReferenceImageAsset-16071f5c.js → XRReferenceImageAsset-699f6a74.js} +1 -1
- package/dist/preview-client/_static/{audio-1d573775.js → audio-5b6bbad7.js} +1 -1
- package/dist/preview-client/_static/{createOnModelChange-38471bb6.js → createOnModelChange-f0aaf591.js} +1 -1
- package/dist/preview-client/_static/{createReactComponent-3e49f864.js → createReactComponent-0c5ada83.js} +1 -1
- package/dist/preview-client/_static/{index-2f54d4c9.js → index-066cf34f.js} +1 -1
- package/dist/preview-client/_static/{index-4084db44.js → index-07a70c10.js} +1 -1
- package/dist/preview-client/_static/index-21ffc50d.js +1 -0
- package/dist/preview-client/_static/{index-65c6af4a.js → index-4145c87e.js} +3 -3
- package/dist/preview-client/_static/index-492bd067.js +1 -0
- package/dist/preview-client/_static/index-49a5902b.js +1 -0
- package/dist/preview-client/_static/index-6a2d3d63.js +1 -0
- package/dist/preview-client/_static/{index-8a22fe59.js → index-828538e1.js} +1 -1
- package/dist/preview-client/_static/{index-ce381b62.js → index-89133895.js} +2 -2
- package/dist/preview-client/_static/index-895723b4.js +1 -0
- package/dist/preview-client/_static/{index-1fa3ba70.js → index-981e5626.js} +1 -1
- package/dist/preview-client/_static/index-b154ff9d.js +1 -0
- package/dist/preview-client/_static/{index-9e3daa94.js → index-b4b2d2e5.js} +1 -1
- package/dist/preview-client/_static/{index-d497fb6d.js → index-eeedc550.js} +1072 -651
- package/dist/preview-client/_static/index-f145c261.js +1 -0
- package/dist/preview-client/_static/{index-68806c86.js → index-f655a65a.js} +1 -1
- package/dist/preview-client/_static/{ktx2-encoder-772f6c33.js → ktx2-encoder-2883b55c.js} +1 -1
- package/dist/preview-client/_static/{module-1470d524.js → module-11aabe24.js} +1 -1
- package/dist/preview-client/_static/{module-136992e3.js → module-ace60695.js} +1 -1
- package/dist/preview-client/_static/{module-77c2ea8c.js → module-be69621d.js} +1 -1
- package/dist/preview-client/_static/postmen-fe9eecc4.js +2 -0
- package/dist/preview-client/_static/{shader-data-utils-e38a959d.js → shader-data-utils-c00c9d18.js} +1 -1
- package/dist/preview-client/index.html +1 -1
- package/dist/types/tsconfig.exec-base.json +20 -0
- package/dist/types/typed-exec-api.d.ts +487 -0
- package/package.json +4 -2
- package/dist/preview-client/_static/ParticleRendererComponent-f3ac8d1b.js +0 -26
- package/dist/preview-client/_static/PhysicsStore-fcb01282.js +0 -1
- package/dist/preview-client/_static/index-0a57ae09.js +0 -1
- package/dist/preview-client/_static/index-1d0ae2e4.js +0 -1
- package/dist/preview-client/_static/index-2c567b8d.js +0 -1
- package/dist/preview-client/_static/index-5c27dafa.js +0 -1
- package/dist/preview-client/_static/index-bdda02cf.js +0 -1
- package/dist/preview-client/_static/index-c88f78ce.js +0 -1
- package/dist/preview-client/_static/index-e4fb05d8.js +0 -1
- package/dist/preview-client/_static/postmen-0413c689.js +0 -2
package/dist/preview-client/_static/{MaterialInspector-45e208c7.js → MaterialInspector-ebbe39d5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var L=(d,e,t)=>e in d?E(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var j=(d,e,t)=>(L(d,typeof e!="symbol"?e+"":e,t),t);import{aH as x,aQ as N,aJ as S,aN as $,aL as s,aI as M,C as n,bA as V,aw as F,bB as B,aP as f,aK as A,bC as T,e as W}from"./index-
|
|
1
|
+
var E=Object.defineProperty;var L=(d,e,t)=>e in d?E(d,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[e]=t;var j=(d,e,t)=>(L(d,typeof e!="symbol"?e+"":e,t),t);import{aH as x,aQ as N,aJ as S,aN as $,aL as s,aI as M,C as n,bA as V,aw as F,bB as B,aP as f,aK as A,bC as T,e as W}from"./index-eeedc550.js";import{u as z}from"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{I as O}from"./IconPointFilled-181a0586.js";const H=x(O,{marginRight:"-$1",variants:{checked:{true:{color:"$green10"}}}}),J=x(N,{width:"100%",border:"none",position:"relative",whiteSpace:"pre-wrap",boxShadow:"$2","& > svg":{marginRight:"$1"}});function b(d){return S(function(t){const{inspectorConfig:r,macroConfig:c,...p}=t,{model:i}=p;let{models:g}=p;const{checked:u,onSwitch:h}=c,{type:m,...a}=r,[o,l]=$.useState(u);$.useEffect(()=>{l(u)},[u]),g=g||[i];const R=()=>{const I=!o;if(h)for(const k of g)h(I,k);l(I)},v=r.label;return s.jsxs(M,{direction:"column",fullWidth:!0,children:[m!==n.Null&&o&&V.createElement(d,{...p,inspectorConfig:{...a,type:m}}),s.jsx(F,{label:o?"":v,children:s.jsx(J,{size:"sm",variant:"subtle",startSlot:s.jsx(H,{size:"12px",checked:o}),onClick:R,children:o?"Enabled ":"Disabled"})})]})})}const K=x(M),Q=x(B,{backgroundColor:"$gray1",height:"2px !important"});function U(d){const{inspectorConfig:e,models:t,onModelChange:r,model:c,macroConfig:p}=d,{type:i,property:g,info:u}=e,{t:h}=A(),m=!c&&t&&t.length>1;if(m&&!t.find(y=>e.when?e.when(y):!0)||e.when&&!e.when(c))return null;const a=p?w.getRegisteredMacroComponent(i):w.getRegisteredComponent(i);if(!a)return console.warn(`缺少${i}类型的组件`),null;let o=e.disabled;!m&&c.getEditable&&(o=c.getEditable(e.property)===!1);const l=typeof e.label=="string"?h(e.label):e.label;let R=e.options;R&&(R=R.map(y=>({label:typeof y.label=="string"?h(y.label):y.label,value:y.value})));const v={...e,label:l,info:u,options:R,disabled:o},{triggerAfterInit:I,customComponent:k,...P}=v;return s.jsx(a,{inspectorConfig:P,macroConfig:p,models:t,model:c,onModelChange:r},g)}const C=class C{static registerComponent(e,t){this.components[e]=t}static getRegisteredComponent(e){return C.components[e]}static getRegisteredMacroComponent(e){return C.macroComponents[e]}};j(C,"components",f.getRegisteredComponents()),j(C,"macroComponents",{[n.Color]:b(f.getRegisteredComponent(n.Color)),[n.Vector4]:b(f.getRegisteredComponent(n.Vector4)),[n.Vector3]:b(f.getRegisteredComponent(n.Vector3)),[n.Vector2]:b(f.getRegisteredComponent(n.Vector2)),[n.Number]:b(f.getRegisteredComponent(n.Number)),[n.AssetPicker]:b(f.getRegisteredComponent(n.AssetPicker)),[n.Boolean]:b(f.getRegisteredComponent(n.Boolean)),[n.Null]:b(f.getRegisteredComponent(n.Null))}),j(C,"Item",S(U)),j(C,"List",S(function(t){const{configs:r,models:c,css:p,onModelChange:i,model:g,children:u,fullWidth:h=!1,withSeparator:m}=t;return r!=null&&r.length&&r.sort((a,o)=>{const l=a.priority??0;return(o.priority??0)-l}),r?s.jsxs(K,{css:p,className:"shader-inspector-form",fullWidth:h,children:[r.map(a=>s.jsxs($.Fragment,{children:[s.jsx(C.Item,{inspectorConfig:a,macroConfig:a.macroConfig,model:g,models:c,onModelChange:i},a.property),m&&s.jsx(Q,{})]},a.property)),u]}):null}));let w=C;const q=x("div",{backgroundColor:"$appBg",width:"100%"}),G=x("div",{backgroundColor:"$panelBg",borderRadius:"0 0 $2 $2",overflow:"hidden",paddingBottom:"$1"}),X=x("div",{width:"100%",backgroundColor:"$gray3",paddingBottom:"$0_5"}),Y=x(B,{backgroundColor:"$appBg",height:"2px !important"}),Z=d=>{var a;const{asset:e}=d,t=e.formConfig,{assetStore:r,inspectorFacade:c}=z(),{i18n:p}=A(),i=r.getAsset(e.shaderRef.refId),g=i==null?void 0:i.name,u=Object.values(r.assets).filter(o=>o.meta.type==="Shader"&&o.meta.utility!=="error"),h=()=>{r.selectAsset(e.shaderRef.refId)},m=(o,l)=>{c.assetChange(e.id,o,l)};if(t.root)for(const o of t.root){const l=o.comments;l&&(o.info=l[p.language]??l.default??void 0)}return s.jsxs(q,{children:[s.jsx(X,{children:s.jsx(T,{label:W("asset.shader.title"),assets:u,disabled:!!(i!=null&&i.isSubAsset)||e.isSubAsset||!e.getEditable(),value:g,dropLayer:0,onSelect:async o=>{await e.bindShaderAsset(o,e._getMainData()),await c.assetChanges(e.id,{shaderRef:e.shaderRef,shader:e.shader})},onLocate:h})}),((a=t.root)==null?void 0:a.length)>0&&s.jsx(G,{children:s.jsx(w.List,{model:e,onModelChange:m,configs:t.root,withSeparator:!1})}),s.jsx(Y,{}),s.jsx(w.List,{model:e,onModelChange:m,configs:Object.values(t.groups)})]})},ne=S(Z);export{ne as M};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f4 as _r,av as c,aH as P,bE as a,
|
|
1
|
+
import{f4 as _r,av as c,aH as P,bE as a,gG as dt,gH as bc,b8 as pe,gI as Mc,gJ as wc,gK as Sc,gL as Rc,gM as yc,gN as Ec,gO as Pc,gP as _c,gQ as Ic,gR as Ac,gS as F,d6 as me,bb as Ne,b9 as $e,be as ee,gT as sn,gU as Ir,gV as Tc,dc as cn,gW as Nc,gX as $c,ba as U,bd as G,d7 as Ar,d8 as bt,gY as Tr,gZ as Nr,g_ as $r,g$ as J,h0 as Or,h1 as jr,h2 as Dr,h3 as kr,h4 as Lr,h5 as Fr,b5 as un,b6 as ln,d9 as Mt,h6 as Oe,da as Gr,db as ge,bc as R,h7 as dn,dd as Ur,h8 as fn,de as Kr,h9 as Br,df as wt,ha as Oc,hb as Nt,hc as $t,hd as Ot,he as Ee,hf as er,hg as jt,hh as Dt,hi as kt,hj as Lt,hk as Ft,hl as tr,bj as jc,hm as Dc}from"./index-eeedc550.js";/**
|
|
2
2
|
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var T=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(T(n,typeof e!="symbol"?e+"":e,t),t);import{bQ as v,bR as U,bx as g,a4 as i,bS as u,aL as c,aO as b,y as f,bT as p,j as x,n as C,e as V,q as m}from"./index-
|
|
1
|
+
var E=Object.defineProperty;var T=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(T(n,typeof e!="symbol"?e+"":e,t),t);import{bQ as v,bR as U,bx as g,a4 as i,bS as u,aL as c,aO as b,y as f,bT as p,j as x,n as C,e as V,q as m}from"./index-eeedc550.js";import"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{F as d}from"./index-f655a65a.js";import{M}from"./MeshThumbnail-3bb8bccf.js";import{A as R}from"./AssetViewer-f505fb55.js";import{e as A}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";class O{static createMesh(e,t){const s=new v(e);return O.setMeshData(s,t),s}static setMeshData(e,t){var s,r;return e.setPositions([...t.positions]),e.setNormals(t.normals),e.setUVs(t.uvs),t.uv1&&e.setUVs(t.uv1,1),t.uv2&&e.setUVs(t.uv2,2),t.uv3&&e.setUVs(t.uv3,3),t.uv4&&e.setUVs(t.uv4,4),t.uv5&&e.setUVs(t.uv5,5),t.uv6&&e.setUVs(t.uv6,6),t.uv7&&e.setUVs(t.uv7,7),t.bounds?(e.bounds.min.copyFrom(t.bounds.min),e.bounds.max.copyFrom(t.bounds.max)):O.calculateBounds(t.positions,e.bounds),(s=t.blendShapes)==null||s.forEach(o=>{const l=new U(o.name);o.frames.forEach(a=>{l.addFrame(a.weight,a.positions,a.normals,a.uvs)}),e.addBlendShape(l)}),(r=t.subMeshes)==null||r.forEach(o=>{e.addSubMesh(o)}),t.indices&&(t.positions.length<=65535?e.setIndices(new Uint16Array(t.indices)):e.setIndices(new Uint32Array(t.indices))),e.uploadData(!1),e}static calculateBounds(e,t){const{min:s,max:r}=t,o=e.length;s.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<o;l++){const a=e[l];s.x=Math.min(a.x,s.x),s.y=Math.min(a.y,s.y),s.z=Math.min(a.z,s.z),r.x=Math.max(a.x,r.x),r.y=Math.max(a.y,r.y),r.z=Math.max(a.z,r.z)}}}class N extends g{constructor(e,t){super(e),this.meshData=t}restoreContent(){O.setMeshData(this.resource,this.meshData)}}var y=(n=>(n.POSITION="Position",n.NORMAL="Normal",n.COLOR_0="Color",n.TANGENT="Tangent",n.WEIGHTS_0="BoneWeight",n.JOINTS_0="BoneIndex",n.TEXCOORD_0="UV",n.TEXCOORD_1="UV1",n.TEXCOORD_2="UV2",n.TEXCOORD_3="UV3",n.TEXCOORD_4="UV4",n.TEXCOORD_5="UV5",n.TEXCOORD_6="UV6",n.TEXCOORD_7="UV7",n))(y||{});const L=["POSITION","NORMAL","COLOR_0","TANGENT","WEIGHTS_0","JOINTS_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","TEXCOORD_3","TEXCOORD_4","TEXCOORD_5","TEXCOORD_6","TEXCOORD_7"],X={[i.Float]:"4 bytes",[i.Vector2]:"8 bytes",[i.Vector3]:"12 bytes",[i.Vector4]:"16 bytes",[i.Byte4]:"4 bytes",[i.UByte4]:"4 bytes",[i.NormalizedByte4]:"4 bytes",[i.NormalizedUByte4]:"4 bytes",[i.NormalizedShort2]:"4 bytes",[i.NormalizedShort4]:"8 bytes",[i.Short2]:"4 bytes",[i.UShort2]:"4 bytes",[i.NormalizedUShort2]:"4 bytes",[i.Short4]:"8 bytes",[i.UShort4]:"8 bytes",[i.NormalizedUShort4]:"8 bytes"};u.Triangles+"",u.TriangleStrip+"",u.TriangleFan+"",u.LineLoop+"",u.LineStrip+"",u.Lines+"",u.Points+"";function w(n){switch(n.topology){case u.Triangles:return`${n.count/3} triangles`;case u.TriangleFan:case u.TriangleStrip:return`${n.count-2} triangles`;case u.Lines:return`${n.count/2} lines`;case u.LineStrip:return`${n.count-1} lines`;case u.LineLoop:return`${n.count} lines`;case u.Points:return`${n.count} points`}}function S(n){if(n instanceof Uint8Array)return"Uint8";if(n instanceof Uint16Array)return"Uint16";if(n instanceof Uint32Array)return"Uint32"}const I=n=>{const e=n.asset.engineObject,t=e.vertexCount,s=e.getIndices(),r=e.subMeshes;return c.jsxs(c.Fragment,{children:[c.jsx(b,{title:`Vertices: ${t}`,defaultOpen:!0,children:L.map(o=>e.vertexElements.find(l=>l.semantic===o)).filter(o=>o!=null).map(o=>c.jsx(d,{label:y[o.attribute],value:`${i[o.format]} (${X[o.format]})`},o.attribute))}),s?c.jsx(b,{title:`Indices: ${s.length}`,defaultOpen:!0,children:c.jsx(d,{label:"Format",value:S(s)})}):null,c.jsx(b,{title:`SubMesh: ${r.length}`,defaultOpen:!0,children:r.map((o,l)=>c.jsx(d,{label:`# ${l}`,value:w(o)},l))})]})};class j extends R{setViewAsset(e,t){const s=t.createChild("mesh_entity"),r=s.addComponent(f);r.mesh=e.engineObject;const o=new p(e.engine);o.baseColor.set(.5,.5,.5,1),r.setMaterial(o),this._entity=s}}var B=Object.defineProperty,F=Object.getOwnPropertyDescriptor,z=(n,e,t,s)=>{for(var r=s>1?void 0:s?F(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&B(e,t,r),r};let h=class extends x{constructor(e){super(e);_(this,"meshData",null)}beforeDelete(){return null}afterDelete(){return null}async initByMain(e){const{engine:t}=this,s=JSON.parse(await e.text());this.meshData=s;const r=new v(t);O.setMeshData(r,s),t.resourceManager.addContentRestorer(new N(r,s)),this.bindEngineObject(r),this._releaseMeshCache()}initByEngineObject(e){this.bindEngineObject(e),this._name=e.name,this.meshData={positions:[],subMeshes:[]}}_releaseMeshCache(){const e=this.engineObject;e._verticesUint8=null,e._indices=null,e._verticesFloat32=null,e._positions=null,e._tangents=null,e._normals=null,e._colors=null,e._uv=null,e._uv1=null,e._uv2=null,e._uv3=null,e._uv4=null,e._uv5=null,e._uv6=null,e._uv7=null}};h=z([C({type:"Mesh",label:V("asset.mesh.title"),icon:{},loaderType:"Mesh",extname:"mesh",customInspector:I,viewer:j,thumbnail:M,dragLayer:m.Mesh,async bundle({content:n}){const e=JSON.parse(await n.text()),t=A(e,{type:"Mesh",name:"mesh"});return{content:new Blob([t])}}})],h);export{h as MeshAsset};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var c=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>(c(r,typeof e!="symbol"?e+"":e,t),t);import{p as n,C as d,s as p,f as v,aE as P,E as b,v as y,x as u,aC as w}from"./index-
|
|
1
|
+
var f=Object.defineProperty;var c=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>(c(r,typeof e!="symbol"?e+"":e,t),t);import{p as n,C as d,s as p,f as v,aE as P,E as b,v as y,x as u,aC as w}from"./index-eeedc550.js";import"./index-828538e1.js";import"./postmen-fe9eecc4.js";var M=Object.defineProperty,O=Object.getOwnPropertyDescriptor,i=(r,e,t,l)=>{for(var a=l>1?void 0:l?O(e,t):e,h=r.length-1,m;h>=0;h--)(m=r[h])&&(a=(l?m(e,t,a):m(a))||a);return l&&a&&M(e,t,a),a};class o extends b{constructor(){super(...arguments);s(this,"mesh",null);s(this,"material",{refId:"0000200"});s(this,"receiveShadows",!0);s(this,"castShadows",!0);s(this,"priority",0);s(this,"materialOpen",!1)}setMaterialOpen(t){this.materialOpen=t}}i([n({type:d.AssetPicker,assetType:["Mesh"],label:"mesh-renderer.mesh.title",info:"mesh-renderer.mesh.info",bindPath:"mesh"}),p()],o.prototype,"mesh",2);i([n({type:d.AssetPicker,assetType:"Material",label:"mesh-renderer.material.title",info:"mesh-renderer.material.info",customFilter:r=>{var e;return((e=r.engineObject.shader)==null?void 0:e.name)!=="Effect/Particle"}}),v({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:P.ReferResource,getEngineValue:r=>r.getMaterial()}),p()],o.prototype,"material",2);i([n({label:"mesh-renderer.receive-shadows.title",info:"mesh-renderer.receive-shadows.info",bindPath:"receiveShadows"}),y(),p()],o.prototype,"receiveShadows",2);i([n({label:"mesh-renderer.cast-shadows.title",info:"mesh-renderer.cast-shadows.info",bindPath:"castShadows"}),y(),p()],o.prototype,"castShadows",2);i([n({label:"mesh-renderer.priority.title",info:"mesh-renderer.priority.info",bindPath:"priority"}),p()],o.prototype,"priority",2);i([u],o.prototype,"materialOpen",2);i([w],o.prototype,"setMaterialOpen",1);export{o as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aJ as l,aN as c,aL as m,aP as f,p as h}from"./index-
|
|
1
|
+
import{aJ as l,aN as c,aL as m,aP as f,p as h}from"./index-eeedc550.js";import{u as d}from"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{c as u}from"./Component-85241517.js";import{c as M}from"./createOnModelChange-f0aaf591.js";import{R}from"./ReferencedMaterial-240e1be6.js";import{M as v}from"./MeshRendererBaseComponent-ea33dbe8.js";import"./MaterialInspector-ebbe39d5.js";import"./IconPointFilled-181a0586.js";import"./createReactComponent-0c5ada83.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-eeedc550.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,31 @@
|
|
|
1
|
+
var ya=Object.defineProperty;var ba=(t,e,a)=>e in t?ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var M=(t,e,a)=>(ba(t,typeof e!="symbol"?e+"":e,a),a);import{bD as Xe,b9 as Fe,av as k,aw as ne,b8 as $e,cf as Oe,bW as Me,bX as Q,cg as he,ce as fe,e_ as xe,aJ as X,aN as N,aL as p,aP as va,aK as Z,bn as Le,cq as oe,bl as vt,fe as Ve,ff as Se,bC as ga,b_ as xa,bL as Y,fg as Sa,bG as Zt,fh as Ma,fi as Pa,fj as Ea,fk as Ca,fl as za,fm as F,aH as Ce,fn as qt,aI as _e,aM as ce,fo as Gt,fp as wa,fq as ee,dt as ja,cc as Pe,cd as Ee,c9 as le,ci as Dt,b4 as Te,cj as Lt,fb as Oa,fr as Ye,fs as ge,bo as _a,eA as Ta,fa as Ia,ft as ka,E as Ra,C as L,fu as J,fv as K,fw as je,fx as Aa,fy as Da,bm as La,e as v,x as te,f as V,aE as Va,p as z,s as w}from"./index-eeedc550.js";import{u as Kt}from"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{c as Ba}from"./Component-85241517.js";import{c as Fa}from"./createOnModelChange-f0aaf591.js";import{R as $a}from"./ReferencedMaterial-240e1be6.js";import"./TextureAsset-adf746d9.js";import"./GlTFAsset-34fdaded.js";import"./MaterialAsset-010030a2.js";import{MeshAsset as Ya}from"./MeshAsset-3032a2d3.js";import"./AnimatorControllerAsset-c04c5158.js";import"./AnimationClipAsset-a767bb7a.js";import{I as gt}from"./ShaderChunkAsset-e32e6108.js";import"./AmbientLightAsset-ded8af87.js";import"./SpineSkeletonDataAsset-0fdb1ffc.js";import"./FontAsset-5cd70e43.js";import"./SceneAsset-68286235.js";import"./ShaderAsset-b2ea36b6.js";import"./PrimitiveMesh-81a302d9.js";import"./XRReferenceImageAsset-699f6a74.js";import"./PrefabAsset-9e17aab2.js";import"./PhysicsMaterialAsset-a768f5b6.js";import"./RenderTargetAsset-81649762.js";import"./AudioAsset-8b8ab944.js";import"./index-066cf34f.js";import"./MarkdownAsset-ede9d841.js";import{I as xt}from"./IconPlus-7690a910.js";import{B as mt}from"./index-981e5626.js";import{c as Wt}from"./createReactComponent-0c5ada83.js";import"./MaterialInspector-ebbe39d5.js";import"./IconPointFilled-181a0586.js";import"./ktx2-encoder-2883b55c.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-c84e8c00.js";import"./AssetViewer-f505fb55.js";import"./glTFIO-45ff9a17.js";import"./shader-data-utils-c00c9d18.js";import"./index-f655a65a.js";import"./MeshThumbnail-3bb8bccf.js";import"./bundlers-9b0d37fc.js";import"./module-ace60695.js";import"./module-11aabe24.js";import"./ShaderUIScriptAsset-4adc4d41.js";import"./FormItemArray-a06224b4.js";import"./Accordion-6346d8c5.js";import"./module-be69621d.js";import"./Menu-7006a0c9.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 Ht=Xe("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 Ut=Xe("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 Jt=Xe("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 Qt=Xe("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 Vt=[{type:"constant",icon:k.jsx(Ut,{size:"14px"}),columns:"1fr 32px"},{type:"gradient",icon:k.jsx(Ht,{size:"14px"}),columns:"1fr 32px"},{type:"two-constant",icon:k.jsx(Jt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-gradient",icon:k.jsx(Qt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Na(t){return t.map(e=>{const{type:a,value:n}=e;return a==="constant"?{type:a,label:e.label,value:he(n)}:a==="two-constant"?{type:a,label:e.label,value:[he(n[0]),he(n[1])]}:a==="gradient"?{type:a,label:e.label,value:{color:n.color.map(r=>({value:he(r.value),time:r.position})),alpha:n.alpha.map(r=>({value:r.value.a,time:r.position}))}}:a==="two-gradient"?{type:a,label:e.label,value:[{color:n[0].color.map(r=>({value:he(r.value),time:r.position})),alpha:n[0].alpha.map(r=>({value:r.value.a,time:r.position}))},{color:n[1].color.map(r=>({value:he(r.value),time:r.position})),alpha:n[1].alpha.map(r=>({value:r.value.a,time:r.position}))}]}:e})}function Xa(t){return t.map(e=>{const{type:a,value:n}=e;return a==="constant"?{type:a,label:e.label,value:fe(n)}:a==="two-constant"?{type:a,label:e.label,value:[fe(n[0]),fe(n[1])]}:a==="gradient"?{type:a,label:e.label,value:{color:n.color.map(r=>({value:fe(r.value),position:r.time})),alpha:n.alpha.map(r=>({value:{r:255,g:255,b:255,a:r.value},position:r.time}))}}:a==="two-gradient"?{type:a,label:e.label,value:[{color:n[0].color.map(r=>({value:fe(r.value),position:r.time})),alpha:n[0].alpha.map(r=>({value:{r:255,g:255,b:255,a:r.value},position:r.time}))},{color:n[1].color.map(r=>({value:fe(r.value),position:r.time})),alpha:n[1].alpha.map(r=>({value:{r:255,g:255,b:255,a:r.value},position:r.time}))}]}:e})}function ht({hdr:t,value:e,onValueChange:a,...n}){return t?k.jsx(Oe,{...n,mode:"hdr",value:e,onValueChange:a}):k.jsx(Oe,{...n,mode:"constant",value:e,onValueChange:a})}function St(t){var i;const{label:e,labelFirst:a,info:n,value:r,hdr:u=!1}=t,[s,o]=Fe({prop:Xa(r),onChange:c=>{t.onValueChange&&t.onValueChange(Na(c),m)}}),[m,h]=Fe({prop:t.type,defaultProp:"constant",onChange:c=>{t.onValueChange&&t.onValueChange(r,c)}});function y(c,S){var f;return S==="trigger"?(f=Vt.find(x=>x.type===c))==null?void 0:f.icon:c}const l=c=>{o(S=>S.map(f=>f.type!==m?f:{...f,value:c}))},g=c=>S=>{o(f=>f.map(x=>{if(x.type!==m)return x;const{value:C}=x;if(x.type==="two-constant"){if(c===0)return{...x,value:[S,C[1]]};if(c===1)return{...x,value:[C[0],S]}}return x}))},b=c=>{o(S=>S.map(f=>f.type!==m?f:f.type==="gradient"?{...f,value:c}:f))},d=c=>S=>{o(f=>f.map(x=>{if(x.type!==m)return x;if(x.type==="two-gradient"){const{value:C}=x;if(c===0)return{...x,value:[S,C[1]]};if(c===1)return{...x,value:[C[0],S]}}return x}))};return k.jsxs(ne,{label:e,info:n,fieldCss:{gridTemplateColumns:(i=Vt.find(c=>c.type===m))==null?void 0:i.columns},children:[s.map(c=>{const{type:S,value:f}=c;if(!S||m!==S)return null;switch(S){case"constant":return k.jsx(ht,{fullsize:!0,hdr:u,value:f,onValueChange:l},"constant");case"gradient":return k.jsx(Oe,{fullsize:!0,mode:"particle",value:f,onValueChange:b},"gradient");case"two-constant":return k.jsxs($e.Fragment,{children:[k.jsx(ht,{fullsize:!0,hdr:u,value:f[0],onValueChange:g(0)}),k.jsx(ht,{fullsize:!0,hdr:u,value:f[1],onValueChange:g(1)})]},"two-constant");case"two-gradient":return k.jsxs($e.Fragment,{children:[k.jsx(Oe,{fullsize:!0,mode:"particle",value:f[0],onValueChange:d(0)}),k.jsx(Oe,{fullsize:!0,mode:"particle",value:f[1],onValueChange:d(1)})]},"two-gradient");default:return null}}),k.jsx(Me,{defaultValue:"constant",position:"item-aligned",cornerArrow:!0,value:m,valueRenderer:y,onValueChange:c=>h(c),children:s.map(c=>k.jsx(Q,{value:c.type,children:c.label||c.type},c.type))})]})}const ea=[{type:"constant",icon:k.jsx(Ut,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"curve",icon:k.jsx(Ht,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"two-constant",icon:k.jsx(Jt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-curve",icon:k.jsx(Qt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Za(t,e){var a;return e==="trigger"?(a=ea.find(n=>n.type===t))==null?void 0:a.icon:t}const ft=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Ie(t){var T;const{label:e,info:a,value:n,onValueChange:r,algo:u="bezier",yRangeMode:s,yTickScale:o,yTickScaleMin:m,yTickScaleMax:h,onYTickScaleChange:y,onYTickScaleCommit:l,hideTypeSelector:g,...b}=t,[d,i]=Fe({prop:t.type,defaultProp:"constant",onChange:O=>{r&&r(n,O)}}),[c,S]=Fe({prop:n,onChange:O=>{r&&r(O,d)},defaultProp:[{value:0,type:"constant"},{value:ft,type:"curve"},{value:[0,0],type:"two-constant"},{value:[ft,ft],type:"two-curve"}]}),f=O=>{S(A=>A.map(I=>I.type!==d?I:{...I,value:O}))},x=O=>A=>{S(I=>I.map(D=>{if(D.type!==d)return D;const{value:G}=D;return O===0?{...D,value:[A,G[1]]}:O===1?{...D,value:[G[0],A]}:D}))},C=O=>{S(A=>A.map(I=>I.type!==d?I:{...I,value:O}))},j=O=>A=>{S(I=>I.map(D=>{if(D.type!==d)return D;const{value:G}=D;return O===0?{...D,value:[A,G[1]]}:O===1?{...D,value:[G[0],A]}:D}))},_={algo:u,yRangeMode:s,yTickScale:o,yTickScaleMin:m,yTickScaleMax:h,onYTickScaleChange:y,onYTickScaleCommit:l};return k.jsxs(ne,{label:e,info:a,fieldCss:{gridTemplateColumns:(T=ea.find(O=>O.type===d))==null?void 0:T.columns,columnGap:"$1"},...b,children:[c.map(O=>{const{type:A,value:I,min:D,max:G,step:ae}=O;if(!A||d!==A)return null;switch(A){case"constant":return k.jsx(xe,{min:D,max:G,dragStep:ae,step:ae,value:I,onValueChange:f},"constant");case"curve":return k.jsx(mt,{..._,value:I,onChange:C},"curve");case"two-constant":return k.jsxs($e.Fragment,{children:[k.jsx(xe,{size:"sm",startSlot:"min",value:I[0],min:D,max:G,dragStep:ae,step:ae,onValueChange:x(0)}),k.jsx(xe,{size:"sm",startSlot:"max",value:I[1],min:D,max:G,dragStep:ae,step:ae,onValueChange:x(1)})]},"two-constant");case"two-curve":return k.jsxs($e.Fragment,{children:[k.jsx(mt,{..._,value:I[0],onChange:j(0)}),k.jsx(mt,{..._,value:I[1],onChange:j(1)})]},"two-curve");default:return null}}),!g&&k.jsx(Me,{value:d,position:"item-aligned",cornerArrow:!0,valueRenderer:Za,onValueChange:O=>i(O),children:c.map(O=>k.jsx(Q,{value:O.type,children:O.label||O.type},O.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 qa=Wt("outline","current-location","IconCurrentLocation",[["path",{d:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M12 12m-8 0a8 8 0 1 0 16 0a8 8 0 1 0 -16 0",key:"svg-1"}],["path",{d:"M12 2l0 2",key:"svg-2"}],["path",{d:"M12 20l0 2",key:"svg-3"}],["path",{d:"M20 12l2 0",key:"svg-4"}],["path",{d:"M2 12l2 0",key:"svg-5"}]]);/**
|
|
27
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/var Ga=Wt("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);const Ka=X(function(t){const[e,a]=N.useState(null),n=t.data,{assetStore:r,inspectorFacade:u}=Kt();return N.useEffect(()=>{r.getAssetByRef(n.material).then(s=>{a(s)})},[n.material]),p.jsxs(p.Fragment,{children:[p.jsx(va.List,{model:n,configs:n.formSchema.items,onModelChange:Fa("component",n.id,u,n)}),e&&p.jsx($a,{materialAsset:e})]})});async function Wa(t,e){await t.assetStore.getAssetByRef(e)}var B=(t=>(t.BoxShape="BoxShape",t.CircleShape="CircleShape",t.ConeShape="ConeShape",t.HemisphereShape="HemisphereShape",t.SphereShape="SphereShape",t.MeshShape="MeshShape",t))(B||{});function q(t,e){return{class:t.class,props:{...t.props,...e}}}const Ha=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsx(p.Fragment,{children:p.jsx(Le,{label:a("effects.shape.size"),value:{x:t.props.size.x,y:t.props.size.y,z:t.props.size.z},onChange:(n,r)=>{const u=q(t,{size:{...t.props.size,[r]:n[r]}});e==null||e("shape",u)}})})}),Ua=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsxs(p.Fragment,{children:[p.jsx(oe,{label:a("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:t.props.radius,onChange:n=>{const r=q(t,{radius:n});e==null||e("shape",r)}}),p.jsx(oe,{label:a("effects.shape.arc"),min:0,max:360,value:t.props.arc,onChange:n=>{const r=q(t,{arc:n});e==null||e("shape",r)}}),p.jsx(vt,{label:a("effects.shape.arc-mode.label"),options:[{label:a("effects.shape.loop"),value:Ve.Loop},{label:a("effects.shape.random"),value:Ve.Random}],value:t.props.arcMode,onChange:n=>{const r=q(t,{arcMode:n});e==null||e("shape",r)}}),t.props.arcMode===Ve.Loop?p.jsx(oe,{label:a("effects.shape.arc-speed.label"),step:.1,dragStep:.1,value:t.props.arcSpeed,onChange:n=>{const r=q(t,{arcSpeed:n});e==null||e("shape",r)}}):null]})}),Ja=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsxs(p.Fragment,{children:[p.jsx(vt,{label:a("effects.shape.emit-type.label"),options:[{label:a("effects.shape.cone-base"),value:Se.Base},{label:a("effects.shape.volume"),value:Se.Volume}],value:t.props.emitType,onChange:n=>{const r=q(t,{emitType:n});e==null||e("shape",r)}}),p.jsx(oe,{label:a("effects.shape.angle"),min:1e-4,max:90,step:.05,dragStep:.05,value:t.props.angle,onChange:n=>{const r=q(t,{angle:n});e==null||e("shape",r)}}),p.jsx(oe,{label:a("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:t.props.radius,onChange:n=>{const r=q(t,{radius:n});e==null||e("shape",r)}}),p.jsx(oe,{label:a("effects.shape.length"),min:1e-4,step:.1,dragStep:.1,value:t.props.length,disabled:t.props.emitType===Se.Base,onChange:n=>{const r=q(t,{length:n});e==null||e("shape",r)}})]})}),Qa=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsx(p.Fragment,{children:p.jsx(oe,{label:a("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:t.props.radius,onChange:n=>{const r=q(t,{radius:n});e==null||e("shape",r)}})})}),en=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsx(p.Fragment,{children:p.jsx(oe,{label:a("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:t.props.radius,onChange:n=>{const r=q(t,{radius:n});e==null||e("shape",r)}})})}),tn=X(({item:t,onModelChange:e})=>{const{t:a}=Z(),{assetStore:n}=Kt(),r=Object.values(n.assets).filter(o=>o instanceof Ya),[u,s]=N.useState("");return N.useEffect(()=>{let o=!1;return(async()=>{if(!t.props.mesh){s("");return}try{const h=await n.getAssetByRef(t.props.mesh);o||s((h==null?void 0:h.name)??"")}catch{o||s("")}})(),()=>{o=!0}},[n,t.props.mesh]),p.jsx(ga,{label:a("effects.renderer.render-mode.options.mesh"),assets:r,dropLayer:0,value:u,onSelect:async o=>{s(o.name);const m=!!o.engineObject;m||xa.error("Mesh asset is not initialized");const h={class:t.class,props:{...t.props,mesh:o.getCurrentRef(),enabled:m}};e==null||e("shape",h)}})}),an=X(({item:t,onModelChange:e})=>{const{t:a}=Z();return p.jsx(oe,{label:a("effects.shape.random-direction-amount"),info:a("effects.shape.random-direction-amount-tip"),min:0,step:1,dragStep:.05,value:t.props.randomDirectionAmount||0,onChange:n=>{const r=q(t,{randomDirectionAmount:n});e==null||e("shape",r)}})}),nn=X(({item:t,onModelChange:e})=>{const{t:a}=Z(),n=t.props.position??{x:0,y:0,z:0},r=t.props.rotation??{x:0,y:0,z:0},u=t.props.scale??{x:1,y:1,z:1};return p.jsxs(p.Fragment,{children:[p.jsx(Le,{label:a("effects.shape.position"),value:{x:n.x,y:n.y,z:n.z},onChange:(s,o)=>{const m=q(t,{position:{x:n.x,y:n.y,z:n.z,[o]:s[o]},rotation:{x:r.x,y:r.y,z:r.z},scale:{x:u.x,y:u.y,z:u.z}});e==null||e("shape",m)}}),p.jsx(Le,{label:a("effects.shape.rotation"),value:{x:r.x,y:r.y,z:r.z},onChange:(s,o)=>{const m=q(t,{position:{x:n.x,y:n.y,z:n.z},rotation:{x:r.x,y:r.y,z:r.z,[o]:s[o]},scale:{x:u.x,y:u.y,z:u.z}});e==null||e("shape",m)}}),p.jsx(Le,{label:a("effects.shape.scale"),value:{x:u.x,y:u.y,z:u.z},onChange:(s,o)=>{const m=q(t,{position:{x:n.x,y:n.y,z:n.z},rotation:{x:r.x,y:r.y,z:r.z},scale:{x:u.x,y:u.y,z:u.z,[o]:s[o]}});e==null||e("shape",m)}})]})}),bt=new Map;function rn(t,e){let a;switch(e.class){case B.BoxShape:{a=new za;const n=a.size;n.copyFrom(e.props.size),a.size=n;break}case B.CircleShape:{a=new Ca,a.radius=e.props.radius,a.arc=e.props.arc,a.arcMode=e.props.arcMode,a.arcSpeed=e.props.arcSpeed;break}case B.ConeShape:{a=new Ea,a.angle=e.props.angle,a.radius=e.props.radius,a.length=e.props.length,a.emitType=e.props.emitType;break}case B.HemisphereShape:{a=new Pa,a.radius=e.props.radius;break}case B.SphereShape:{a=new Ma,a.radius=e.props.radius;break}case B.MeshShape:{a=new Sa;const n=e.props.mesh;if(n!=null&&n.refId){const r=t.root.assetStore.assets[n.refId];a.mesh=r==null?void 0:r.engineObject}a.mesh||(a.mesh=Zt.createSphere(t.engineObject.engine));break}}if(a){if(e.props.randomDirectionAmount=e.props.randomDirectionAmount??0,a.randomDirectionAmount=e.props.randomDirectionAmount,a.enabled=e.props.enabled,e.props.position){const n=e.props.position;a.position.set(n.x,n.y,n.z)}if(e.props.rotation){const n=e.props.rotation;a.rotation.set(n.x,n.y,n.z)}if(e.props.scale){const n=e.props.scale;a.scale.set(n.x,n.y,n.z)}}return a}const sn=(t,e,a)=>{let n=bt.get(`${t.id}-${a.class}`);n&&(n=JSON.parse(n),bt.delete(`${t.id}-${a.class}`),Object.assign(a.props,n));const r=rn(t,a);r&&t.applyEmissionShape(r)},on={BoxShape:Ha,CircleShape:Ua,ConeShape:Ja,HemisphereShape:Qa,SphereShape:en,MeshShape:tn},cn={BoxShape:{class:B.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:B.CircleShape,props:{radius:1,arc:360,arcMode:Ve.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:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:Se.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:B.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:B.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:B.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}}}},ln=X(({model:t,onModelChange:e})=>{const{t:a}=Z(),n=t.shape;if(!n.class)return;const r=on[n.class];return p.jsxs(p.Fragment,{children:[p.jsx(vt,{label:a("effects.shape.type.label"),info:a("effects.shape.type.info"),value:n.class,options:[{label:a("effects.shape.options.box"),value:B.BoxShape},{label:a("effects.shape.options.circle"),value:B.CircleShape},{label:a("effects.shape.options.cone"),value:B.ConeShape},{label:a("effects.shape.options.hemisphere"),value:B.HemisphereShape},{label:a("effects.shape.options.sphere"),value:B.SphereShape},{label:a("effects.shape.options.mesh"),value:B.MeshShape}],onChange:u=>{const s=cn[u];if(t.shape&&t.shape.class!==u&&bt.set(`${t.id}-${t.shape.class}`,JSON.stringify(t.shape.props)),s.class!==n.class){const o=Y(s);e==null||e("shape",o)}}}),p.jsx(r,{item:n,component:t.engineObject,onModelChange:e}),p.jsx(an,{item:n,component:t.engineObject,onModelChange:e}),p.jsx(nn,{item:n,component:t.engineObject,onModelChange:e})]})}),un=t=>t===1/0?1/0:Math.max(1,Math.floor(t));function pn(t){if(!(t!=null&&t.constructParams))return;const e=t.constructParams[2];e===null?t.constructParams[2]=1/0:typeof e=="number"&&e!==1/0&&(t.constructParams[2]=Math.max(1,Math.floor(e)))}const Ze=["constant","two-constant","curve","two-curve"],ie=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function se(t){return t.map(e=>({x:e.constructParams[0],y:e.constructParams[1]}))}const Bt={class:"ParticleCurve",constructParams:[{class:"CurveKey",constructParams:[0,0]},{class:"CurveKey",constructParams:[.25,.25]},{class:"CurveKey",constructParams:[.75,.75]},{class:"CurveKey",constructParams:[1,1]}]};function $(t,e=0,a=0,n=F.Constant){return{module:t,mode:n,constantMin:a,constantMax:e,curveMax:Y(Bt),curveMin:Y(Bt)}}function ye(t,e=0,a=0,n=F.Constant){return{enabled:!1,x:$(t,e,a,n),y:$(t,e,a,n),z:$(t,e,a,n)}}const Ne=1,Mt=.01,dn=Ce("div",{height:"$6",display:"flex",alignItems:"center",paddingLeft:"$2",fontSize:"$sm",borderRadius:"$1",backgroundColor:"$softBg",color:"$gray9",userSelect:"none"}),mn=p.jsx(Ga,{size:"14px"});function hn(t,e){return e==="trigger"?mn:t}const fn={class:"Burst",constructParams:[0,{class:"ParticleCompositeCurve",constructParams:[15],props:{mode:F.Constant,constantMax:15,constantMin:0}},Ne,Mt]},yn=X(({model:t,inspectorConfig:e,onModelChange:a})=>{const{t:n}=Z(),{label:r,info:u}=e,s=t.bursts,[o,m]=N.useState(-1),h=i=>{const c=Y(s);i(c),a==null||a("bursts",c)},y=(i,c)=>{h(S=>{const f=S[i];f&&c(f)})},l=i=>{h(c=>{c.splice(i,1)})},g=()=>{h(i=>{i.push(Y(fn))})},b=[{title:n("effects.burst.time.label"),width:"minmax(0, 0.6fr)"},{title:n("effects.burst.count.label"),width:"minmax(0, 1.8fr)"},{title:n("effects.burst.cycles.label"),width:"minmax(0, 1fr)"},{title:n("effects.burst.interval.label"),width:"minmax(0, 1fr)"}],d=(i,c)=>{const S=Math.max(1,i.constructParams[1].props.constantMax??0,i.constructParams[1].props.constantMin??0);return{data:i,cells:[p.jsx(ne,{children:p.jsx(xe,{min:0,max:t.duration,step:.05,dragStep:.05,value:i.constructParams[0],onValueChange:f=>{y(c,x=>{x.constructParams[0]=f})}})},`time-${c}`),p.jsx(Ie,{type:Ze[i.constructParams[1].props.mode],direction:"column",algo:"bezier",yRangeMode:"positive",yTickScale:S,yTickScaleMin:0,yTickScaleMax:S,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:i.constructParams[1].props.constantMax,type:"constant",min:0,step:1},{value:[i.constructParams[1].props.constantMin,i.constructParams[1].props.constantMax],type:"two-constant",min:0,step:1}],onValueChange:(f,x)=>{const C=f.find(j=>j.type===x);C&&y(c,j=>{switch(x){case"constant":{j.constructParams[1].props.mode=F.Constant,j.constructParams[1].props.constantMax=C.value;break}case"two-constant":{j.constructParams[1].props.mode=F.TwoConstants,j.constructParams[1].props.constantMin=C.value[0],j.constructParams[1].props.constantMax=C.value[1];break}}})}},`count-${c}`),p.jsxs(ne,{fieldCss:{gridTemplateColumns:"minmax(0, 1fr) 32px",columnGap:"$1"},children:[i.constructParams[2]===1/0?p.jsx(dn,{children:"∞"}):p.jsx(xe,{min:1,step:1,dragStep:1,value:i.constructParams[2]??Ne,onValueChange:f=>{y(c,x=>{x.constructParams[2]=un(f)})}}),p.jsxs(Me,{value:i.constructParams[2]===1/0?"infinity":"number",position:"item-aligned",cornerArrow:!0,valueRenderer:hn,onValueChange:f=>{y(c,x=>{x.constructParams[2]=f==="infinity"?1/0:Ne})},children:[p.jsx(Q,{value:"number",children:n("effects.burst.cycles.number")}),p.jsx(Q,{value:"infinity",children:n("effects.burst.cycles.infinity")})]})]},`cycles-${c}`),p.jsx(ne,{children:p.jsx(xe,{disabled:!i.constructParams[2]||i.constructParams[2]===1,min:.01,step:.01,dragStep:.01,value:i.constructParams[3]??Mt,onValueChange:f=>{y(c,x=>{x.constructParams[3]=f})}})},`interval-${c}`)]}};return p.jsx(qt,{columns:b,items:s.map((i,c)=>d(i,c)),label:n(r),info:n(u),addable:!1,emptyText:n("effects.burst.empty","No bursts"),selectedIndex:o,onRowClick:m,sideSlot:p.jsxs(_e,{direction:"column",gap:"xs",children:[p.jsx(ce,{variant:"soft",onClick:g,css:{flex:1},children:p.jsx(xt,{size:"14px"})}),p.jsx(ce,{variant:"soft",css:{flex:1},onClick:()=>{const i=o>=0&&o<s.length?o:s.length-1;i>=0&&(l(i),m(Math.min(i,s.length-2)))},children:p.jsx(gt,{size:"14px"})})]})})}),bn=(t,e,a)=>{const n=t.engineObject.generator.emission,r=n.bursts;for(let u=r.length-1;u>=0;u--)n.removeBurst(r[u]);for(let u=0;u<a.length;u++){const s=a[u];if(!s||!Array.isArray(s.constructParams)||s.constructParams.length<2){console.warn(`Invalid burst item at index ${u}:`,s);continue}const o=s.constructParams[0],m=s.constructParams[1],h=s.constructParams[2]??Ne,y=s.constructParams[3]??Mt;if(!m||!m.props){console.warn(`Invalid burst count data at index ${u}:`,m);continue}const l=m.props,g=new Gt(l.constantMax);g.mode=l.mode,g.constantMin=l.constantMin,g.constantMax=l.constantMax,g.constant=l.constantMax;const b=new wa(o,g);b.cycles=h,b.repeatInterval=y,n.addBurst(b)}};function Ft(t="colorOverLifetime"){return{module:t,mode:ee.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 De=["x","y","z"],vn={constant:F.Constant,"two-constant":F.TwoConstants,curve:F.Curve,"two-curve":F.TwoCurves},ze=X(({model:t,inspectorConfig:e,onModelChange:a})=>{const{t:n}=Z(),r=e.property,{mainAxis:u}=e,s=t[r],[o,m]=N.useState({x:{max:ie,min:ie},y:{max:ie,min:ie},z:{max:ie,min:ie}}),[h,y]=N.useState(e.yTickScale??1),l=Ze[s.x.mode];function g(c){return(S,f)=>{const x=S.find(T=>T.type===f);if(!x)return;const C=Y(s),j=C[c],_=vn[f];for(const T of De)C[T].mode=_;switch(f){case"constant":j.constantMax=x.value;break;case"two-constant":j.constantMin=x.value[0],j.constantMax=x.value[1];break;case"curve":{if(x.value.length>4)return;m(T=>({...T,[c]:{...T[c],max:x.value}})),x.value.forEach((T,O)=>{j.curveMax.constructParams[O].constructParams[0]=T.x,j.curveMax.constructParams[O].constructParams[1]=T.y*h});break}case"two-curve":{if(x.value[0].length>4||x.value[1].length>4)return;m(T=>({...T,[c]:{min:x.value[0],max:x.value[1]}})),x.value[0].forEach((T,O)=>{j.curveMin.constructParams[O].constructParams[0]=T.x,j.curveMin.constructParams[O].constructParams[1]=T.y*h}),x.value[1].forEach((T,O)=>{j.curveMax.constructParams[O].constructParams[0]=T.x,j.curveMax.constructParams[O].constructParams[1]=T.y*h});break}}t[r]=C,a==null||a(r,C)}}function b(c){return[{value:s[c].constantMax,type:"constant",label:n("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[s[c].constantMin,s[c].constantMax],type:"two-constant",label:n("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:o[c].max,type:"curve",label:n("effects.curve.curve")},{value:[o[c].min,o[c].max],type:"two-curve",label:n("effects.curve.two-curve")}]}const d=c=>{const S=c/h,f=Y(s);for(const x of De){const C=f[x];C.curveMax.constructParams.forEach(j=>{j.constructParams[1]*=S}),C.curveMin.constructParams.forEach(j=>{j.constructParams[1]*=S})}y(c),t[r]=f,a==null||a(r,f)},i={algo:"linear",yRangeMode:e.yRangeMode,yTickScale:h,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:d,onYTickScaleCommit:()=>{}};return N.useEffect(()=>{const c={};for(const S of De)c[S]={max:se(s[S].curveMax.constructParams).map(f=>({...f,y:f.y/h})),min:se(s[S].curveMin.constructParams).map(f=>({...f,y:f.y/h}))};m(c)},[]),p.jsxs(p.Fragment,{children:[p.jsx(ja,{label:e.toggleLabel?n(e.toggleLabel):n("effects.curve.3d-prefix")+" "+n(e.label||r),info:n(e.info),value:s.enabled,onChange:c=>{const S=Y(s);S.enabled=c,t[r]=S,a==null||a(r,S)}}),s.enabled?p.jsx(ne,{label:"",children:p.jsx(_e,{direction:"column",gap:"xxs",children:De.map((c,S)=>p.jsx(Ie,{label:n(c).toLocaleUpperCase(),type:l,css:{gridTemplateColumns:"$4 repeat(3, minmax(0px, 1fr))"},...i,value:b(c),hideTypeSelector:S!==0,onValueChange:g(c)},c))})}):p.jsx(Ie,{label:n(e.label||r),type:l,...i,value:b(u),onValueChange:g(u)})]})}),we=t=>(e,a,n)=>{var s,o;const r=(o=(s=e.engineObject)==null?void 0:s.generator)==null?void 0:o[n.x.module];if(!r){console.warn(`Module container not found for: ${n.x.module}`);return}r[t]=n.enabled;const u={x:r[a+"X"],y:r[a+"Y"],z:r[a+"Z"]};for(const m in u){const h=n[m],y=u[m];if(!y){console.warn(`Axis module not found for: ${m} in ${a}`);continue}y.mode=h.mode,y.constantMax=h.constantMax,y.constantMin=h.constantMin,y.curveMax=new Pe,h.curveMax.constructParams.forEach(l=>{const g=l.constructParams[0],b=l.constructParams[1];y.curveMax.addKey(new Ee(g,b))}),y.curveMin=new Pe,h.curveMin.constructParams.forEach(l=>{const g=l.constructParams[0],b=l.constructParams[1];y.curveMin.addKey(new Ee(g,b))})}},W=X(({model:t,inspectorConfig:e,onModelChange:a})=>{const{t:n}=Z(),r=e.property,u=t[r],[s,o]=N.useState(ie),[m,h]=N.useState(ie),[y,l]=N.useState(()=>Math.max(e.yTickScale??1,Math.abs(u.constantMax??0),Math.abs(u.constantMin??0),...se(u.curveMax.constructParams).map(b=>Math.abs(b.y)),...se(u.curveMin.constructParams).map(b=>Math.abs(b.y))));N.useEffect(()=>{const b=se(u.curveMax.constructParams),d=se(u.curveMin.constructParams);o(b),h(d)},[]);const g=(b,d)=>{const i=b.find(S=>S.type===d);if(!i)return;const c=Y(u);switch(d){case"constant":c.mode=F.Constant,c.constantMax=i.value;break;case"two-constant":c.mode=F.TwoConstants,c.constantMin=i.value[0],c.constantMax=i.value[1];break;case"curve":{if(i.value.length>4)return;o(i.value),c.mode=F.Curve,i.value.forEach((S,f)=>{c.curveMax.constructParams[f].constructParams[0]=S.x,c.curveMax.constructParams[f].constructParams[1]=S.y});break}case"two-curve":{if(i.value[0].length>4||i.value[1].length>4)return;c.mode=F.TwoCurves,h(i.value[0]),o(i.value[1]),i.value[0].forEach((S,f)=>{c.curveMin.constructParams[f].constructParams[0]=S.x,c.curveMin.constructParams[f].constructParams[1]=S.y}),i.value[1].forEach((S,f)=>{c.curveMax.constructParams[f].constructParams[0]=S.x,c.curveMax.constructParams[f].constructParams[1]=S.y});break}}t[r]=c,a==null||a(r,c)};return p.jsx(p.Fragment,{children:p.jsx(Ie,{label:n(e.label||e.property),info:n(e.info),type:Ze[u.mode],algo:"linear",yRangeMode:e.yRangeMode,yTickScale:y,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:l,onYTickScaleCommit:()=>{},value:[{value:u.constantMax,type:"constant",label:n("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[u.constantMin,u.constantMax],type:"two-constant",label:n("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:s,type:"curve",label:n("effects.curve.curve")},{value:[m,s],type:"two-curve",label:n("effects.curve.two-curve")}],onValueChange:g})})}),H=(t,e,a)=>{var u,s;const n=(s=(u=t.engineObject)==null?void 0:u.generator)==null?void 0:s[a.module];if(!n){console.warn(`Module container not found for: ${a.module}`);return}const r=n[e];if(!r){console.warn(`Module not found for property: ${e} in ${a.module}`);return}r.mode=a.mode,r.constantMax=a.constantMax,r.constantMin=a.constantMin,r.curveMax=new Pe,a.curveMax.constructParams.forEach(o=>{const m=o.constructParams[0],h=o.constructParams[1];r.curveMax.addKey(new Ee(m,h))}),r.curveMin=new Pe,a.curveMin.constructParams.forEach(o=>{const m=o.constructParams[0],h=o.constructParams[1];r.curveMin.addKey(new Ee(m,h))})},gn=["constant","two-constant"],xn=X(({model:t,inspectorConfig:e,onModelChange:a})=>{var h,y;const{t:n}=Z(),r=e.property,u=t[r],s={...le(u.constantMax),intensity:((h=u.constantMax)==null?void 0:h.intensity)??1},o={...le(u.constantMin),intensity:((y=u.constantMin)==null?void 0:y.intensity)??1},m=(l,g)=>{const b=l.find(i=>i.type===g);if(!b)return;const d=Y(u);switch(g){case"constant":{d.mode=ee.Constant,d.constantMax=b.value;break}case"two-constant":{const i=b.value[0],c=b.value[1];d.mode=ee.TwoConstants,d.constantMin=i,d.constantMax=c;break}}t[r]=d,a==null||a(r,d)};return p.jsx(St,{label:n(e.label||e.property),type:gn[u.mode],info:n(e.info),hdr:!0,value:[{value:s,type:"constant",label:n("effects.curve.constant")},{value:[o,s],type:"two-constant",label:n("effects.curve.two-constant")}],onValueChange:m})}),Sn=(t,e,a)=>{const n=t.engineObject.generator.main.startColor;n.mode=a.mode;const{constantMax:r,constantMin:u}=a,s=r.intensity??1,o=u.intensity??1;n.constantMax.set(r.r*s,r.g*s,r.b*s,r.a),n.constantMin.set(u.r*o,u.g*o,u.b*o,u.a)},Mn=["gradient","two-gradient"],Pn=X(({model:t,inspectorConfig:e,onModelChange:a})=>{const{t:n}=Z(),r=e.property,u=t[r],s=(o,m)=>{var l,g;if(!o.find(b=>b.type===m))return;const y=Y(u);switch(m){case"gradient":{const b=o.find(d=>d.type===m);if(!((l=b==null?void 0:b.value)!=null&&l.color)||!((g=b==null?void 0:b.value)!=null&&g.alpha)){console.warn(`Invalid gradient value structure for ${r}`);return}if(b.value.color.length>4||b.value.alpha.length>4)return;y.mode=ee.Gradient,y.gradientMax.constructParams=[b.value.color.map(d=>({color:d.value,time:d.time})),b.value.alpha.map(d=>({alpha:d.value,time:d.time}))];break}case"two-gradient":{const b=o.find(d=>d.type===m);if(b.value[0].color.length>4||b.value[0].alpha.length>4||b.value[1].color.length>4||b.value[1].alpha.length>4)return;y.mode=ee.TwoGradients,y.gradientMin.constructParams=[b.value[0].color.map(d=>({color:d.value,time:d.time})),b.value[0].alpha.map(d=>({alpha:d.value,time:d.time}))],y.gradientMax.constructParams=[b.value[1].color.map(d=>({color:d.value,time:d.time})),b.value[1].alpha.map(d=>({alpha:d.value,time:d.time}))];break}}t[r]=y,a==null||a(r,y)};return p.jsx(p.Fragment,{children:p.jsx(St,{label:n(e.property),type:Mn[u.mode-2],info:n(e.info),value:[{value:{color:u.gradientMax.constructParams[0].map(o=>({value:le(o.color),time:o.time})),alpha:u.gradientMax.constructParams[1].map(o=>({value:o.alpha,time:o.time}))},type:"gradient",label:n("effects.curve.gradient")},{value:[{color:u.gradientMin.constructParams[0].map(o=>({value:le(o.color),time:o.time})),alpha:u.gradientMin.constructParams[1].map(o=>({value:o.alpha,time:o.time}))},{color:u.gradientMax.constructParams[0].map(o=>({value:le(o.color),time:o.time})),alpha:u.gradientMax.constructParams[1].map(o=>({value:o.alpha,time:o.time}))}],type:"two-gradient",label:n("effects.curve.two-gradient")}],onValueChange:s})})}),be=[],ve=[],En=(t,e,a)=>{var m,h,y;const n=(h=(m=t.engineObject)==null?void 0:m.generator)==null?void 0:h[a.module];if(!n){console.warn(`Module container not found for: ${a.module}`);return}const r=n[e];if(!r){console.warn(`Module not found for property: ${e} in ${a.module}`);return}if(r.mode=a.mode,be.length=0,ve.length=0,!((y=a.gradientMax)!=null&&y.constructParams)||!Array.isArray(a.gradientMax.constructParams)){console.warn(`Invalid gradientMax.constructParams for ${e}`);return}const u=a.gradientMax.constructParams,s=u[0]||[],o=u[1]||[];Array.isArray(s)&&s.forEach(l=>{if(l&&l.color&&typeof l.time=="number"){const g=l.color;be.push(new Dt(l.time,new Te(g.r??0,g.g??0,g.b??0,g.a??1)))}}),Array.isArray(o)&&o.forEach(l=>{l&&typeof l.time=="number"&&typeof l.alpha=="number"&&ve.push(new Lt(l.time,l.alpha))}),r.gradientMax.setKeys(be,ve),be.length=0,ve.length=0,a.gradientMin.constructParams[0].forEach(l=>{be.push(new Dt(l.time,new Te(l.color.r,l.color.g,l.color.b,l.color.a)))}),a.gradientMin.constructParams[1].forEach(l=>{ve.push(new Lt(l.time,l.alpha))}),r.gradientMin.setKeys(be,ve)};function Be(t){return t-Math.floor(t*(1/289))*289}function U(t){return Be((34*t+1)*t)}function yt(t,e,a){const n=.16666666666666666,r=1/3,u=(t+e+a)*r,s=Math.floor(t+u),o=Math.floor(e+u),m=Math.floor(a+u),h=(s+o+m)*n,y=t-s+h,l=e-o+h,g=a-m+h;let b,d,i,c,S,f;y>=l?l>=g?(b=1,d=0,i=0,c=1,S=1,f=0):y>=g?(b=1,d=0,i=0,c=1,S=0,f=1):(b=0,d=0,i=1,c=1,S=0,f=1):l<g?(b=0,d=0,i=1,c=0,S=1,f=1):y<g?(b=0,d=1,i=0,c=0,S=1,f=1):(b=0,d=1,i=0,c=1,S=1,f=0);const x=y-b+n,C=l-d+n,j=g-i+n,_=y-c+r,T=l-S+r,O=g-f+r,A=y-.5,I=l-.5,D=g-.5,G=Be(s),ae=Be(o),ke=Be(m),sa=U(U(U(ke)+ae)+G),oa=U(U(U(ke+i)+ae+d)+G+b),ia=U(U(U(ke+f)+ae+S)+G+c),ca=U(U(U(ke+1)+ae+1)+G+1),qe=.142857142857,Pt=qe*2-0,Et=qe*.5-1,Ge=qe*1-0;function Re(jt){const Ot=jt-49*Math.floor(jt*Ge*Ge),_t=Math.floor(Ot*Ge),ma=Math.floor(Ot-7*_t),Tt=_t*Pt+Et,It=ma*Pt+Et,Ae=1-Math.abs(Tt)-Math.abs(It),kt=Tt,Rt=It,ha=Math.floor(kt)*2+1,fa=Math.floor(Rt)*2+1,At=-(Ae<0?1:0),ut=kt+ha*At,pt=Rt+fa*At,dt=1.79284291400159-.85373472095314*(ut*ut+pt*pt+Ae*Ae);return[ut*dt,pt*dt,Ae*dt]}const ue=Re(sa),pe=Re(oa),de=Re(ia),me=Re(ca),Ke=Math.max(.6-(y*y+l*l+g*g),0),We=Math.max(.6-(x*x+C*C+j*j),0),He=Math.max(.6-(_*_+T*T+O*O),0),Ue=Math.max(.6-(A*A+I*I+D*D),0),Je=Ke*Ke,Qe=We*We,et=He*He,tt=Ue*Ue,at=Je*Je,nt=Qe*Qe,rt=et*et,st=tt*tt,la=ue[0]*y+ue[1]*l+ue[2]*g,ua=pe[0]*x+pe[1]*C+pe[2]*j,pa=de[0]*_+de[1]*T+de[2]*O,da=me[0]*A+me[1]*I+me[2]*D,ot=Je*Ke*la,it=Qe*We*ua,ct=et*He*pa,lt=tt*Ue*da;let Ct=-8*(ot*y+it*x+ct*_+lt*A),zt=-8*(ot*l+it*C+ct*T+lt*I),wt=-8*(ot*g+it*j+ct*O+lt*D);return Ct+=at*ue[0]+nt*pe[0]+rt*de[0]+st*me[0],zt+=at*ue[1]+nt*pe[1]+rt*de[1]+st*me[1],wt+=at*ue[2]+nt*pe[2]+rt*de[2]+st*me[2],[Ct*42,zt*42,wt*42]}function $t(t,e,a){yt(a,e,t);const r=yt(t+100,a,e);return yt(e,t+100,a)[1]-r[2]}function Cn(t,e,a,n,r,u,s){let o=$t(t*n,e*n,a*n),m=1,h=n,y=1;for(let l=1;l<r;l++)y*=s,h*=u,m+=y,o+=y*$t(t*h,e*h,a*h);return o/m}const re=80,Yt=5,zn=({model:t})=>{const e=N.useRef(null),a=N.useRef(0);return N.useEffect(()=>{const n=e.current;if(!n)return;const r=n.getContext("2d");if(!r)return;const u=Oa(()=>{var d,i;const s=((i=(d=t.noiseStrength)==null?void 0:d.x)==null?void 0:i.constantMax)??1,o=t.noiseFrequency??.5,m=t.noiseScrollSpeed??0,h=t.noiseOctaveCount??1,y=t.noiseOctaveIntensityMultiplier??.5,l=t.noiseOctaveFrequencyMultiplier??2;cancelAnimationFrame(a.current);const g=performance.now(),b=c=>{const S=(c-g)/1e3*m,f=r.createImageData(re,re),x=f.data;for(let C=0;C<re;C++){const j=(1-C/re)*Yt;for(let _=0;_<re;_++){const T=_/re*Yt,O=Cn(T,j,S,o,h,l,y),A=Math.max(0,Math.min(255,Math.round((O*s*(.5/7)+.5)*255))),I=(C*re+_)*4;x[I]=A,x[I+1]=A,x[I+2]=A,x[I+3]=255}}r.putImageData(f,0,0),m>0&&(a.current=requestAnimationFrame(b))};a.current=requestAnimationFrame(b)});return()=>{cancelAnimationFrame(a.current),u()}},[t]),p.jsx(ne,{label:" ",labelCss:{visibility:"hidden"},children:p.jsxs("div",{style:{position:"relative",width:80,height:80},children:[p.jsx("canvas",{ref:e,width:re,height:re,style:{width:80,height:80,borderRadius:4,border:"1px solid var(--color-border-default, rgba(255,255,255,0.12))",display:"block"}}),p.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"})]})})},wn={emitter:null,type:Ye.Birth,inheritProperties:ge.None,emitProbability:1};function jn(){return Y(wn)}const Nt=[{flag:ge.Color,key:"color"},{flag:ge.Size,key:"size"},{flag:ge.Rotation,key:"rotation"},{flag:ge.Velocity,key:"velocity"}],On=Ce("div",{display:"flex",flexDirection:"column",gap:"$2",width:"100%"}),_n=Ce("div",{display:"flex",flexDirection:"column",gap:"$1",padding:"$2",borderRadius:"$2",backgroundColor:"$grayA3",border:"1px solid $gray6",cursor:"pointer",variants:{selected:{true:{backgroundColor:"$gray4",borderColor:"$gray8"}}}}),Tn=Ce("div",{display:"grid",gridTemplateColumns:"minmax(0px, 1.3fr) repeat(3, minmax(0px, 1fr))",alignItems:"center",columnGap:"$1",padding:"$0_5"}),In=Ce("div",{gridColumn:"2 / -1",display:"grid",gridTemplateColumns:"minmax(0, 8fr) $6 $6",columnGap:"$1",alignItems:"center",width:"100%","& > :first-child, & > :first-child > button":{width:"100%"}});function kn(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...t,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"}),p.jsx("path",{d:"M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"}),p.jsx("line",{x1:"16",y1:"21",x2:"16",y2:"19"}),p.jsx("line",{x1:"19",y1:"16",x2:"21",y2:"16"}),p.jsx("line",{x1:"3",y1:"8",x2:"5",y2:"8"}),p.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"5"})]})}const Rn=Ce("div",{padding:"$2",color:"$gray8",fontSize:"$sm"}),An=X(({model:t,onModelChange:e})=>{const{t:a}=Z(),n=t.subEmitters??[],[r,u]=N.useState(-1),s=i=>{const c=Y(n);i(c),e==null||e("subEmitters",c)},o=(i,c)=>{s(S=>{const f=S[i];f&&c(f)})},m=t.root.sceneStore,h=Array.from(m.iterateEntityModels(),([,i])=>i),y=new Map(m.iterateEntityModels()),l=t.id.startsWith("prefab:")?t.id.slice(0,t.id.lastIndexOf(":")+1):"",g=(i,c)=>{var j;const S=((j=i.emitter)==null?void 0:j.ownerId)??null,f=S?y.get(S)??(l?y.get(l+S):void 0):null,x=Nt.filter(({flag:_})=>(i.inheritProperties&_)!==0).map(({key:_})=>_),C=_=>{const T=_?m.getEntityModel(_):null,O=T==null?void 0:T.getComponentByTypeName("ParticleRenderer"),A=O?{ownerId:_,componentId:O.id}:null;o(c,I=>{I.emitter=A})};return p.jsxs(_n,{selected:c===r,onMouseDownCapture:()=>u(c),children:[p.jsxs(Tn,{children:[p.jsxs(Me,{size:"sm",value:String(i.type),onValueChange:_=>{o(c,T=>{T.type=Number(_)})},children:[p.jsx(Q,{value:String(Ye.Birth),children:a("effects.sub-emitter.type.options.birth")}),p.jsx(Q,{value:String(Ye.Death),children:a("effects.sub-emitter.type.options.death")})]}),p.jsxs(In,{children:[p.jsx(_a,{entities:h,selectedEntityId:S??void 0,displayValue:f==null?void 0:f.name,placeholder:a("effects.sub-emitter.target.placeholder"),customFilter:_=>{var T;return _.id===t.entityModelId?!1:!!((T=_.getComponentByTypeName)!=null&&T.call(_,"ParticleRenderer"))},onSelect:C}),p.jsx(ce,{size:"sm",variant:"soft",disabled:!S,onClick:()=>{S&&m.selectEntity(S)},children:p.jsx(qa,{})}),p.jsx(ce,{size:"sm",variant:"soft",disabled:!S,onClick:()=>C(null),children:p.jsx(kn,{})})]})]}),p.jsx(ne,{label:a("effects.sub-emitter.inherit.label"),info:a("effects.sub-emitter.inherit.info"),children:p.jsxs(Me,{multiple:!0,value:x,placeholder:a("effects.sub-emitter.inherit.position"),noneText:a("effects.sub-emitter.inherit.position"),onValueChange:_=>{const T=(Array.isArray(_)?_:[_]).filter(Boolean);let O=ge.None;for(const A of T){const I=Nt.find(D=>D.key===A);I&&(O|=I.flag)}o(c,A=>{A.inheritProperties=O})},children:[p.jsx(Q,{value:"color",children:a("effects.sub-emitter.inherit.color")}),p.jsx(Q,{value:"size",children:a("effects.sub-emitter.inherit.size")}),p.jsx(Q,{value:"rotation",children:a("effects.sub-emitter.inherit.rotation")}),p.jsx(Q,{value:"velocity",children:a("effects.sub-emitter.inherit.velocity")})]})}),p.jsx(Ta,{label:a("effects.sub-emitter.probability.label"),info:a("effects.sub-emitter.probability.info"),min:0,max:1,dragStep:.01,value:i.emitProbability,onChange:_=>{o(c,T=>{T.emitProbability=_})}})]},c)},b=()=>{s(i=>{i.push(jn())}),u(n.length)},d=()=>{const i=r>=0&&r<n.length?r:n.length-1;i<0||(s(c=>{c.splice(i,1)}),u(Math.min(i,n.length-2)))};return p.jsx(ne,{label:"",direction:"column",children:p.jsxs(_e,{gap:"xs",wrap:"false",css:{width:"100%",alignItems:"stretch"},children:[p.jsx(On,{children:n.length===0?p.jsx(Rn,{children:a("effects.sub-emitter.empty")}):n.map((i,c)=>g(i,c))}),p.jsxs(_e,{direction:"column",gap:"xs",children:[p.jsx(ce,{variant:"soft",onClick:b,css:{flex:1},children:p.jsx(xt,{size:"14px"})}),p.jsx(ce,{variant:"soft",onClick:d,css:{flex:1},children:p.jsx(gt,{size:"14px"})})]})]})})}),ta=(t,e,a)=>{var c,S;const n=t.engineObject.generator,r=n.subEmitters,u=t.root.sceneStore,s=t.id.startsWith("prefab:")?t.id.slice(0,t.id.lastIndexOf(":")+1):"",o=!!((S=(c=t.engineObject.engine)==null?void 0:c._hardwareRenderer)!=null&&S.isWebGL2),m=f=>{let x=u.getEntityModel(f.ownerId),C=f.componentId;if(!x&&s&&(x=u.getEntityModel(s+f.ownerId),C=s+f.componentId),!x)return null;const j=x.getComponentById(C);if(j)return j;const _=x.getComponentsByTypeName("ParticleRenderer");return _.length===1?_[0]:null},h=f=>{var j;const x=new Set,C=[f.generator];for(;C.length>0;){const _=C.pop();if(_===n)return!0;if(!x.has(_)){x.add(_);for(const T of _.subEmitters.subEmitters){const O=(j=T.emitter)==null?void 0:j.generator;O&&!x.has(O)&&C.push(O)}}}return!1},y=f=>{const x=f.emitter??null;if(!(x!=null&&x.ownerId)||!(x!=null&&x.componentId))return"skip";const C=m(x);if(!C||C.status!=="ready")return"pending";const j=C.engineObject;return f.type===Ye.Death&&!o?(console.warn("[sub-emitter] Death sub-emitter requires WebGL2 — binding skipped"),"skip"):h(j)?(console.warn("[sub-emitter] binding would create a sub-emitter cycle — binding skipped"),"skip"):{target:j}};let l=-1;const g=()=>{const f=[];let x=!1;for(const C of a){if(!C)continue;const j=y(C);j==="pending"?x=!0:j!=="skip"&&f.push({target:j.target,entry:C})}if(f.length!==l){for(l=f.length;r.subEmitters.length>0;)r.removeSubEmitterByIndex(r.subEmitters.length-1);for(const{target:C,entry:j}of f)r.addSubEmitter(C,j.type,j.inheritProperties,j.emitProbability)}return!x};let b=g();const d=typeof requestAnimationFrame<"u",i=f=>{b||f>120||!d||requestAnimationFrame(()=>{b=g(),i(f+1)})};i(0)},Dn=/^[A-Za-z0-9_]+$/;function aa(t){return typeof t=="string"&&Dn.test(t)}function Ln(t,e){const a=new Set(t);let n=1;for(;a.has(`${e}${n}`);)n++;return`${e}${n}`}function Vn(){return{module:"customData",mode:ee.Constant,constantMax:{r:1,g:1,b:1,a:1},constantMin:{r:1,g:1,b:1,a:1}}}function Bn(){return $("customData",0,0,F.Constant)}function Fn(t,e="Number"){return{name:t,mode:e,curve:Bn(),gradient:Vn()}}const $n=["constant","two-constant"],Yn=X(({model:t,inspectorConfig:e,onModelChange:a})=>{const{t:n}=Z(),{info:r}=e,u=t.customDataStreams,[s,o]=N.useState(-1),m=d=>{const i=Y(u);d(i),a==null||a("customDataStreams",i)},h=(d,i)=>{m(c=>{const S=c[d];S&&i(S)})},y=()=>{m(d=>{d.push(Fn(Ln(d.map(i=>i.name),"Param")))})},l=d=>{m(i=>{i.splice(d,1)})},g=[{title:n("effects.renderer.custom-data.name.label","Name"),width:"minmax(0, 0.7fr)"},{title:n("effects.renderer.custom-data.mode.label","Mode"),width:"96px"},{title:n("effects.renderer.custom-data.value.label","Value"),width:"minmax(0, 1.8fr)"}],b=(d,i)=>{const c=aa(d.name),S=u.findIndex((x,C)=>C!==i&&x.name===d.name)>=0,f=!c||S;return{data:d,cells:[p.jsx(ne,{children:p.jsx(Ia,{value:d.name,state:f?"invalid":void 0,placeholder:"GLSL identifier",onChange:x=>{const C=x.target.value;h(i,j=>{j.name=C})}})},`name-${i}`),p.jsx(ne,{children:p.jsxs(Me,{value:d.mode,position:"item-aligned",onValueChange:x=>{h(i,C=>{C.mode=x})},children:[p.jsx(Q,{value:"Number",children:n("effects.renderer.custom-data.mode.number","Number")}),p.jsx(Q,{value:"Color",children:n("effects.renderer.custom-data.mode.color","Color")})]})},`mode-${i}`),d.mode==="Number"?Nn(d,i,h):Xn(d,i,h)]}};return p.jsx(qt,{columns:g,items:u.map((d,i)=>b(d,i)),label:"",info:r?n(r):void 0,addable:!1,emptyText:n("effects.renderer.custom-data.streams.empty","No streams"),selectedIndex:s,onRowClick:o,sideSlot:p.jsxs(_e,{direction:"column",gap:"xs",children:[p.jsx(ce,{variant:"soft",onClick:y,css:{flex:1},children:p.jsx(xt,{size:"14px"})}),p.jsx(ce,{variant:"soft",css:{flex:1},onClick:()=>{const d=s>=0&&s<u.length?s:u.length-1;d>=0&&(l(d),o(Math.min(d,u.length-2)))},children:p.jsx(gt,{size:"14px"})})]})})});function Nn(t,e,a){const n=t.curve,r=Math.max(1,n.constantMax??0,Math.abs(n.constantMin??0));return p.jsx(Ie,{type:Ze[n.mode],direction:"column",algo:"linear",yRangeMode:"symmetric",yTickScale:r,yTickScaleMin:-r,yTickScaleMax:r,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:n.constantMax,type:"constant",step:.1},{value:[n.constantMin,n.constantMax],type:"two-constant",step:.1},{value:se(n.curveMax.constructParams),type:"curve"},{value:[se(n.curveMin.constructParams),se(n.curveMax.constructParams)],type:"two-curve"}],onValueChange:(u,s)=>{const o=u.find(m=>m.type===s);o&&a(e,m=>{const h=m.curve;switch(s){case"constant":h.mode=F.Constant,h.constantMax=o.value;break;case"two-constant":h.mode=F.TwoConstants,h.constantMin=o.value[0],h.constantMax=o.value[1];break;case"curve":h.mode=F.Curve,Array.isArray(o.value)&&o.value.length<=4&&o.value.forEach((y,l)=>{h.curveMax.constructParams[l]=h.curveMax.constructParams[l]??{class:"CurveKey",constructParams:[0,0]},h.curveMax.constructParams[l].constructParams[0]=y.x,h.curveMax.constructParams[l].constructParams[1]=y.y});break;case"two-curve":h.mode=F.TwoCurves,Array.isArray(o.value)&&o.value.length===2&&(o.value[0].forEach((y,l)=>{h.curveMin.constructParams[l]=h.curveMin.constructParams[l]??{class:"CurveKey",constructParams:[0,0]},h.curveMin.constructParams[l].constructParams[0]=y.x,h.curveMin.constructParams[l].constructParams[1]=y.y}),o.value[1].forEach((y,l)=>{h.curveMax.constructParams[l]=h.curveMax.constructParams[l]??{class:"CurveKey",constructParams:[0,0]},h.curveMax.constructParams[l].constructParams[0]=y.x,h.curveMax.constructParams[l].constructParams[1]=y.y}));break}})}},`number-${e}`)}function Xn(t,e,a){var s,o;const n=t.gradient,r={...le(n.constantMax),intensity:((s=n.constantMax)==null?void 0:s.intensity)??1},u={...le(n.constantMin),intensity:((o=n.constantMin)==null?void 0:o.intensity)??1};return p.jsx(St,{label:"",type:$n[n.mode===ee.TwoConstants?1:0],hdr:!0,value:[{value:r,type:"constant"},{value:[u,r],type:"two-constant"}],onValueChange:(m,h)=>{const y=m.find(l=>l.type===h);y&&a(e,l=>{switch(h){case"constant":l.gradient.mode=ee.Constant,l.gradient.constantMax=y.value;break;case"two-constant":l.gradient.mode=ee.TwoConstants,l.gradient.constantMin=y.value[0],l.gradient.constantMax=y.value[1];break}})}},`color-${e}`)}function na(t){const e=t==null?void 0:t.customData;return!e||!e.curves||!e.gradients||typeof e.addCurve!="function"?null:e}function Zn(t,e){t.mode=e.mode,t.constantMax=e.constantMax,t.constantMin=e.constantMin,t.curveMax=new Pe;for(const a of e.curveMax.constructParams)t.curveMax.addKey(new Ee(a.constructParams[0],a.constructParams[1]));t.curveMin=new Pe;for(const a of e.curveMin.constructParams)t.curveMin.addKey(new Ee(a.constructParams[0],a.constructParams[1]))}function qn(t,e){if(t.mode=e.mode,e.constantMax){const a=e.constantMax;t.constantMax=new Te(a.r,a.g,a.b,a.a)}if(e.constantMin){const a=e.constantMin;t.constantMin=new Te(a.r,a.g,a.b,a.a)}}function ra(t,e,a){var l;const n=na((l=t.engineObject)==null?void 0:l.generator);if(!n)return;const r=n.curves,u=n.gradients,s=[],o=[],m=new Set;for(const g of a)if(!(!aa(g.name)||m.has(g.name))){if(g.mode==="Color"){const b=g.gradient.mode;if(b!==ee.Constant&&b!==ee.TwoConstants)continue}m.add(g.name),g.mode==="Number"?s.push({name:g.name,entry:g}):o.push({name:g.name,entry:g})}const h=new Set(s.map(g=>g.name)),y=new Set(o.map(g=>g.name));for(const g of r.keys())h.has(g)||n.removeCurve(g);for(const g of u.keys())y.has(g)||n.removeGradient(g);for(const{name:g,entry:b}of s){r.has(g)||n.addCurve(g,new Gt(0));const d=n.curves.get(g);d&&Zn(d,b.curve)}for(const{name:g,entry:b}of o){u.has(g)||n.addGradient(g,new ka(new Te(1,1,1,1)));const d=n.gradients.get(g);d&&qn(d,b.gradient)}}var Gn=Object.defineProperty,Kn=Object.getOwnPropertyDescriptor,E=(t,e,a,n)=>{for(var r=n>1?void 0:n?Kn(e,a):e,u=t.length-1,s;u>=0;u--)(s=t[u])&&(r=(n?s(e,a,r):s(r))||r);return n&&r&&Gn(e,a,r),r};function Xt(t){return!!(t&&typeof t=="object"&&Array.isArray(t.constructParams))}function R(t,e,a){if(t==null)return{...Y(a),module:e};if(typeof t=="number")return $(e,t,t,F.Constant);const n=typeof t.mode=="number"?t.mode:a.mode,r=typeof t.constantMax=="number"?t.constantMax:a.constantMax,u=typeof t.constantMin=="number"?t.constantMin:a.constantMin,s=$(e,r,u,n);return Xt(t.curveMax)&&(s.curveMax=Y(t.curveMax)),Xt(t.curveMin)&&(s.curveMin=Y(t.curveMin)),s}let P=class extends Ra{constructor(e,a){super(e,a);M(this,"_subEmittersOwnedBySerializedModel",!1);M(this,"_emissionModuleEnabled",!0);M(this,"_emissionShapeModuleEnabled",!0);M(this,"_rotationOverLifetimeModuleEnabled",!1);M(this,"_sizeOverLifetimeModuleEnabled",!1);M(this,"_textureSheetAnimationModuleEnabled",!1);M(this,"_velocityOverLifetimeModuleEnabled",!1);M(this,"_forceOverLifetimeModuleEnabled",!1);M(this,"_limitVelocityOverLifetimeModuleEnabled",!1);M(this,"_colorOverLifetimeModuleEnabled",!1);M(this,"_noiseModuleEnabled",!1);M(this,"_subEmittersModuleEnabled",!1);M(this,"_customDataModuleEnabled",!1);M(this,"material",{refId:"0000202"});M(this,"priority",0);M(this,"velocityScale",0);M(this,"lengthScale",2);M(this,"pivot",{x:0,y:0,z:0});M(this,"renderMode",J.Billboard);M(this,"mesh",null);M(this,"duration",5);M(this,"isLoop",!0);M(this,"startDelay",$("main"));M(this,"startLifetime",$("main",5));M(this,"startSpeed",$("main",5));M(this,"startSize",ye("main",1));M(this,"startRotation",ye("main"));M(this,"flipRotation",0);M(this,"startColor",{module:"main",mode:ee.Constant,constantMax:{r:1,g:1,b:1,a:1,intensity:1},constantMin:{r:1,g:1,b:1,a:1,intensity:1}});M(this,"gravityModifier",$("main"));M(this,"simulationSpace",K.Local);M(this,"simulationSpeed",1);M(this,"scalingMode",je.Local);M(this,"playOnEnabled",!0);M(this,"maxParticles",1e3);M(this,"rateOverTime",$("emission",10));M(this,"shape",{class:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:Se.Base,enabled:!0}});M(this,"bursts",[]);M(this,"size",ye("sizeOverLifetime",1));M(this,"rotation",ye("rotationOverLifetime",45));M(this,"textureSheetAnimationType",0);M(this,"cycleCount",1);M(this,"tiling",{x:1,y:1});M(this,"frameOverTime",$("textureSheetAnimation",1,0,F.Curve));M(this,"spaceMode",K.Local);M(this,"forceSpaceMode",K.Local);M(this,"velocityX",$("velocityOverLifetime"));M(this,"velocityY",$("velocityOverLifetime"));M(this,"velocityZ",$("velocityOverLifetime"));M(this,"speed",ye("limitVelocityOverLifetime",1));M(this,"limitVelocitySpaceMode",K.Local);M(this,"dampen",0);M(this,"drag",$("limitVelocityOverLifetime"));M(this,"multiplyDragByParticleSize",!1);M(this,"multiplyDragByParticleVelocity",!1);M(this,"forceX",$("forceOverLifetime"));M(this,"forceY",$("forceOverLifetime"));M(this,"forceZ",$("forceOverLifetime"));M(this,"color",Ft());M(this,"noisePreview",null);M(this,"noiseStrength",ye("noise",1));M(this,"noiseFrequency",.5);M(this,"noiseScrollSpeed",0);M(this,"noiseOctaveCount",1);M(this,"noiseOctaveIntensityMultiplier",.5);M(this,"noiseOctaveFrequencyMultiplier",2);M(this,"subEmitters",[]);M(this,"customDataStreams",[]);const n=this.formSchema,r=(s,o,m,h,y,l)=>{const g=v(s);n.addGroup(g,o,{controlOpenKey:m,defaultOpen:l,sectionTitle:{title:g,onToggle:b=>{y==null||y(b),this.root.inspectorFacade.componentChange(this.id,m,b),this.applyBoundPathChange(h,L.Toggle,b)}}})};r("effects.renderer.sections.emission",["rateOverTime","bursts"],"_emissionModuleEnabled","generator.emission.enabled"),r("effects.renderer.sections.shape",["shape"],"_emissionShapeModuleEnabled","generator.emission.shape.enabled",s=>{this.shape.props.enabled=s}),r("effects.renderer.sections.size-over-lifetime",["size"],"_sizeOverLifetimeModuleEnabled","generator.sizeOverLifetime.enabled"),r("effects.renderer.sections.rotation-over-lifetime",["rotation"],"_rotationOverLifetimeModuleEnabled","generator.rotationOverLifetime.enabled"),r("effects.renderer.sections.force-over-lifetime",["forceSpaceMode","forceX","forceY","forceZ"],"_forceOverLifetimeModuleEnabled","generator.forceOverLifetime.enabled"),r("effects.renderer.sections.velocity-over-lifetime",["spaceMode","velocityX","velocityY","velocityZ"],"_velocityOverLifetimeModuleEnabled","generator.velocityOverLifetime.enabled"),r("effects.renderer.sections.limit-velocity-over-lifetime",["speed","limitVelocitySpaceMode","dampen","drag","multiplyDragByParticleSize","multiplyDragByParticleVelocity"],"_limitVelocityOverLifetimeModuleEnabled","generator.limitVelocityOverLifetime.enabled"),r("effects.renderer.sections.texture-sheet-animation",["textureSheetAnimationType","cycleCount","tiling","frameOverTime"],"_textureSheetAnimationModuleEnabled","generator.textureSheetAnimation.enabled"),r("effects.renderer.sections.color-over-lifetime",["color"],"_colorOverLifetimeModuleEnabled","generator.colorOverLifetime.enabled"),r("effects.renderer.sections.noise",["noisePreview","noiseStrength","noiseFrequency","noiseScrollSpeed","noiseOctaveCount","noiseOctaveIntensityMultiplier","noiseOctaveFrequencyMultiplier"],"_noiseModuleEnabled","generator.noise.enabled"),r("effects.renderer.sections.sub-emitters",["subEmitters"],"_subEmittersModuleEnabled","generator.subEmitters.enabled"),r("effects.renderer.sections.custom-data",["customDataStreams"],"_customDataModuleEnabled","generator.customData.enabled");const u=v("effects.renderer.sections.rendering");n.addGroup(u,["renderMode","mesh","material","velocityScale","lengthScale","pivot","priority"],{sectionTitle:{title:u}})}applyEmissionShape(e){this.applyBoundPathChange("generator.emission.shape",L.Input,e)}onInitComplete(){this._applyEditorRuntimeState()}applyPropertyFromDomain(e,a){e==="subEmitters"&&(this._subEmittersOwnedBySerializedModel=!0),super.applyPropertyFromDomain(e,a)}_applyRendererMeshFromRef(){this.applyBoundPathChange("mesh",L.AssetPicker,this.mesh??null)}_applyEditorRuntimeState(){const{_engineObject:{generator:e}}=this;if(this.applyBoundPathChange("enabled",L.Toggle,this._enabled),this.applyBoundPathChange("renderMode",L.Select,this.renderMode),e.emission.enabled=this._emissionModuleEnabled,e.emission.shape.enabled=this._emissionShapeModuleEnabled,this.shape.class===B.MeshShape){const n=e.emission.shape,r=this.shape.props.mesh;r?(n.enabled=!1,Wa(this.root,r).then(()=>{this.applyBoundPathChange("generator.emission.shape.mesh",L.AssetPicker,r),n.enabled=this._emissionShapeModuleEnabled})):this.applyBoundPathChange("generator.emission.shape.mesh",L.Input,Zt.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._syncSubEmittersToEngine("editor-runtime-replay");const a=na(e);a&&(a.enabled=this._customDataModuleEnabled,ra(this,"customDataStreams",this.customDataStreams)),this.renderMode===J.Mesh&&this._applyRendererMeshFromRef()}_hasExplicitSubEmittersPrefabOverride(){var s,o,m,h,y,l,g,b,d,i,c;const e=(o=(s=this.root.domainStore).getNormalizedState)==null?void 0:o.call(s);if(!e||!this.entityModelId)return null;const a=(h=(m=e.entities[this.entityModelId])==null?void 0:m.instance)==null?void 0:h.bindingId;if(!a)return null;const n=Aa(e,this.entityModelId),r=(l=(y=Da(e,this.entityModelId,this.id))==null?void 0:y.instance)==null?void 0:l.sourceComponentKey;if(!n||!r)return null;const u=(c=(i=(d=(b=(g=e.prefab.bindings)==null?void 0:g[a])==null?void 0:b.overrides)==null?void 0:d.componentProps)==null?void 0:i[n])==null?void 0:c[r];return Object.prototype.hasOwnProperty.call(u??{},"subEmitters")}_shouldPreserveInheritedSubEmitterSlots(){if(!this._engineObject||this.subEmitters.length>0||this._engineObject.generator.subEmitters.subEmitters.length===0)return!1;const e=this._hasExplicitSubEmittersPrefabOverride();return e!==null?!e:!this._subEmittersOwnedBySerializedModel}_syncSubEmittersToEngine(e="domain-sync"){if(!this._engineObject)return;const a=this._engineObject.generator.subEmitters;e==="editor-runtime-replay"&&this._shouldPreserveInheritedSubEmitterSlots()||(a.enabled=this._subEmittersModuleEnabled,ta(this,"subEmitters",this.subEmitters))}async bindEngineObject(e){e.enabled=!1,await super.bindEngineObject(e)}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1,this._applyEditorRuntimeState()}deserialize(e){var n,r,u;const a=e.props;if(this._subEmittersOwnedBySerializedModel=Object.prototype.hasOwnProperty.call((a==null?void 0:a.generator)??{},"subEmitters"),this._enabled=(a==null?void 0:a.enabled)??!0,a!=null&&a.generator){this.priority=a.priority??this.priority,this.velocityScale=a.velocityScale??this.velocityScale,this.lengthScale=a.lengthScale??this.lengthScale,this.pivot=a.pivot??this.pivot,this.renderMode=a.renderMode??this.renderMode,this.mesh=a.mesh??null;const{main:s,emission:o,sizeOverLifetime:m,rotationOverLifetime:h,velocityOverLifetime:y,limitVelocityOverLifetime:l,colorOverLifetime:g,textureSheetAnimation:b,forceOverLifetime:d,noise:i,customData:c}=a.generator;this.duration=(s==null?void 0:s.duration)??this.duration,this.isLoop=(s==null?void 0:s.isLoop)??this.isLoop,this.startDelay=R(s==null?void 0:s.startDelay,"main",this.startDelay),this.startLifetime=R(s==null?void 0:s.startLifetime,"main",this.startLifetime),this.startSpeed=R(s==null?void 0:s.startSpeed,"main",this.startSpeed),this.startSize.enabled=(s==null?void 0:s.startSize3D)??this.startSize.enabled,this.startSize.x=R((s==null?void 0:s.startSizeX)??(s==null?void 0:s.startSize),"main",this.startSize.x),this.startSize.y=R((s==null?void 0:s.startSizeY)??(s==null?void 0:s.startSize),"main",this.startSize.y),this.startSize.z=R((s==null?void 0:s.startSizeZ)??(s==null?void 0:s.startSize),"main",this.startSize.z),this.startRotation.enabled=(s==null?void 0:s.startRotation3D)??this.startRotation.enabled,this.startRotation.x=R(s==null?void 0:s.startRotationX,"main",this.startRotation.x),this.startRotation.y=R(s==null?void 0:s.startRotationY,"main",this.startRotation.y),this.startRotation.z=R(s==null?void 0:s.startRotationZ,"main",this.startRotation.z),this.flipRotation=(s==null?void 0:s.flipRotation)??this.flipRotation,this.startColor=(s==null?void 0:s.startColor)??this.startColor,this.gravityModifier=R(s==null?void 0:s.gravityModifier,"main",this.gravityModifier),this.simulationSpace=(s==null?void 0:s.simulationSpace)??this.simulationSpace,this.simulationSpeed=(s==null?void 0:s.simulationSpeed)??this.simulationSpeed,this.scalingMode=(s==null?void 0:s.scalingMode)??this.scalingMode,this.playOnEnabled=(s==null?void 0:s.playOnEnabled)??this.playOnEnabled,this.maxParticles=(s==null?void 0:s.maxParticles)??this.maxParticles,this._emissionModuleEnabled=(o==null?void 0:o.enabled)??this._emissionModuleEnabled,this.rateOverTime=R(o==null?void 0:o.rateOverTime,"emission",this.rateOverTime),(o==null?void 0:o.shape)===null||((n=o==null?void 0:o.shape)==null?void 0:n.class)==="Null"?(this.shape={class:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:Se.Base,enabled:!1}},this._emissionShapeModuleEnabled=!1):(this.shape=(o==null?void 0:o.shape)??this.shape,this._emissionShapeModuleEnabled=((u=(r=o==null?void 0:o.shape)==null?void 0:r.props)==null?void 0:u.enabled)??this._emissionShapeModuleEnabled),this.bursts=Array.isArray(o==null?void 0:o.bursts)?o.bursts.map(C=>(pn(C),C)):[],this._sizeOverLifetimeModuleEnabled=(m==null?void 0:m.enabled)??this._sizeOverLifetimeModuleEnabled,this.size.enabled=(m==null?void 0:m.separateAxes)??this.size.enabled,this.size.x=R((m==null?void 0:m.sizeX)??(m==null?void 0:m.size),"sizeOverLifetime",this.size.x),this.size.y=R((m==null?void 0:m.sizeY)??(m==null?void 0:m.size),"sizeOverLifetime",this.size.y),this.size.z=R((m==null?void 0:m.sizeZ)??(m==null?void 0:m.size),"sizeOverLifetime",this.size.z),this._rotationOverLifetimeModuleEnabled=(h==null?void 0:h.enabled)??this._rotationOverLifetimeModuleEnabled,this.rotation.enabled=(h==null?void 0:h.separateAxes)??this.rotation.enabled,this.rotation.x=R(h==null?void 0:h.rotationX,"rotationOverLifetime",this.rotation.x),this.rotation.y=R(h==null?void 0:h.rotationY,"rotationOverLifetime",this.rotation.y),this.rotation.z=R(h==null?void 0:h.rotationZ,"rotationOverLifetime",this.rotation.z),this._velocityOverLifetimeModuleEnabled=(y==null?void 0:y.enabled)??this._velocityOverLifetimeModuleEnabled,this.velocityX=R(y==null?void 0:y.velocityX,"velocityOverLifetime",this.velocityX),this.velocityY=R(y==null?void 0:y.velocityY,"velocityOverLifetime",this.velocityY),this.velocityZ=R(y==null?void 0:y.velocityZ,"velocityOverLifetime",this.velocityZ),this.spaceMode=(y==null?void 0:y.space)??this.spaceMode,this._limitVelocityOverLifetimeModuleEnabled=(l==null?void 0:l.enabled)??this._limitVelocityOverLifetimeModuleEnabled,this.speed.enabled=(l==null?void 0:l.separateAxes)??this.speed.enabled;const S=(l==null?void 0:l.speedX)??(l==null?void 0:l.speed);this.speed.x=R(S,"limitVelocityOverLifetime",this.speed.x),this.speed.y=R(l==null?void 0:l.speedY,"limitVelocityOverLifetime",this.speed.y),this.speed.z=R(l==null?void 0:l.speedZ,"limitVelocityOverLifetime",this.speed.z),this.dampen=(l==null?void 0:l.dampen)??this.dampen,this.drag=R(l==null?void 0:l.drag,"limitVelocityOverLifetime",this.drag),this.multiplyDragByParticleSize=(l==null?void 0:l.multiplyDragByParticleSize)??this.multiplyDragByParticleSize,this.multiplyDragByParticleVelocity=(l==null?void 0:l.multiplyDragByParticleVelocity)??this.multiplyDragByParticleVelocity,this.limitVelocitySpaceMode=(l==null?void 0:l.space)??this.limitVelocitySpaceMode,this._forceOverLifetimeModuleEnabled=(d==null?void 0:d.enabled)??this._forceOverLifetimeModuleEnabled,this.forceX=R(d==null?void 0:d.forceX,"forceOverLifetime",this.forceX),this.forceY=R(d==null?void 0:d.forceY,"forceOverLifetime",this.forceY),this.forceZ=R(d==null?void 0:d.forceZ,"forceOverLifetime",this.forceZ),this.forceSpaceMode=(d==null?void 0:d.space)??this.forceSpaceMode,g?(this._colorOverLifetimeModuleEnabled=g.enabled??this._colorOverLifetimeModuleEnabled,this.color=g.color??this.color):(this._colorOverLifetimeModuleEnabled=!0,this.color=Ft()),this._textureSheetAnimationModuleEnabled=(b==null?void 0:b.enabled)??this._textureSheetAnimationModuleEnabled,this.textureSheetAnimationType=(b==null?void 0:b.type)??this.textureSheetAnimationType,this.cycleCount=(b==null?void 0:b.cycleCount)??this.cycleCount,this.tiling=(b==null?void 0:b.tiling)??this.tiling,this.frameOverTime=R(b==null?void 0:b.frameOverTime,"textureSheetAnimation",this.frameOverTime);const f=e.props.generator.subEmitters;this._subEmittersModuleEnabled=(f==null?void 0:f.enabled)??!1,this.subEmitters=Array.isArray(f==null?void 0:f.subEmitters)?Y(f.subEmitters):[],this._noiseModuleEnabled=(i==null?void 0:i.enabled)??this._noiseModuleEnabled,this.noiseStrength.enabled=(i==null?void 0:i.separateAxes)??this.noiseStrength.enabled;const x=i==null?void 0:i.strengthX;this.noiseStrength.x=R(x,"noise",this.noiseStrength.x),this.noiseStrength.y=R(i==null?void 0:i.strengthY,"noise",this.noiseStrength.y),this.noiseStrength.z=R(i==null?void 0:i.strengthZ,"noise",this.noiseStrength.z),this.noiseFrequency=(i==null?void 0:i.frequency)??this.noiseFrequency,this.noiseScrollSpeed=(i==null?void 0:i.scrollSpeed)??this.noiseScrollSpeed,this.noiseOctaveCount=(i==null?void 0:i.octaveCount)??this.noiseOctaveCount,this.noiseOctaveIntensityMultiplier=(i==null?void 0:i.octaveIntensityMultiplier)??this.noiseOctaveIntensityMultiplier,this.noiseOctaveFrequencyMultiplier=(i==null?void 0:i.octaveFrequencyMultiplier)??this.noiseOctaveFrequencyMultiplier,this._customDataModuleEnabled=(c==null?void 0:c.enabled)??this._customDataModuleEnabled,this.customDataStreams=Array.isArray(c==null?void 0:c.streams)?c.streams:this.customDataStreams}super.deserialize(e)}toJSON(){const e=this.bursts.map(n=>{var u;if(((u=n==null?void 0:n.constructParams)==null?void 0:u[2])!==1/0)return n;const r=Y(n);return r.constructParams[2]=null,r});return{type:this.type,props:La({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},subEmitters:{enabled:this._subEmittersModuleEnabled,subEmitters:this.subEmitters},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},customData:{enabled:this._customDataModuleEnabled,streams:this.customDataStreams}}})}}};E([te],P.prototype,"_emissionModuleEnabled",2);E([te],P.prototype,"_emissionShapeModuleEnabled",2);E([te],P.prototype,"_rotationOverLifetimeModuleEnabled",2);E([te],P.prototype,"_sizeOverLifetimeModuleEnabled",2);E([te],P.prototype,"_textureSheetAnimationModuleEnabled",2);E([te],P.prototype,"_velocityOverLifetimeModuleEnabled",2);E([te],P.prototype,"_forceOverLifetimeModuleEnabled",2);E([te],P.prototype,"_limitVelocityOverLifetimeModuleEnabled",2);E([te],P.prototype,"_colorOverLifetimeModuleEnabled",2);E([te],P.prototype,"_noiseModuleEnabled",2);E([te],P.prototype,"_subEmittersModuleEnabled",2);E([te],P.prototype,"_customDataModuleEnabled",2);E([V({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:Va.ReferResource,getEngineValue:t=>t.getMaterial()}),z({type:L.AssetPicker,assetType:"Material",customFilter:t=>{var e;return((e=t.engineObject.shader)==null?void 0:e.name)==="Effect/Particle"},priority:-100,label:v("effects.renderer.material.label"),info:v("effects.renderer.material.info")}),w()],P.prototype,"material",2);E([z({bindPath:"priority",min:0,step:1,dragStep:1,priority:-100,label:v("effects.renderer.priority.label"),info:v("effects.renderer.priority.info")}),w()],P.prototype,"priority",2);E([z({bindPath:"velocityScale",priority:-100,label:v("effects.renderer.velocity-scale.label"),info:v("effects.renderer.velocity-scale.info"),when:t=>t.renderMode===J.StretchBillboard}),w()],P.prototype,"velocityScale",2);E([z({bindPath:"lengthScale",priority:-100,label:v("effects.renderer.length-scale.label"),info:v("effects.renderer.length-scale.info"),when:t=>t.renderMode===J.StretchBillboard}),w()],P.prototype,"lengthScale",2);E([z({type:L.Vector3,bindPath:"pivot",label:v("effects.renderer.pivot.label"),priority:-100}),w()],P.prototype,"pivot",2);E([V({getPath:"renderMode",setPath:"renderMode"}),z({type:L.Select,value:J.Billboard,label:v("effects.renderer.render-mode.label"),options:[{label:v("effects.renderer.render-mode.options.billboard"),value:J.Billboard},{label:v("effects.renderer.render-mode.options.stretch-billboard"),value:J.StretchBillboard},{label:v("effects.renderer.render-mode.options.horizontal-billboard"),value:J.HorizontalBillboard},{label:v("effects.renderer.render-mode.options.mesh"),value:J.Mesh},{label:v("effects.renderer.render-mode.options.none"),value:J.None}],onChange(t){t.renderMode===J.Mesh&&t._applyRendererMeshFromRef()},priority:-100}),w()],P.prototype,"renderMode",2);E([z({type:L.AssetPicker,assetType:"Mesh",label:v("effects.renderer.mesh.label"),info:v("effects.renderer.mesh.info"),when:t=>t.renderMode===J.Mesh,onChange:async(t,e,a)=>{t.mesh=a?a.getCurrentRef():null;try{await t.applyBoundPathChange("mesh",L.AssetPicker,t.mesh)}catch(n){console.warn(n)}},priority:-100}),w()],P.prototype,"mesh",2);E([V({getPath:"generator.main.duration",setPath:"generator.main.duration"}),z({bindPath:"generator.main.duration",min:.05,step:.05,dragStep:.05,label:v("effects.renderer.duration.label"),info:v("effects.renderer.duration.info")}),w()],P.prototype,"duration",2);E([V({getPath:"generator.main.isLoop",setPath:"generator.main.isLoop"}),z({bindPath:"generator.main.isLoop",label:v("effects.renderer.loop.label"),info:v("effects.renderer.loop.info")}),w()],P.prototype,"isLoop",2);E([z({customComponent:W,min:0,yRangeMode:"positive",onChange:H,info:v("effects.renderer.start.delay.info"),label:v("effects.renderer.start.delay.label")}),w()],P.prototype,"startDelay",2);E([z({customComponent:W,onChange:H,min:1e-4,yRangeMode:"positive",label:v("effects.renderer.start.lifetime.label"),info:v("effects.renderer.start.lifetime.info")}),w()],P.prototype,"startLifetime",2);E([z({customComponent:W,onChange:H,label:v("effects.renderer.start.speed.label")}),w()],P.prototype,"startSpeed",2);E([z({module:"main",toggleProps:"startSize3D",axisX:"startSizeX",axisY:"startSizeY",axisZ:"startSizeZ",mainAxis:"x",customComponent:ze,onChange:we("startSize3D"),label:v("effects.renderer.start.size.label"),info:v("effects.renderer.start.size.info"),min:0,yRangeMode:"positive"}),w()],P.prototype,"startSize",2);E([z({module:"main",toggleProps:"startRotation3D",axisX:"startRotationX",axisY:"startRotationY",axisZ:"startRotationZ",mainAxis:"z",customComponent:ze,onChange:we("startRotation3D"),label:v("effects.renderer.start.rotation.label"),info:v("effects.renderer.start.rotation.info"),step:1}),w()],P.prototype,"startRotation",2);E([V({getPath:"generator.main.flipRotation",setPath:"generator.main.flipRotation"}),z({bindPath:"generator.main.flipRotation",min:0,max:1,step:.05,dragStep:.05,label:v("effects.renderer.flip-rotation.label")}),w()],P.prototype,"flipRotation",2);E([z({customComponent:xn,onChange:Sn,label:v("effects.renderer.start.color.label")}),w()],P.prototype,"startColor",2);E([z({customComponent:W,info:v("effects.renderer.gravity-modifier.info"),onChange:H,label:v("effects.renderer.gravity-modifier.label")}),w()],P.prototype,"gravityModifier",2);E([V({getPath:"generator.main.simulationSpace",setPath:"generator.main.simulationSpace"}),z({type:L.Select,bindPath:"generator.main.simulationSpace",value:K.Local,label:v("effects.renderer.simulation.space.label"),info:v("effects.renderer.simulation.space.info"),options:[{label:v("effects.renderer.simulation.space.options.local"),value:K.Local},{label:v("effects.renderer.simulation.space.options.world"),value:K.World}]}),w()],P.prototype,"simulationSpace",2);E([V({getPath:"generator.main.simulationSpeed",setPath:"generator.main.simulationSpeed"}),z({bindPath:"generator.main.simulationSpeed",step:.05,dragStep:.05,label:v("effects.renderer.simulation.speed.label"),info:v("effects.renderer.simulation.speed.info")}),w()],P.prototype,"simulationSpeed",2);E([V({getPath:"generator.main.scalingMode",setPath:"generator.main.scalingMode"}),z({type:L.Select,bindPath:"generator.main.scalingMode",label:v("effects.renderer.scaling-mode.label"),info:v("effects.renderer.scaling-mode.info"),value:je.Local,options:[{label:v("effects.renderer.scaling-mode.options.world"),value:je.World},{label:v("effects.renderer.scaling-mode.options.local"),value:je.Local},{label:v("effects.renderer.scaling-mode.options.shape"),value:je.Shape}]}),w()],P.prototype,"scalingMode",2);E([V({getPath:"generator.main.playOnEnabled",setPath:"generator.main.playOnEnabled"}),z({type:L.Toggle,bindPath:"generator.main.playOnEnabled",label:v("effects.renderer.play-on-enabled.label"),info:v("effects.renderer.play-on-enabled.info")}),w()],P.prototype,"playOnEnabled",2);E([V({getPath:"generator.main.maxParticles",setPath:"generator.main.maxParticles"}),z({type:L.Number,bindPath:"generator.main.maxParticles",min:1,dragStep:1,label:v("effects.renderer.max-particles.label"),info:v("effects.renderer.max-particles.info")}),w()],P.prototype,"maxParticles",2);E([z({customComponent:W,onChange:H,min:0,yRangeMode:"positive",label:v("effects.renderer.rate-over-time.label"),info:v("effects.renderer.rate-over-time.info")}),w()],P.prototype,"rateOverTime",2);E([z({customComponent:ln,onChange:sn}),w()],P.prototype,"shape",2);E([w(),z({label:v("effects.renderer.bursts.label"),info:v("effects.renderer.bursts.info"),customComponent:yn,onChange:bn})],P.prototype,"bursts",2);E([z({module:"sizeOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"sizeX",axisY:"sizeY",axisZ:"sizeZ",mainAxis:"x",customComponent:ze,onChange:we("separateAxes"),min:0,yRangeMode:"positive",label:v("effects.renderer.over-lifetime.size.label")}),w()],P.prototype,"size",2);E([z({module:"rotationOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"rotationX",axisY:"rotationY",axisZ:"rotationZ",mainAxis:"z",customComponent:ze,onChange:we("separateAxes"),step:1,yTickScale:45,label:v("effects.renderer.over-lifetime.rotation.label")}),w()],P.prototype,"rotation",2);E([V({getPath:"generator.textureSheetAnimation.type",setPath:"generator.textureSheetAnimation.type"}),z({type:L.Select,value:0,label:v("effects.renderer.texture-sheet.type.label"),info:v("effects.renderer.texture-sheet.type.info"),options:[{label:v("effects.renderer.texture-sheet.type.options.whole-sheet"),value:0},{label:v("effects.renderer.texture-sheet.type.options.single-row"),value:1}]}),w()],P.prototype,"textureSheetAnimationType",2);E([V({getPath:"generator.textureSheetAnimation.cycleCount",setPath:"generator.textureSheetAnimation.cycleCount"}),z({bindPath:"generator.textureSheetAnimation.cycleCount",min:1e-4,step:1,dragStep:1,label:v("effects.renderer.texture-sheet.cycle-count.label"),info:v("effects.renderer.texture-sheet.cycle-count.info")}),w()],P.prototype,"cycleCount",2);E([z({type:L.Vector2,min:1,label:v("effects.renderer.texture-sheet.tiling.label"),info:v("effects.renderer.texture-sheet.tiling.info"),onChange(t,e,a){t.applyBoundPathChange("generator.textureSheetAnimation.tiling",L.Vector2,a)}}),w()],P.prototype,"tiling",2);E([z({customComponent:W,onChange:H,min:0,max:1,yRangeMode:"positive",label:v("effects.renderer.over-lifetime.frame.label")}),w()],P.prototype,"frameOverTime",2);E([V({getPath:"generator.velocityOverLifetime.space",setPath:"generator.velocityOverLifetime.space"}),z({type:L.Select,bindPath:"generator.velocityOverLifetime.space",value:0,label:v("effects.renderer.space-mode.label"),info:v("effects.renderer.space-mode.info"),options:[{label:v("effects.renderer.space-mode.options.local"),value:K.Local},{label:v("effects.renderer.space-mode.options.world"),value:K.World}]}),w()],P.prototype,"spaceMode",2);E([V({getPath:"generator.forceOverLifetime.space",setPath:"generator.forceOverLifetime.space"}),z({type:L.Select,bindPath:"generator.forceOverLifetime.space",value:0,label:v("effects.renderer.space-mode.label"),info:v("effects.renderer.space-mode.info-force"),options:[{label:"Local",value:K.Local},{label:"World",value:K.World}]}),w()],P.prototype,"forceSpaceMode",2);E([z({customComponent:W,onChange:H,label:v("effects.renderer.velocity.x.label"),info:v("effects.renderer.velocity.x.info")}),w()],P.prototype,"velocityX",2);E([z({customComponent:W,onChange:H,label:v("effects.renderer.velocity.y.label")}),w()],P.prototype,"velocityY",2);E([z({customComponent:W,onChange:H,label:v("effects.renderer.velocity.z.label")}),w()],P.prototype,"velocityZ",2);E([z({module:"limitVelocityOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"speedX",axisY:"speedY",axisZ:"speedZ",mainAxis:"x",customComponent:ze,onChange:we("separateAxes"),min:0,yRangeMode:"positive",label:v("effects.renderer.limit-velocity.limit.label")}),w()],P.prototype,"speed",2);E([V({getPath:"generator.limitVelocityOverLifetime.space",setPath:"generator.limitVelocityOverLifetime.space"}),z({type:L.Select,bindPath:"generator.limitVelocityOverLifetime.space",value:0,when:t=>t.speed.enabled,label:v("effects.renderer.space-mode.label"),info:v("effects.renderer.limit-velocity.space.info"),options:[{label:v("effects.renderer.space-mode.options.local"),value:K.Local},{label:v("effects.renderer.space-mode.options.world"),value:K.World}]}),w()],P.prototype,"limitVelocitySpaceMode",2);E([V({getPath:"generator.limitVelocityOverLifetime.dampen",setPath:"generator.limitVelocityOverLifetime.dampen"}),z({bindPath:"generator.limitVelocityOverLifetime.dampen",min:0,max:1,step:.01,dragStep:.01,label:v("effects.renderer.limit-velocity.dampen.label"),info:v("effects.renderer.limit-velocity.dampen.info")}),w()],P.prototype,"dampen",2);E([z({customComponent:W,onChange:H,min:0,yRangeMode:"positive",label:v("effects.renderer.limit-velocity.drag.label"),info:v("effects.renderer.limit-velocity.drag.info")}),w()],P.prototype,"drag",2);E([V({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize"}),z({type:L.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",label:v("effects.renderer.limit-velocity.multiply-drag-by-size.label"),info:v("effects.renderer.limit-velocity.multiply-drag-by-size.info")}),w()],P.prototype,"multiplyDragByParticleSize",2);E([V({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity"}),z({type:L.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",label:v("effects.renderer.limit-velocity.multiply-drag-by-velocity.label"),info:v("effects.renderer.limit-velocity.multiply-drag-by-velocity.info")}),w()],P.prototype,"multiplyDragByParticleVelocity",2);E([z({customComponent:W,onChange:H}),w()],P.prototype,"forceX",2);E([z({customComponent:W,onChange:H}),w()],P.prototype,"forceY",2);E([z({customComponent:W,onChange:H}),w()],P.prototype,"forceZ",2);E([z({customComponent:Pn,onChange:En,label:v("effects.renderer.color-over-lifetime.label")}),w()],P.prototype,"color",2);E([z({customComponent:zn,label:v("effects.renderer.noise.preview.label")})],P.prototype,"noisePreview",2);E([z({module:"noise",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"strengthX",axisY:"strengthY",axisZ:"strengthZ",mainAxis:"x",customComponent:ze,onChange:(t,e,a)=>{we("separateAxes")(t,"strength",a)},label:v("effects.renderer.noise.strength.label")}),w()],P.prototype,"noiseStrength",2);E([V({getPath:"generator.noise.frequency",setPath:"generator.noise.frequency"}),z({bindPath:"generator.noise.frequency",min:1e-6,step:.1,dragStep:.1,label:v("effects.renderer.noise.frequency.label")}),w()],P.prototype,"noiseFrequency",2);E([V({getPath:"generator.noise.scrollSpeed",setPath:"generator.noise.scrollSpeed"}),z({bindPath:"generator.noise.scrollSpeed",min:0,step:.01,dragStep:.01,label:v("effects.renderer.noise.scroll-speed.label")}),w()],P.prototype,"noiseScrollSpeed",2);E([V({getPath:"generator.noise.octaveCount",setPath:"generator.noise.octaveCount"}),z({bindPath:"generator.noise.octaveCount",min:1,max:3,step:1,dragStep:1,label:v("effects.renderer.noise.octave-count.label")}),w()],P.prototype,"noiseOctaveCount",2);E([V({getPath:"generator.noise.octaveIntensityMultiplier",setPath:"generator.noise.octaveIntensityMultiplier"}),z({bindPath:"generator.noise.octaveIntensityMultiplier",min:0,max:1,step:.01,dragStep:.01,when:t=>t.noiseOctaveCount>1,label:v("effects.renderer.noise.octave-intensity-multiplier.label")}),w()],P.prototype,"noiseOctaveIntensityMultiplier",2);E([V({getPath:"generator.noise.octaveFrequencyMultiplier",setPath:"generator.noise.octaveFrequencyMultiplier"}),z({bindPath:"generator.noise.octaveFrequencyMultiplier",min:1,max:4,step:.1,dragStep:.1,when:t=>t.noiseOctaveCount>1,label:v("effects.renderer.noise.octave-frequency-multiplier.label")}),w()],P.prototype,"noiseOctaveFrequencyMultiplier",2);E([z({customComponent:An,onChange:ta}),w()],P.prototype,"subEmitters",2);E([z({customComponent:Yn,onChange:ra,label:v("effects.renderer.custom-data.streams.label")}),w()],P.prototype,"customDataStreams",2);P=E([Ba({type:"ParticleRenderer",customInspector:Ka,componentsMenu:{group:"effects",label:v("component.particle-renderer.title")}})],P);export{P 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-eeedc550.js";import"./index-828538e1.js";import"./postmen-fe9eecc4.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var de=Object.defineProperty;var ye=(o,e,t)=>e in o?de(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(ye(o,typeof e!="symbol"?e+"":e,t),t);import{aJ as j,aK as z,aL as l,bn as X,cq as P,bl as re,eH as I,dt as ae,bC as me,q as he,cF as K,eI as $,eJ as Z,eK as L,eL as J,bL as N,f as ue,aE as fe,s as y,p as m,e as r,E as le,eM as W,eN as S,eO as B,C as h,eP as Y,eQ as be,eR as G,e3 as ce,eS as ge,eT as Ce,br as xe,cD as Q,bt as Se,bu as Pe}from"./index-eeedc550.js";import{r as H}from"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{c as F}from"./Component-85241517.js";import{F as je}from"./FormItemArray-a06224b4.js";const ve={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 k(o){const e={};return Object.keys(o.props).forEach(t=>{ve[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 ee(n[s],t[s]),te(n[s],t[s]);return}i.clearShapes();for(let s=0;s<t.length;s++){const a=t[s],d=_e(a);await ee(d,a),te(d,a),i.addShape(d)}};async function ee(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 Z;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 Z;case"SphereColliderShape":return new $}}function te(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 Z)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}}}}),Ae=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}})}})})}),Te=j(()=>l.jsx(l.Fragment,{})),Me=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})}})})}),we=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(re,{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:Ae,CapsuleColliderShape:we,PlaneColliderShape:Te,SphereColliderShape:Me},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(ae,{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(me,{label:t("physics.collider.material.title"),info:t("physics.collider.material.info"),dropLayer:he.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(re,{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(je,{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 le{constructor(){super(...arguments);p(this,"colliderShapes",[])}}$e([ue({engineKey:"addShape",editorKey:"colliderShapes",getPath:"shapes",valueType:fe.Object,getEngineValue:o=>o.shapes,getEditorValue:De,getActualEditorValue:o=>(Array.isArray(o)?o:[]).map(e=>({$type:e.class,...k(e)})),setActualEditorValue:(o,e,t)=>{const i=Array.isArray(t)?t:[];o.colliderShapes=i.map(n=>{if(n.class)return n;const{$type:s,...a}=n;return{class:s,props:a}})}}),y({type:"methods",key:"colliderShapes",canonicalizeToProps:!0,onSerialize:o=>o.map(e=>({$type:e.class,...k(e)})),onDeserialize:o=>o.map(e=>{const t=e;if(t.class)return t;const{$type:i,...n}=t;return{class:i,props:n}})}),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 ie=class extends R{constructor(o,e){super(o,e)}};ie=Re([F({type:"StaticCollider",componentsMenu:{group:"physics",label:"component.static-collider.title"}})],ie);const oe=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:oe(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:oe(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,Ze=Object.getOwnPropertyDescriptor,E=(o,e,t,i)=>{for(var n=i>1?void 0:i?Ze(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 w=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})],w.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"})],w.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})],w.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}]})],w.prototype,"nonWalkableMode",2);w=E([F({type:"CharacterController",componentsMenu:{label:r("component.physics.character.title"),group:"physics"}})],w);const Ge=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")),pe=U?{ownerId:O,componentId:U.id}:null;i==null||i(n,pe)},{t:b}=z(),x=Array.from(t.root.sceneStore.iterateEntityModels(),([,O])=>O);return l.jsx(l.Fragment,{children:l.jsx(be,{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,A=(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 le{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)}}A([y(),m({label:r("physics.joint.connected-collider.title"),info:r("physics.joint.connected-collider.info"),customComponent:Ge,bindPath:"connectedCollider"})],v.prototype,"connectedCollider",2);A([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);A([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);A([y(),m({label:r("physics.joint.connected-anchor.title"),type:h.Vector3,bindPath:"connectedAnchor",when:o=>!o.automaticConnectedAnchor})],v.prototype,"connectedAnchor",2);A([y(),m({label:r("physics.joint.break-force.title"),type:h.Number,bindPath:"breakForce"})],v.prototype,"breakForce",2);A([y(),m({label:r("physics.joint.break-torque.title"),type:h.Number,bindPath:"breakTorque"})],v.prototype,"breakTorque",2);A([y(),m({label:r("physics.joint.mass-scale.title"),type:h.Number,bindPath:"massScale"})],v.prototype,"massScale",2);A([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 ne=class extends v{constructor(o,e){super(o,e)}};ne=ke([F({type:"FixedJoint",componentsMenu:{label:r("component.physics.fixed-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:G.AutoAdd}})],ne);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(ce,{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(ce,{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(ae,{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,M=(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 ge;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 Ce;return i.targetVelocity=t.targetVelocity,i.forceLimit=t.forceLimit,i.gearRatio=t.gearRatio,i.freeSpin=t.freeSpin,i}};M([y(),m({label:r("physics.hinge-joint.axis.title"),type:h.Vector3,bindPath:"axis"})],D.prototype,"axis",2);M([y(),m({label:r("physics.hinge-joint.use-limits.title"),type:h.Boolean,bindPath:"useLimits"})],D.prototype,"useLimits",2);M([y(),m({label:r("physics.hinge-joint.use-spring.title"),type:h.Boolean,bindPath:"useSpring"})],D.prototype,"useSpring",2);M([y(),m({label:r("physics.hinge-joint.limits.title"),customComponent:et,bindPath:"limits"})],D.prototype,"limits",2);M([y(),m({label:r("physics.hinge-joint.use-motor.title"),type:h.Boolean,bindPath:"useMotor"})],D.prototype,"useMotor",2);M([y(),m({label:r("physics.hinge-joint.motor.title"),customComponent:tt,bindPath:"motor"})],D.prototype,"motor",2);D=M([F({type:"HingeJoint",componentsMenu:{label:r("component.physics.hinge-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:G.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 T=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"})],T.prototype,"spring",2);V([y(),m({label:r("physics.spring-joint.damper.title"),type:h.Number,bindPath:"damper"})],T.prototype,"damper",2);V([y(),m({label:r("physics.spring-joint.min-distance.title"),type:h.Number,bindPath:"minDistance"})],T.prototype,"minDistance",2);V([y(),m({label:r("physics.spring-joint.max-distance.title"),type:h.Number,bindPath:"maxDistance"})],T.prototype,"maxDistance",2);V([y(),m({label:r("physics.spring-joint.tolerance.title"),type:h.Number,bindPath:"tolerance"})],T.prototype,"tolerance",2);T=V([F({type:"SpringJoint",componentsMenu:{label:r("component.physics.spring-joint.title"),group:"physics"},dependentComponent:{type:"DynamicCollider",dependentMode:G.AutoAdd}})],T);class rt extends xe{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 se=class{constructor(){p(this,"script")}init(){this.script=Se.addScript(rt)}};se=ct([Pe({type:"physicsStore"})],se);export{w as C,g as D,ne as F,D as H,se as P,ie as S,T 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-eeedc550.js";import"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{c as b}from"./Component-85241517.js";import{L as u}from"./LightBaseComponent-6817bd8c.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{aN as _,aL as l,aQ as q,e as u,aw as G,aI as w,dg as Q,aM as N,aJ as A,dh as z,di as J,dj as W,dk as H,bn as K,dl as U,dm as X,dn as Y,bC as Z,q as ee,dp as te,dq as se,dr as oe,bl as re,t as ne,ds as ae,dt as ce,du as le,cq as ie,dv as fe,dw as pe,bL 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{aN as _,aL as l,aQ as q,e as u,aw as G,aI as w,dg as Q,aM as N,aJ as A,dh as z,di as J,dj as W,dk as H,bn as K,dl as U,dm as X,dn as Y,bC as Z,q as ee,dp as te,dq as se,dr as oe,bl as re,t as ne,ds as ae,dt as ce,du as le,cq as ie,dv as fe,dw as pe,bL 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-eeedc550.js";import{u as he}from"./index-828538e1.js";import"./postmen-fe9eecc4.js";import{c as ye}from"./Component-85241517.js";import{I as ge}from"./IconPlus-7690a910.js";import{D as je,M as Pe}from"./Menu-7006a0c9.js";import{c as L}from"./createReactComponent-0c5ada83.js";import{A as xe,a as Ee}from"./Accordion-6346d8c5.js";/**
|
|
2
2
|
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license.
|