babylonjs-editor-tools 5.1.6 → 5.1.8
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/build/index.node.js +1 -1
- package/build/src/decorators/apply.js +10 -7
- package/build/src/decorators/apply.js.map +1 -1
- package/build/src/decorators/inspector.js.map +1 -1
- package/build/src/loading/loader.js +18 -19
- package/build/src/loading/loader.js.map +1 -1
- package/build/src/loading/script.js +75 -4
- package/build/src/loading/script.js.map +1 -1
- package/declaration/src/decorators/apply.d.ts +10 -10
- package/declaration/src/decorators/inspector.d.ts +5 -2
- package/declaration/src/loading/script.d.ts +20 -1
- package/package.json +1 -1
package/build/index.node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var j=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var Pt=Object.getOwnPropertyNames;var bt=Object.prototype.hasOwnProperty;var i=(e,o)=>j(e,"name",{value:o,configurable:!0});var It=(e,o)=>{for(var t in o)j(e,t,{get:o[t],enumerable:!0})},Ct=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of Pt(o))!bt.call(e,r)&&r!==t&&j(e,r,{get:()=>o[r],enumerable:!(n=St(o,r))||n.enumerable});return e};var xt=e=>Ct(j({},"__esModule",{value:!0}),e);var In={};It(In,{_applyScriptsForObject:()=>M,animationGroupFromScene:()=>Zt,configureEngineToUseCompressedTextures:()=>$t,configureShadowMapRefreshRate:()=>De,configureShadowMapRenderListPredicate:()=>Ae,createDefaultRenderingPipeline:()=>nt,createMotionBlurPostProcess:()=>qe,createSSAO2RenderingPipeline:()=>Qe,createSSRRenderingPipeline:()=>$e,createVLSPostProcess:()=>We,defaultPipelineCameraConfigurations:()=>G,disposeDefaultRenderingPipeline:()=>Ie,disposeMotionBlurPostProcess:()=>he,disposeSSAO2RenderingPipeline:()=>ge,disposeSSRRenderingPipeline:()=>me,disposeVLSPostProcess:()=>ae,forceCompileAllSceneMaterials:()=>jt,generateCinematicAnimationGroup:()=>dn,getAllScriptsByClassForObject:()=>Ge,getAnimationTypeForObject:()=>Y,getDefaultRenderingPipeline:()=>z,getMotionBlurPostProcess:()=>ye,getPowerOfTwoUntil:()=>O,getSSAO2RenderingPipeline:()=>Gt,getSSRRenderingPipeline:()=>_t,getScriptByClassForObject:()=>Nt,getVLSPostProcess:()=>Vt,guiFromAsset:()=>qt,isAbstractMesh:()=>$,isAnyParticleSystem:()=>se,isArcRotateCamera:()=>Et,isBone:()=>At,isCamera:()=>U,isCinematicGroup:()=>Pn,isCinematicKey:()=>yn,isCinematicKeyCut:()=>hn,isCinematicKeyEvent:()=>Sn,isCinematicSound:()=>bn,isDirectionalLight:()=>Ot,isFreeCamera:()=>Tt,isGPUParticleSystem:()=>Ft,isGroundMesh:()=>Dt,isHemisphericLight:()=>Mt,isInstancedMesh:()=>K,isLight:()=>we,isMesh:()=>v,isNode:()=>F,isParticleSystem:()=>wt,isPointLight:()=>vt,isScene:()=>ie,isSpotLight:()=>Rt,isTexture:()=>oe,isTransformNode:()=>Me,loadMaterialFromFile:()=>Wt,loadScene:()=>Ht,motionBlurPostProcessCameraConfigurations:()=>B,nodeFromDescendants:()=>Qt,nodeFromScene:()=>Ut,onKeyboardEvent:()=>gn,onPointerEvent:()=>un,parseCinematic:()=>fn,parseCinematicKeyValue:()=>x,parseDefaultRenderingPipeline:()=>xe,parseMotionBlurPostProcess:()=>Pe,parseSSAO2RenderingPipeline:()=>de,parseSSRRenderingPipeline:()=>ue,parseVLSPostProcess:()=>ce,particleSystemFromScene:()=>Jt,registerScriptInstance:()=>Be,scriptsDictionary:()=>N,serializeDefaultRenderingPipeline:()=>Ce,serializeMotionBlurPostProcess:()=>Se,serializeSSAO2RenderingPipeline:()=>fe,serializeSSRRenderingPipeline:()=>pe,serializeVLSPostProcess:()=>le,setDefaultRenderingPipelineRef:()=>zt,setMotionBlurPostProcessRef:()=>kt,setSSAO2RenderingPipelineRef:()=>Kt,setSSRRenderingPipelineRef:()=>Bt,setVLSPostProcessRef:()=>Lt,soundFromScene:()=>Xt,ssaoRenderingPipelineCameraConfigurations:()=>_,ssrRenderingPipelineCameraConfigurations:()=>L,visibleAsAsset:()=>pn,visibleAsBoolean:()=>en,visibleAsColor3:()=>sn,visibleAsColor4:()=>an,visibleAsEntity:()=>ln,visibleAsKeyMap:()=>mn,visibleAsNumber:()=>nn,visibleAsString:()=>tn,visibleAsTexture:()=>cn,visibleAsVector2:()=>rn,visibleAsVector3:()=>on,vlsPostProcessCameraConfigurations:()=>V});module.exports=xt(In);function $(e){switch(e.getClassName?.()){case"Mesh":case"LineMesh":case"GroundMesh":case"InstancedMesh":return!0}return!1}i($,"isAbstractMesh");function v(e){switch(e.getClassName?.()){case"Mesh":case"GroundMesh":return!0}return!1}i(v,"isMesh");function K(e){return e.getClassName?.()==="InstancedMesh"}i(K,"isInstancedMesh");function At(e){return e.getClassName?.()==="Bone"}i(At,"isBone");function Dt(e){return e.getClassName?.()==="GroundMesh"}i(Dt,"isGroundMesh");function Me(e){return e.getClassName?.()==="TransformNode"}i(Me,"isTransformNode");function oe(e){return e?.getClassName?.()==="Texture"}i(oe,"isTexture");function U(e){switch(e.getClassName?.()){case"Camera":case"FreeCamera":case"TargetCamera":case"EditorCamera":case"ArcRotateCamera":case"UniversalCamera":return!0}return!1}i(U,"isCamera");function Tt(e){switch(e.getClassName?.()){case"FreeCamera":case"UniversalCamera":return!0}return!1}i(Tt,"isFreeCamera");function Et(e){return e.getClassName?.()==="ArcRotateCamera"}i(Et,"isArcRotateCamera");function vt(e){return e.getClassName?.()==="PointLight"}i(vt,"isPointLight");function Ot(e){return e.getClassName?.()==="DirectionalLight"}i(Ot,"isDirectionalLight");function Rt(e){return e.getClassName?.()==="SpotLight"}i(Rt,"isSpotLight");function Mt(e){return e.getClassName?.()==="HemisphericLight"}i(Mt,"isHemisphericLight");function we(e){switch(e.getClassName?.()){case"Light":case"PointLight":case"SpotLight":case"DirectionalLight":case"HemisphericLight":return!0}return!1}i(we,"isLight");function F(e){return $(e)||Me(e)||we(e)||U(e)}i(F,"isNode");function ie(e){return e.getClassName?.()==="Scene"}i(ie,"isScene");function wt(e){return e.getClassName?.()==="ParticleSystem"}i(wt,"isParticleSystem");function Ft(e){return e.getClassName?.()==="GPUParticleSystem"}i(Ft,"isGPUParticleSystem");function se(e){switch(e.getClassName?.()){case"ParticleSystem":case"GPUParticleSystem":return!0}return!1}i(se,"isAnyParticleSystem");function Q(e,o){let t=o.soundTracks??[];t.length||t.push(o.mainSoundTrack);for(let n=0,r=t.length;n<r;n++){let l=t[n].soundCollection.find(s=>s.id===e);if(l)return l}return null}i(Q,"getSoundById");var Fe=require("babylonjs"),Z=require("babylonjs"),Ne=require("babylonjs"),q=require("babylonjs"),Ve=require("babylonjs"),Le=require("babylonjs-gui");async function _e(e,o,t,n,r){let l=n.constructor;if(l){if(l._NodesFromScene?.forEach(s=>{n[s.propertyKey.toString()]=e.getNodeByName(s.nodeName)}),l._NodesFromDescendants?.forEach(s=>{let c=o.getDescendants?.(s.directDescendantsOnly,m=>m.name===s.nodeName)[0];n[s.propertyKey.toString()]=c??null}),l._AnimationGroups?.forEach(s=>{n[s.propertyKey.toString()]=e.getAnimationGroupByName(s.animationGroupName)}),l._SoundsFromScene?.forEach(s=>{let c=e.getSoundByName?.(s.soundName);n[s.propertyKey.toString()]=c??null}),await Promise.all((l._GuiFromAsset??[]).map(async s=>{let c=`${r}assets/${s.pathInAssets}`;try{let g=await(await fetch(c)).json(),S=Le.AdvancedDynamicTexture.CreateFullscreenUI(g.name,!0,e);S.parseSerializedObject(g.content,!1),n[s.propertyKey.toString()]=S,s.onGuiCreated?.(n,S)}catch(m){throw console.error(`Failed to load GUI from asset: ${c}`),m}})),l._ParticleSystemsFromScene?.forEach(s=>{let c=e.particleSystems?.find(m=>m.name!==s.particleSystemName?!1:s.directDescendantsOnly?m.emitter===o:m);n[s.propertyKey.toString()]=c}),await Promise.all((l._VisibleInInspector??[]).map(async s=>{let c=s.propertyKey.toString(),m=t.values;if(m.hasOwnProperty(c)&&m[c].hasOwnProperty("value")){let g=m[c].value;switch(s.configuration.type){case"number":case"boolean":case"keymap":case"string":n[c]=g;break;case"vector2":n[c]=q.Vector2.FromArray(g);break;case"vector3":n[c]=q.Vector3.FromArray(g);break;case"color3":n[c]=Z.Color3.FromArray(g);break;case"color4":n[c]=Z.Color4.FromArray(g);break;case"entity":switch(s.configuration.entityType){case"node":n[c]=e.getNodeById(g)??null;break;case"animationGroup":n[c]=e.getAnimationGroupByName(g)??null;break;case"sound":n[c]=Q(g,e);break;case"particleSystem":n[c]=e.particleSystems?.find(I=>I.id===g)??null;break}break;case"texture":g&&(n[c]=Ne.Texture.Parse(g,e,r));break;case"asset":if(g){let I=s.configuration.assetType,f=await(await fetch(`${r}${g}`)).json();switch(I){case"nodeParticleSystemSet":let d=Ve.NodeParticleSystemSet.Parse(f);n[c]=d;break;case"material":n[c]=Fe.Material.Parse(f,e,r);break}}}}})),l._PointerEvents?.length){if(l._PointerEvents.find(m=>m.options.mode==="attachedMeshOnly")&&!$(o))throw new Error('@onPointerEvent with mode "attachedMeshOnly" can only be used on scripts attached to meshes (extends AbstractMesh).');if(l._PointerEvents.find(m=>m.options.mode!=="global")&&!F(o))throw new Error('@onPointerEvent with mode different from "global" can be used only on scripts attached to Node: Mesh, Light, Camera, TransformNode.');e.onPointerObservable.add(m=>{let g=null;l._PointerEvents.forEach(S=>{if(!S.eventTypes.includes(m.type))return;let I=S.propertyKey.toString();if(S.options.mode==="global")return n[I]?.(m);g=m.pickInfo,g||(g=e.pick(e.pointerX,e.pointerY,f=>f.isVisible&&f.isPickable&&f.isEnabled(!0)&&!f._masterMesh,!1));let C=g.pickedMesh;if(C&&(S.options.mode==="attachedMeshOnly"&&C===o||S.options.mode==="includeDescendants"&&F(o)&&[o,...o.getDescendants(!1)].find(u=>u===C)))return n[I]?.(m)})})}l._KeyboardEvents?.length&&e.onKeyboardObservable.add(s=>{l._KeyboardEvents.forEach(c=>{c.eventTypes.includes(s.type)&&n[c.propertyKey.toString()]?.(s)})})}}i(_e,"applyDecorators");async function M(e,o,t,n){o.metadata?.scripts&&(await Promise.all(o.metadata.scripts?.map(async r=>{if(!r.enabled)return;let l=t[r.key];if(l)if(l.default){let s=new l.default(o);Be(o,s,r.key),await _e(e,o,r,s,n),s.onStart&&e.onBeforeRenderObservable.addOnce(()=>s.onStart()),s.onUpdate&&e.onBeforeRenderObservable.add(()=>s.onUpdate())}else l.onStart&&e.onBeforeRenderObservable.addOnce(()=>l.onStart(o)),l.onUpdate&&e.onBeforeRenderObservable.add(()=>l.onUpdate(o))})),o.metadata.scripts=void 0)}i(M,"_applyScriptsForObject");var N=new Map;function Be(e,o,t){let n={key:t,instance:o};N.has(e)?N.get(e).push(n):N.set(e,[n]),e.__editorRunningScripts??=[],e.__editorRunningScripts.push(n),(F(e)||se(e)||ie(e))&&e.onDisposeObservable.addOnce(()=>{N.delete(e)})}i(Be,"registerScriptInstance");function Ge(e,o){return N.get(e)?.filter(r=>r.instance.constructor===o)?.map(r=>r.instance)??null}i(Ge,"getAllScriptsByClassForObject");function Nt(e,o){return Ge(e,o)?.[0]??null}i(Nt,"getScriptByClassForObject");var k=require("babylonjs"),Ke=require("babylonjs");function ke(e){let o=e.metadata?.physicsAggregate;if(!o)return;let t;v(e)?t=e:K(e)&&(t=e.sourceMesh);let n=new Ke.PhysicsAggregate(e,o.shape.type,{mesh:t,mass:o.massProperties.mass});n.body.setMassProperties({mass:o.massProperties.mass,inertia:o.massProperties.inertia?k.Vector3.FromArray(o.massProperties.inertia):void 0,centerOfMass:o.massProperties.centerOfMass?k.Vector3.FromArray(o.massProperties.centerOfMass):void 0,inertiaOrientation:o.massProperties.inertiaOrientation?k.Quaternion.FromArray(o.massProperties.inertiaOrientation):void 0}),n.shape.density=o.shape.density,n.body.setMotionType(o.body.motionType),n.shape.material=o.material,e.physicsAggregate=n,e.metadata.physicsAggregate=void 0}i(ke,"configurePhysicsAggregate");var ze=require("babylonjs"),Ye=require("babylonjs"),He=require("babylonjs"),P=null,V=new Map;function Vt(){return P}i(Vt,"getVLSPostProcess");function Lt(e){P=e}i(Lt,"setVLSPostProcessRef");function ae(e){P&&e.activeCamera&&(P.dispose(e.activeCamera),P=null)}i(ae,"disposeVLSPostProcess");function We(e,o){return o??=e.meshes.find(t=>v(t)),P=new He.VolumetricLightScatteringPostProcess("VolumetricLightScatteringPostProcess",1,e.activeCamera,o,100,Ye.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1),P}i(We,"createVLSPostProcess");function le(){return P?{meshId:P.mesh?.id,exposure:P.exposure,decay:P.decay,weight:P.weight,density:P.density,invert:P.invert,useCustomMeshPosition:P.useCustomMeshPosition,customMeshPosition:P.customMeshPosition.asArray()}:null}i(le,"serializeVLSPostProcess");function ce(e,o){let t=null;if(o.meshId){let r=e.getMeshById(o.meshId);r&&v(r)&&(t=r)}let n=We(e,t);return n.exposure=o.exposure,n.decay=o.decay,n.weight=o.weight,n.density=o.density,n.invert=o.invert,n.useCustomMeshPosition=o.useCustomMeshPosition,n.customMeshPosition.copyFrom(ze.Vector3.FromArray(o.customMeshPosition)),n}i(ce,"parseVLSPostProcess");var je=require("babylonjs"),p=null,L=new Map;function _t(){return p}i(_t,"getSSRRenderingPipeline");function Bt(e){p=e}i(Bt,"setSSRRenderingPipelineRef");function me(){p&&(p.dispose(),p=null)}i(me,"disposeSSRRenderingPipeline");function $e(e,o){return p=new je.SSRRenderingPipeline("SSRRenderingPipeline",e,[o]),p.samples=4,p}i($e,"createSSRRenderingPipeline");function pe(){return p?{samples:p.samples,step:p.step,thickness:p.thickness,strength:p.strength,reflectionSpecularFalloffExponent:p.reflectionSpecularFalloffExponent,maxSteps:p.maxSteps,maxDistance:p.maxDistance,roughnessFactor:p.roughnessFactor,reflectivityThreshold:p.reflectivityThreshold,blurDispersionStrehgth:p.blurDispersionStrength,clipToFrustum:p.clipToFrustum,enableSmoothReflections:p.enableSmoothReflections,enableAutomaticThicknessComputation:p.enableAutomaticThicknessComputation,attenuateFacingCamera:p.attenuateFacingCamera,attenuateScreenBorders:p.attenuateScreenBorders,attenuateIntersectionDistance:p.attenuateIntersectionDistance,attenuateBackfaceReflection:p.attenuateBackfaceReflection,blurDownsample:p.blurDownsample,selfCollisionNumSkip:p.selfCollisionNumSkip,ssrDownsample:p.ssrDownsample,backfaceDepthTextureDownsample:p.backfaceDepthTextureDownsample}:null}i(pe,"serializeSSRRenderingPipeline");function ue(e,o,t){if(p)return p;let n=$e(e,o);return n.samples=t.samples,n.step=t.step,n.thickness=t.thickness,n.strength=t.strength,n.reflectionSpecularFalloffExponent=t.reflectionSpecularFalloffExponent,n.maxSteps=t.maxSteps,n.maxDistance=t.maxDistance,n.roughnessFactor=t.roughnessFactor,n.reflectivityThreshold=t.reflectivityThreshold,n.blurDispersionStrength=t.blurDispersionStrehgth,n.clipToFrustum=t.clipToFrustum,n.enableSmoothReflections=t.enableSmoothReflections,n.enableAutomaticThicknessComputation=t.enableAutomaticThicknessComputation,n.attenuateFacingCamera=t.attenuateFacingCamera,n.attenuateScreenBorders=t.attenuateScreenBorders,n.attenuateIntersectionDistance=t.attenuateIntersectionDistance,n.attenuateBackfaceReflection=t.attenuateBackfaceReflection,n.blurDownsample=t.blurDownsample,n.selfCollisionNumSkip=t.selfCollisionNumSkip,n.ssrDownsample=t.ssrDownsample,n.backfaceDepthTextureDownsample=t.backfaceDepthTextureDownsample,n}i(ue,"parseSSRRenderingPipeline");var Ue=require("babylonjs"),h=null,_=new Map;function Gt(){return h}i(Gt,"getSSAO2RenderingPipeline");function Kt(e){h=e}i(Kt,"setSSAO2RenderingPipelineRef");function ge(){h&&(h.dispose(),h=null)}i(ge,"disposeSSAO2RenderingPipeline");function Qe(e,o){return h=new Ue.SSAO2RenderingPipeline("SSAO2RenderingPipeline",e,1,[o]),h.samples=4,h}i(Qe,"createSSAO2RenderingPipeline");function fe(){return h?{radius:h.radius,totalStrength:h.totalStrength,samples:h.samples,maxZ:h.maxZ,minZAspect:h.minZAspect,epsilon:h.epsilon,textureSamples:h.textureSamples,bypassBlur:h.bypassBlur,bilateralSamples:h.bilateralSamples,bilateralSoften:h.bilateralSoften,bilateralTolerance:h.bilateralTolerance,expensiveBlur:h.expensiveBlur}:null}i(fe,"serializeSSAO2RenderingPipeline");function de(e,o,t){if(h)return h;let n=Qe(e,o);return n.radius=t.radius,n.totalStrength=t.totalStrength,n.samples=t.samples,n.maxZ=t.maxZ,n.minZAspect=t.minZAspect,n.epsilon=t.epsilon,n.textureSamples=t.textureSamples,n.bypassBlur=t.bypassBlur,n.bilateralSamples=t.bilateralSamples,n.bilateralSoften=t.bilateralSoften,n.bilateralTolerance=t.bilateralTolerance,n.expensiveBlur=t.expensiveBlur,n}i(de,"parseSSAO2RenderingPipeline");var Ze=require("babylonjs"),b=null,B=new Map;function ye(){return b}i(ye,"getMotionBlurPostProcess");function kt(e){b=e}i(kt,"setMotionBlurPostProcessRef");function he(){b&&(b.dispose(),b=null)}i(he,"disposeMotionBlurPostProcess");function qe(e,o){return b=new Ze.MotionBlurPostProcess("MotionBlurPostProcess",e,1,o),b.motionStrength=1,b.isObjectBased=!0,b}i(qe,"createMotionBlurPostProcess");function Se(){return b?{isObjectBased:b.isObjectBased,motionStrength:b.motionStrength,motionBlurSamples:b.motionBlurSamples}:null}i(Se,"serializeMotionBlurPostProcess");function Pe(e,o,t){if(b)return b;let n=qe(e,o);return n.isObjectBased=t.isObjectBased,n.motionStrength=t.motionStrength,n.motionBlurSamples=t.motionBlurSamples,n}i(Pe,"parseMotionBlurPostProcess");var Xe=require("babylonjs"),be=require("babylonjs"),Je=require("babylonjs"),et=require("babylonjs"),tt=require("babylonjs"),a=null,G=new Map;function z(){return a}i(z,"getDefaultRenderingPipeline");function zt(e){a=e}i(zt,"setDefaultRenderingPipelineRef");function Ie(){a&&(a.dispose(),a=null)}i(Ie,"disposeDefaultRenderingPipeline");function nt(e,o){return a=new tt.DefaultRenderingPipeline("DefaultRenderingPipeline",!0,e,[o]),a.samples=4,a.depthOfField.lensSize=512,a.depthOfField.fStop=.25,a.depthOfField.focusDistance=55e3,a}i(nt,"createDefaultRenderingPipeline");function Ce(){return a?{samples:a.samples,fxaaEnabled:a.fxaaEnabled,imageProcessingEnabled:a.imageProcessingEnabled,exposure:a.imageProcessing?.exposure,contrast:a.imageProcessing?.contrast,fromLinearSpace:a.imageProcessing?.fromLinearSpace,toneMappingEnabled:a.imageProcessing?.toneMappingEnabled,toneMappingType:a.imageProcessing?.toneMappingType,ditheringEnabled:a.imageProcessing?.ditheringEnabled,ditheringIntensity:a.imageProcessing?.ditheringIntensity,bloomEnabled:a.bloomEnabled,bloomThreshold:a.bloomThreshold,bloomWeight:a.bloomWeight,bloomScale:a.bloomScale,bloomKernel:a.bloomKernel,sharpenEnabled:a.sharpenEnabled,sharpenEdgeAmount:a.sharpen.edgeAmount,sharpenColorAmount:a.sharpen.colorAmount,grainEnabled:a.grainEnabled,grainIntensity:a.grain.intensity,grainAnimated:a.grain.animated,depthOfFieldEnabled:a.depthOfFieldEnabled,depthOfFieldBlurLevel:a.depthOfFieldBlurLevel,lensSize:a.depthOfField.lensSize,fStop:a.depthOfField.fStop,focusDistance:a.depthOfField.focusDistance,focalLength:a.depthOfField.focalLength,vignetteEnabled:a.imageProcessing?.vignetteEnabled,vignetteColor:a.imageProcessing?.vignetteColor.asArray(),vignetteWeight:a.imageProcessing?.vignetteWeight,chromaticAberrationEnabled:a.chromaticAberrationEnabled,aberrationAmount:a.chromaticAberration.aberrationAmount,radialIntensity:a.chromaticAberration.radialIntensity,direction:a.chromaticAberration.direction.asArray(),centerPosition:a.chromaticAberration.centerPosition.asArray(),glowLayerEnabled:a.glowLayerEnabled,glowLayerIntensity:a.glowLayer?.intensity,glowLayerBlurKernelSize:a.glowLayer?.blurKernelSize,colorGradingEnabled:a.imageProcessing.colorGradingEnabled,colorGradingTexture:a.imageProcessing.colorGradingTexture?.serialize(),colorGradingWithGreenDepth:a.imageProcessing.imageProcessingConfiguration.colorGradingWithGreenDepth,colorCurvesEnabled:a.imageProcessing.colorCurvesEnabled,globalHue:a.imageProcessing.colorCurves?.globalHue,globalDensity:a.imageProcessing.colorCurves?.globalDensity,globalExposure:a.imageProcessing.colorCurves?.globalExposure,globalSaturation:a.imageProcessing.colorCurves?.globalSaturation,highlightsHue:a.imageProcessing.colorCurves?.highlightsHue,highlightsDensity:a.imageProcessing.colorCurves?.highlightsDensity,highlightsExposure:a.imageProcessing.colorCurves?.highlightsExposure,highlightsSaturation:a.imageProcessing.colorCurves?.highlightsSaturation,midtonesHue:a.imageProcessing.colorCurves?.midtonesHue,midtonesDensity:a.imageProcessing.colorCurves?.midtonesDensity,midtonesExposure:a.imageProcessing.colorCurves?.midtonesExposure,midtonesSaturation:a.imageProcessing.colorCurves?.midtonesSaturation,shadowsHue:a.imageProcessing.colorCurves?.shadowsHue,shadowsDensity:a.imageProcessing.colorCurves?.shadowsDensity,shadowsExposure:a.imageProcessing.colorCurves?.shadowsExposure,shadowsSaturation:a.imageProcessing.colorCurves?.shadowsSaturation}:null}i(Ce,"serializeDefaultRenderingPipeline");function xe(e,o,t,n){if(a)return a;let r=nt(e,o);if(r.samples=t.samples,r.fxaaEnabled=t.fxaaEnabled,r.imageProcessingEnabled=t.imageProcessingEnabled,r.imageProcessing){if(r.imageProcessing.exposure=t.exposure,r.imageProcessing.contrast=t.contrast,r.imageProcessing.fromLinearSpace=t.fromLinearSpace,r.imageProcessing.toneMappingEnabled=t.toneMappingEnabled,r.imageProcessing.toneMappingType=t.toneMappingType,r.imageProcessing.ditheringEnabled=t.ditheringEnabled,r.imageProcessing.ditheringIntensity=t.ditheringIntensity,r.imageProcessing.vignetteEnabled=t.vignetteEnabled??!1,r.imageProcessing.vignetteColor=Xe.Color4.FromArray(t.vignetteColor??[0,0,0]),r.imageProcessing.vignetteWeight=t.vignetteWeight??.3,r.imageProcessing.colorGradingEnabled=t.colorGradingEnabled??!1,r.imageProcessing.imageProcessingConfiguration.colorGradingWithGreenDepth=t.colorGradingWithGreenDepth??!0,t.colorGradingTexture){let l=null;if(t.colorGradingTexture.customType==="BABYLON.ColorGradingTexture"){let s=n+t.colorGradingTexture.name;l=new et.ColorGradingTexture(s,e),l.level=t.colorGradingTexture.level}else{let s=Je.Texture.Parse(t.colorGradingTexture,e,n);oe(s)&&(l=s)}r.imageProcessing.colorGradingTexture=l}r.imageProcessing.colorCurvesEnabled=t.colorCurvesEnabled??!1,r.imageProcessing.colorCurves&&(r.imageProcessing.colorCurves.globalHue=t.globalHue??30,r.imageProcessing.colorCurves.globalDensity=t.globalDensity??0,r.imageProcessing.colorCurves.globalExposure=t.globalExposure??0,r.imageProcessing.colorCurves.globalSaturation=t.globalSaturation??0,r.imageProcessing.colorCurves.highlightsHue=t.highlightsHue??30,r.imageProcessing.colorCurves.highlightsDensity=t.highlightsDensity??0,r.imageProcessing.colorCurves.highlightsExposure=t.highlightsExposure??0,r.imageProcessing.colorCurves.highlightsSaturation=t.highlightsSaturation??0,r.imageProcessing.colorCurves.midtonesHue=t.midtonesHue??30,r.imageProcessing.colorCurves.midtonesDensity=t.midtonesDensity??0,r.imageProcessing.colorCurves.midtonesExposure=t.midtonesExposure??0,r.imageProcessing.colorCurves.midtonesSaturation=t.midtonesSaturation??0,r.imageProcessing.colorCurves.shadowsHue=t.shadowsHue??30,r.imageProcessing.colorCurves.shadowsDensity=t.shadowsDensity??0,r.imageProcessing.colorCurves.shadowsExposure=t.shadowsExposure??0,r.imageProcessing.colorCurves.shadowsSaturation=t.shadowsSaturation??0)}return r.bloomEnabled=t.bloomEnabled,r.bloomThreshold=t.bloomThreshold,r.bloomWeight=t.bloomWeight,r.bloomScale=t.bloomScale,r.bloomKernel=t.bloomKernel,r.sharpenEnabled=t.sharpenEnabled,r.sharpen.edgeAmount=t.sharpenEdgeAmount,r.sharpen.colorAmount=t.sharpenColorAmount,r.grainEnabled=t.grainEnabled,r.grain.intensity=t.grainIntensity,r.grain.animated=t.grainAnimated,r.depthOfFieldEnabled=t.depthOfFieldEnabled,r.depthOfFieldBlurLevel=t.depthOfFieldBlurLevel,r.depthOfField.lensSize=t.lensSize,r.depthOfField.fStop=t.fStop,r.depthOfField.focusDistance=t.focusDistance,r.depthOfField.focalLength=t.focalLength,r.chromaticAberrationEnabled=t.chromaticAberrationEnabled??!1,r.chromaticAberration.aberrationAmount=t.aberrationAmount??10,r.chromaticAberration.radialIntensity=t.radialIntensity??1,r.chromaticAberration.direction=be.Vector2.FromArray(t.direction??[0,0]),r.chromaticAberration.centerPosition=be.Vector2.FromArray(t.centerPosition??[0,0]),r.glowLayerEnabled=t.glowLayerEnabled??!1,r.glowLayer&&(r.glowLayer.intensity=t.glowLayerIntensity??1,r.glowLayer.blurKernelSize=t.glowLayerBlurKernelSize??32),r}i(xe,"parseDefaultRenderingPipeline");function rt(e,o){(Array.isArray(o)?o:[]).forEach(n=>{let r=e.getCameraById(n.cameraId);r&&(n.ssao2RenderingPipeline&&_.set(r,n.ssao2RenderingPipeline),n.vlsPostProcess&&V.set(r,n.vlsPostProcess),n.ssrRenderingPipeline&&L.set(r,n.ssrRenderingPipeline),n.motionBlurPostProcess&&B.set(r,n.motionBlurPostProcess),n.defaultRenderingPipeline&&G.set(r,n.defaultRenderingPipeline))})}i(rt,"applyRenderingConfigurations");function qo(e){_.set(e,fe()),V.set(e,le()),L.set(e,pe()),B.set(e,Se()),G.set(e,Ce())}i(qo,"saveRenderingConfigurationForCamera");function ot(e,o){ge(),ae(e.getScene()),me(),he(),Ie();let t=_.get(e);t&&de(e.getScene(),e,t);let n=V.get(e);n&&ce(e.getScene(),n);let r=L.get(e);r&&ue(e.getScene(),e,r);let l=B.get(e);l&&Pe(e.getScene(),e,l);let s=G.get(e);s&&xe(e.getScene(),e,s,o)}i(ot,"applyRenderingConfigurationForCamera");var it=require("babylonjs"),st=require("babylonjs");function Ae(e){e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.renderListPredicate=n=>it.Vector3.Distance(n.getAbsolutePosition(),o.getAbsolutePosition())<=o.range)})}i(Ae,"configureShadowMapRenderListPredicate");async function De(e){e.executeWhenReady(()=>{e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.refreshRate=o.metadata?.refreshRate??st.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME)})})}i(De,"configureShadowMapRefreshRate");var Te=require("babylonjs"),X=require("babylonjs"),Yt=(0,X.GetParser)(Te.SceneComponentConstants.NAME_AUDIO);(0,X.AddParser)(Te.SceneComponentConstants.NAME_AUDIO,(e,o,t,n)=>{Yt?.(e,o,t,n),e.sounds?.forEach(r=>{let l=t.sounds?.find(s=>s.name===r.name);l&&(l.id=r.id,l.uniqueId=r.uniqueId)})});function O(e){let o=1;for(;o<=e;)o<<=1;return o>>1}i(O,"getPowerOfTwoUntil");var Ee=require("babylonjs"),J=Ee.SerializationHelper._TextureParser;Ee.SerializationHelper._TextureParser=(e,o,t)=>{if(o.loadingQuality==="high"||!e.metadata?.baseSize)return J(e,o,t);let n=e.metadata.baseSize.width,r=e.metadata.baseSize.height,l=n===O(n)||r===O(r),s="";switch(o.loadingQuality){case"medium":let f=n*.66>>0,d=r*.66>>0;l&&(f=O(f),d=O(d)),s=`_${f}_${d}`;break;case"low":let u=n*.33>>0,y=r*.33>>0;l&&(u=O(u),y=O(y)),s=`_${u}_${y}`;break}let c=e.name;if(!c||!s)return J(e,o,t);let m=c.split("/"),g=m.pop();if(!g)return J(e,o,t);let S=g.split(".").pop(),C=`${g.replace(`.${S}`,"")}${s}.${S}`;return m.push(C),e.name=m.join("/"),J(e,o,t)};var at=require("babylonjs"),ve=require("babylonjs"),lt=require("babylonjs"),ct=require("babylonjs");async function Ht(e,o,t,n,r){t.loadingQuality=r?.quality??"high",await(0,lt.AppendSceneAsync)(`${e}${o}`,t,{pluginExtension:".babylon",onProgress:i(s=>{let c=Math.min(s.loaded/s.total*.5);r?.onProgress?.(c)},"onProgress")}),ct.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&t.meshes.forEach(s=>v(s)&&s._checkDelayState());let l=t.getWaitingItemsCount();for(;!t.isDisposed&&(!t.isReady()||t.getWaitingItemsCount()>0);){await new Promise(c=>setTimeout(c,150));let s=l-t.getWaitingItemsCount();s===l&&t.textures.forEach(c=>{c.delayLoadState===ve.Constants.DELAYLOADSTATE_NONE&&(c.delayLoadState=ve.Constants.DELAYLOADSTATE_LOADED)}),r?.onProgress?.(.5+s/l*.5)}r?.onProgress?.(1),Ae(t),De(t),t.metadata?.rendering&&(rt(t,t.metadata.rendering),t.activeCamera&&ot(t.activeCamera,e)),t.metadata?.physicsGravity&&t.getPhysicsEngine()?.setGravity(at.Vector3.FromArray(t.metadata?.physicsGravity)),await Promise.all([M(t,t,n,e),...t.transformNodes.map(s=>M(t,s,n,e)),...t.meshes.map(s=>(ke(s),M(t,s,n,e))),...t.lights.map(s=>M(t,s,n,e)),...t.cameras.map(s=>M(t,s,n,e))])}i(Ht,"loadScene");var mt=require("babylonjs");async function Wt(e,o,t){let r=await(await fetch(e+o)).json(),s=mt.Tools.Instantiate(r.customType).Parse(r,t,e);return s.id=r.id,s.uniqueId=r.uniqueId,s}i(Wt,"loadMaterialFromFile");function jt(e){return Promise.all(e.materials.map(async o=>{let t=o.getBindedMeshes();await Promise.all(t.map(async n=>{K(n)||await o.forceCompilationAsync(n,{clipPlane:!!e.clipPlane,useInstances:n.hasInstances})}))}))}i(jt,"forceCompileAllSceneMaterials");function $t(e){e.setTextureFormatToUse(["-dxt.ktx","-astc.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"])}i($t,"configureEngineToUseCompressedTextures");var T=require("babylonjs");function Y(e){if(!isNaN(parseFloat(e))&&isFinite(e))return T.Animation.ANIMATIONTYPE_FLOAT;switch(e?.getClassName?.()){case"Vector2":return T.Animation.ANIMATIONTYPE_VECTOR2;case"Vector3":return T.Animation.ANIMATIONTYPE_VECTOR3;case"Quaternion":return T.Animation.ANIMATIONTYPE_QUATERNION;case"Color3":return T.Animation.ANIMATIONTYPE_COLOR3;case"Color4":return T.Animation.ANIMATIONTYPE_COLOR4;case"Size":return T.Animation.ANIMATIONTYPE_SIZE;case"Matrix":return T.Animation.ANIMATIONTYPE_MATRIX}return null}i(Y,"getAnimationTypeForObject");function Ut(e){return function(o,t){let n=o.constructor;n._NodesFromScene??=[],n._NodesFromScene.push({propertyKey:t,nodeName:e})}}i(Ut,"nodeFromScene");function Qt(e,o=!1){return function(t,n){let r=t.constructor;r._NodesFromDescendants??=[],r._NodesFromDescendants.push({propertyKey:n,nodeName:e,directDescendantsOnly:o})}}i(Qt,"nodeFromDescendants");function Zt(e){return function(o,t){let n=o.constructor;n._AnimationGroups??=[],n._AnimationGroups.push({animationGroupName:e,propertyKey:t})}}i(Zt,"animationGroupFromScene");function qt(e,o){return function(t,n){let r=t.constructor;r._GuiFromAsset??=[],r._GuiFromAsset.push({propertyKey:n,pathInAssets:e,onGuiCreated:o})}}i(qt,"guiFromAsset");function Xt(e){return function(o,t){let n=o.constructor;n._SoundsFromScene??=[],n._SoundsFromScene.push({propertyKey:t,soundName:e})}}i(Xt,"soundFromScene");function Jt(e,o=!1){return function(t,n){let r=t.constructor;r._ParticleSystemsFromScene??=[],r._ParticleSystemsFromScene.push({propertyKey:n,particleSystemName:e,directDescendantsOnly:o})}}i(Jt,"particleSystemFromScene");function en(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"boolean"}})}}i(en,"visibleAsBoolean");function tn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"string"}})}}i(tn,"visibleAsString");function nn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"number"}})}}i(nn,"visibleAsNumber");function rn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector2"}})}}i(rn,"visibleAsVector2");function on(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector3"}})}}i(on,"visibleAsVector3");function sn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color3"}})}}i(sn,"visibleAsColor3");function an(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color4"}})}}i(an,"visibleAsColor4");function ln(e,o,t){return function(n,r){let l=n.constructor;l._VisibleInInspector??=[],l._VisibleInInspector.push({label:o,propertyKey:r,configuration:{...t,entityType:e,type:"entity"}})}}i(ln,"visibleAsEntity");function cn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"texture"}})}}i(cn,"visibleAsTexture");function mn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"keymap"}})}}i(mn,"visibleAsKeyMap");function pn(e,o,t){return function(n,r){let l=n.constructor;l._VisibleInInspector??=[],l._VisibleInInspector.push({label:o,propertyKey:r,configuration:{...t,assetType:e,type:"asset"}})}}i(pn,"visibleAsAsset");function un(e,o){return function(t,n){let r=t.constructor;r._PointerEvents??=[],r._PointerEvents.push({propertyKey:n,options:{mode:"global",...o??{}},eventTypes:Array.isArray(e)?e:[e]})}}i(un,"onPointerEvent");function gn(e){return function(o,t){let n=o.constructor;n._KeyboardEvents??=[],n._KeyboardEvents.push({propertyKey:t,eventTypes:Array.isArray(e)?e:[e]})}}i(gn,"onKeyboardEvent");var ee=require("babylonjs");function pt(e,o){let t;switch(e){case ee.Animation.ANIMATIONTYPE_FLOAT:t=o.value;break;default:t=o.value.clone();break}return{value:t,frame:o.frame,interpolation:o.interpolation,inTangent:e===ee.Animation.ANIMATIONTYPE_FLOAT?o.inTangent:o.inTangent?.clone(),outTangent:e===ee.Animation.ANIMATIONTYPE_FLOAT?o.outTangent:o.outTangent?.clone()}}i(pt,"cloneKey");function te(e,o){let t=o.split("."),n=e;for(let r=0;r<t.length;++r)n=n[t[r]];return n}i(te,"getPropertyValue");var R=require("babylonjs"),ne=require("babylonjs"),A=require("babylonjs");function fn(e,o){return{name:e.name,framesPerSecond:e.framesPerSecond,outputFramesPerSecond:e.outputFramesPerSecond,tracks:e.tracks.map(t=>{let n=null,r=null;if(t.node?(n=o.getNodeById(t.node),n||(n=o.particleSystems?.find(s=>s.id===t.node)??null)):t.defaultRenderingPipeline&&(n=z()),t.propertyPath){let s=te(n,t.propertyPath);r=Y(s)}let l=null;return t.sound&&(l=Q(t.sound,o)),{node:n,sound:l,propertyPath:t.propertyPath,defaultRenderingPipeline:t.defaultRenderingPipeline,animationGroup:t.animationGroup?o.getAnimationGroupByName(t.animationGroup):null,animationGroups:t.animationGroups,sounds:t.sounds,keyFrameEvents:t.keyFrameEvents?.map(s=>{let c={...s};switch(s.data?.type){case"set-enabled":c.data={type:"set-enabled",value:s.data.value,node:o.getNodeById(s.data.node)};break;case"apply-impulse":c.data={type:"apply-impulse",radius:s.data.radius,mesh:o.getMeshById(s.data.mesh),force:A.Vector3.FromArray(s.data.force),contactPoint:A.Vector3.FromArray(s.data.contactPoint)};break}return c}),keyFrameAnimations:n&&r!==null&&t.keyFrameAnimations?.map(s=>{let c=s.type==="key"?s:null;if(c)return{...c,value:x(c.value,r),inTangent:x(c.inTangent,r),outTangent:x(c.outTangent,r)};let m=s.type==="cut"?s:null;if(m)return{...m,key1:{...m.key1,value:x(m.key1.value,r),inTangent:x(m.key1.inTangent,r),outTangent:x(m.key1.outTangent,r)},key2:{...m.key2,value:x(m.key2.value,r),inTangent:x(m.key2.inTangent,r),outTangent:x(m.key2.outTangent,r)}};throw new Error(`Unknown key frame type: ${s.type}`)})}})}}i(fn,"parseCinematic");function x(e,o){if(e===null)return null;if(e!==void 0)switch(o){case R.Animation.ANIMATIONTYPE_FLOAT:return e;case R.Animation.ANIMATIONTYPE_VECTOR2:return A.Vector2.FromArray(e);case R.Animation.ANIMATIONTYPE_VECTOR3:return A.Vector3.FromArray(e);case R.Animation.ANIMATIONTYPE_QUATERNION:return A.Quaternion.FromArray(e);case R.Animation.ANIMATIONTYPE_COLOR3:return ne.Color3.FromArray(e);case R.Animation.ANIMATIONTYPE_COLOR4:return ne.Color4.FromArray(e);case R.Animation.ANIMATIONTYPE_MATRIX:return A.Matrix.FromArray(e)}}i(x,"parseCinematicKeyValue");function ut(e){e.node?.setEnabled(e.value)}i(ut,"handleSetEnabledEvent");var Oe=require("babylonjs"),gt=Oe.Vector3.Zero();function ft(e,o){let t=o.mesh?[o.mesh]:e.meshes.filter(n=>n.physicsAggregate);o.radius&&(t=t.filter(n=>{let r=n.getBoundingInfo().boundingBox.centerWorld;return Oe.Vector3.Distance(r,o.contactPoint)<=o.radius})),t.forEach(n=>{if(n.physicsAggregate?.body){let r=o.contactPoint.subtract(n.getBoundingInfo().boundingBox.centerWorld);r.multiplyInPlace(o.force),n.physicsAggregate.body.setLinearVelocity(gt),n.physicsAggregate.body.setAngularVelocity(gt),n.physicsAggregate.body.applyImpulse(r.negateInPlace(),o.contactPoint)}})}i(ft,"handleApplyImpulseEvent");var dt=require("babylonjs"),E=require("babylonjs"),H=require("babylonjs"),yt=require("babylonjs");function dn(e,o,t){let n=new yt.AnimationGroup(e.name,o);return e.tracks.forEach(r=>{let l=r.animationGroup;l&&r.animationGroups?.forEach(f=>{l.targetedAnimations.forEach(d=>{let u=null;e:{let D=n.targetedAnimations.filter(W=>W.target===d.target);if(D.length){let W=D.find(ht=>ht.animation.targetProperty===d.animation.targetProperty);if(W){u=W.animation;break e}}u=d.animation.clone(),u.setKeys([]),u.name=dt.Tools.RandomId(),u.framePerSecond=e.framesPerSecond}let y=u.getKeys(),w=d.animation.getKeys(),re=f.speed,Re=e.framesPerSecond/d.animation.framePerSecond/re;w.forEach(D=>{D.frame>=f.startFrame&&D.frame<=f.endFrame&&y.push({...pt(d.animation.dataType,D),frame:f.frame+D.frame*Re})}),u.setKeys(y),n.addTargetedAnimation(u,d.target)})});let s=r.sound,c=s?.getAudioBuffer();if(!t?.ignoreSounds&&s&&c&&r.sounds?.length){let f={dummy:0},d=new E.Animation(s.name,"dummy",60,E.Animation.ANIMATIONTYPE_FLOAT,E.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;r.sounds?.forEach(y=>{let w=y.endFrame-y.startFrame;u=Math.max(u,y.frame+w),d.addEvent(new H.AnimationEvent(y.frame,re=>{let D=(re-y.frame+y.startFrame)/e.framesPerSecond;s.play(0,D)},!1)),d.addEvent(new H.AnimationEvent(y.frame+w,()=>{s.stop()}))}),d.setKeys([{frame:0,value:0},{frame:u,value:u}]),n.addTargetedAnimation(d,f)}if(r.keyFrameEvents){let f={dummy:0},d=new E.Animation("events","dummy",60,E.Animation.ANIMATIONTYPE_FLOAT,E.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;r.keyFrameEvents?.forEach(y=>{u=Math.max(u,y.frame),d.addEvent(new H.AnimationEvent(y.frame,()=>{switch(y.data?.type){case"set-enabled":ut(y.data);break;case"apply-impulse":ft(o,y.data);break}}))}),d.setKeys([{frame:0,value:0},{frame:u,value:u}]),n.addTargetedAnimation(d,f)}let m=r.defaultRenderingPipeline?z():r.node;if(!m||!r.propertyPath||!r.keyFrameAnimations)return;let g=te(m,r.propertyPath),S=Y(g);if(S===null)return;let I=new E.Animation(r.propertyPath,r.propertyPath,60,S,E.Animation.ANIMATIONLOOPMODE_CYCLE,!1),C=[];r.keyFrameAnimations?.forEach(f=>{let d=f.type==="key"?f:null;if(d)return C.push(d);let u=f.type==="cut"?f:null;u&&(C.push(u.key1),C.push(u.key2),U(m)&&r.propertyPath==="position"&&I.addEvent(new H.AnimationEvent(u.key1.frame,()=>{let y=ye();if(!y)return;let w=y.motionStrength;y.motionStrength=0,requestAnimationFrame(()=>{y.motionStrength=w})})))}),I.setKeys(C),n.addTargetedAnimation(I,m)}),n.normalize(),n}i(dn,"generateCinematicAnimationGroup");function yn(e){return e.type==="key"}i(yn,"isCinematicKey");function hn(e){return e.type==="cut"}i(hn,"isCinematicKeyCut");function Sn(e){return e.type==="event"}i(Sn,"isCinematicKeyEvent");function Pn(e){return e.type==="group"}i(Pn,"isCinematicGroup");function bn(e){return e.type==="sound"}i(bn,"isCinematicSound");0&&(module.exports={_applyScriptsForObject,animationGroupFromScene,configureEngineToUseCompressedTextures,configureShadowMapRefreshRate,configureShadowMapRenderListPredicate,createDefaultRenderingPipeline,createMotionBlurPostProcess,createSSAO2RenderingPipeline,createSSRRenderingPipeline,createVLSPostProcess,defaultPipelineCameraConfigurations,disposeDefaultRenderingPipeline,disposeMotionBlurPostProcess,disposeSSAO2RenderingPipeline,disposeSSRRenderingPipeline,disposeVLSPostProcess,forceCompileAllSceneMaterials,generateCinematicAnimationGroup,getAllScriptsByClassForObject,getAnimationTypeForObject,getDefaultRenderingPipeline,getMotionBlurPostProcess,getPowerOfTwoUntil,getSSAO2RenderingPipeline,getSSRRenderingPipeline,getScriptByClassForObject,getVLSPostProcess,guiFromAsset,isAbstractMesh,isAnyParticleSystem,isArcRotateCamera,isBone,isCamera,isCinematicGroup,isCinematicKey,isCinematicKeyCut,isCinematicKeyEvent,isCinematicSound,isDirectionalLight,isFreeCamera,isGPUParticleSystem,isGroundMesh,isHemisphericLight,isInstancedMesh,isLight,isMesh,isNode,isParticleSystem,isPointLight,isScene,isSpotLight,isTexture,isTransformNode,loadMaterialFromFile,loadScene,motionBlurPostProcessCameraConfigurations,nodeFromDescendants,nodeFromScene,onKeyboardEvent,onPointerEvent,parseCinematic,parseCinematicKeyValue,parseDefaultRenderingPipeline,parseMotionBlurPostProcess,parseSSAO2RenderingPipeline,parseSSRRenderingPipeline,parseVLSPostProcess,particleSystemFromScene,registerScriptInstance,scriptsDictionary,serializeDefaultRenderingPipeline,serializeMotionBlurPostProcess,serializeSSAO2RenderingPipeline,serializeSSRRenderingPipeline,serializeVLSPostProcess,setDefaultRenderingPipelineRef,setMotionBlurPostProcessRef,setSSAO2RenderingPipelineRef,setSSRRenderingPipelineRef,setVLSPostProcessRef,soundFromScene,ssaoRenderingPipelineCameraConfigurations,ssrRenderingPipelineCameraConfigurations,visibleAsAsset,visibleAsBoolean,visibleAsColor3,visibleAsColor4,visibleAsEntity,visibleAsKeyMap,visibleAsNumber,visibleAsString,visibleAsTexture,visibleAsVector2,visibleAsVector3,vlsPostProcessCameraConfigurations});
|
|
1
|
+
var U=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var i=(e,o)=>U(e,"name",{value:o,configurable:!0});var xt=(e,o)=>{for(var t in o)U(e,t,{get:o[t],enumerable:!0})},At=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of It(o))!Ct.call(e,r)&&r!==t&&U(e,r,{get:()=>o[r],enumerable:!(n=Pt(o,r))||n.enumerable});return e};var Et=e=>At(U({},"__esModule",{value:!0}),e);var An={};xt(An,{_applyScriptsForObject:()=>M,_preloadScriptsAssets:()=>ve,animationGroupFromScene:()=>Jt,applyScriptOnObject:()=>Ht,configureEngineToUseCompressedTextures:()=>Zt,configureShadowMapRefreshRate:()=>le,configureShadowMapRenderListPredicate:()=>ce,createDefaultRenderingPipeline:()=>Xe,createMotionBlurPostProcess:()=>Ue,createSSAO2RenderingPipeline:()=>je,createSSRRenderingPipeline:()=>Ye,createVLSPostProcess:()=>ke,defaultPipelineCameraConfigurations:()=>G,disposeDefaultRenderingPipeline:()=>Ae,disposeMotionBlurPostProcess:()=>Pe,disposeSSAO2RenderingPipeline:()=>ye,disposeSSRRenderingPipeline:()=>ge,disposeVLSPostProcess:()=>me,forceCompileAllSceneMaterials:()=>Qt,generateCinematicAnimationGroup:()=>Sn,getAllScriptsByClassForObject:()=>ct,getAnimationTypeForObject:()=>H,getDefaultRenderingPipeline:()=>z,getMotionBlurPostProcess:()=>be,getPowerOfTwoUntil:()=>O,getSSAO2RenderingPipeline:()=>Kt,getSSRRenderingPipeline:()=>Bt,getScriptByClassForObject:()=>jt,getVLSPostProcess:()=>Lt,guiFromAsset:()=>en,isAbstractMesh:()=>$,isAnyParticleSystem:()=>ae,isArcRotateCamera:()=>Ot,isBone:()=>Dt,isCamera:()=>Q,isCinematicGroup:()=>Cn,isCinematicKey:()=>bn,isCinematicKeyCut:()=>Pn,isCinematicKeyEvent:()=>In,isCinematicSound:()=>xn,isDirectionalLight:()=>wt,isFreeCamera:()=>vt,isGPUParticleSystem:()=>Vt,isGroundMesh:()=>Tt,isHemisphericLight:()=>Ft,isInstancedMesh:()=>k,isLight:()=>Ve,isMesh:()=>v,isNode:()=>N,isParticleSystem:()=>Nt,isPointLight:()=>Rt,isScene:()=>se,isSpotLight:()=>Mt,isTexture:()=>ie,isTransformNode:()=>Ne,loadMaterialFromFile:()=>$t,loadScene:()=>Ut,motionBlurPostProcessCameraConfigurations:()=>B,nodeFromDescendants:()=>Xt,nodeFromScene:()=>qt,onKeyboardEvent:()=>yn,onPointerEvent:()=>dn,parseCinematic:()=>hn,parseCinematicKeyValue:()=>x,parseDefaultRenderingPipeline:()=>De,parseMotionBlurPostProcess:()=>Ce,parseSSAO2RenderingPipeline:()=>Se,parseSSRRenderingPipeline:()=>de,parseVLSPostProcess:()=>ue,particleSystemFromScene:()=>nn,registerScriptInstance:()=>at,scriptAssetsCache:()=>w,scriptsDictionary:()=>K,serializeDefaultRenderingPipeline:()=>Ee,serializeMotionBlurPostProcess:()=>Ie,serializeSSAO2RenderingPipeline:()=>he,serializeSSRRenderingPipeline:()=>fe,serializeVLSPostProcess:()=>pe,setDefaultRenderingPipelineRef:()=>Yt,setMotionBlurPostProcessRef:()=>zt,setSSAO2RenderingPipelineRef:()=>kt,setSSRRenderingPipelineRef:()=>Gt,setVLSPostProcessRef:()=>_t,soundFromScene:()=>tn,ssaoRenderingPipelineCameraConfigurations:()=>_,ssrRenderingPipelineCameraConfigurations:()=>L,visibleAsAsset:()=>fn,visibleAsBoolean:()=>rn,visibleAsColor3:()=>ln,visibleAsColor4:()=>mn,visibleAsEntity:()=>pn,visibleAsKeyMap:()=>gn,visibleAsNumber:()=>sn,visibleAsString:()=>on,visibleAsTexture:()=>un,visibleAsVector2:()=>an,visibleAsVector3:()=>cn,vlsPostProcessCameraConfigurations:()=>V});module.exports=Et(An);function $(e){switch(e.getClassName?.()){case"Mesh":case"LineMesh":case"GroundMesh":case"InstancedMesh":return!0}return!1}i($,"isAbstractMesh");function v(e){switch(e.getClassName?.()){case"Mesh":case"GroundMesh":return!0}return!1}i(v,"isMesh");function k(e){return e.getClassName?.()==="InstancedMesh"}i(k,"isInstancedMesh");function Dt(e){return e.getClassName?.()==="Bone"}i(Dt,"isBone");function Tt(e){return e.getClassName?.()==="GroundMesh"}i(Tt,"isGroundMesh");function Ne(e){return e.getClassName?.()==="TransformNode"}i(Ne,"isTransformNode");function ie(e){return e?.getClassName?.()==="Texture"}i(ie,"isTexture");function Q(e){switch(e.getClassName?.()){case"Camera":case"FreeCamera":case"TargetCamera":case"EditorCamera":case"ArcRotateCamera":case"UniversalCamera":return!0}return!1}i(Q,"isCamera");function vt(e){switch(e.getClassName?.()){case"FreeCamera":case"UniversalCamera":return!0}return!1}i(vt,"isFreeCamera");function Ot(e){return e.getClassName?.()==="ArcRotateCamera"}i(Ot,"isArcRotateCamera");function Rt(e){return e.getClassName?.()==="PointLight"}i(Rt,"isPointLight");function wt(e){return e.getClassName?.()==="DirectionalLight"}i(wt,"isDirectionalLight");function Mt(e){return e.getClassName?.()==="SpotLight"}i(Mt,"isSpotLight");function Ft(e){return e.getClassName?.()==="HemisphericLight"}i(Ft,"isHemisphericLight");function Ve(e){switch(e.getClassName?.()){case"Light":case"PointLight":case"SpotLight":case"DirectionalLight":case"HemisphericLight":return!0}return!1}i(Ve,"isLight");function N(e){return $(e)||Ne(e)||Ve(e)||Q(e)}i(N,"isNode");function se(e){return e.getClassName?.()==="Scene"}i(se,"isScene");function Nt(e){return e.getClassName?.()==="ParticleSystem"}i(Nt,"isParticleSystem");function Vt(e){return e.getClassName?.()==="GPUParticleSystem"}i(Vt,"isGPUParticleSystem");function ae(e){switch(e.getClassName?.()){case"ParticleSystem":case"GPUParticleSystem":return!0}return!1}i(ae,"isAnyParticleSystem");var Le=require("babylonjs"),_e=require("babylonjs");function ce(e){e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.renderListPredicate=n=>Le.Vector3.Distance(n.getAbsolutePosition(),o.getAbsolutePosition())<=o.range)})}i(ce,"configureShadowMapRenderListPredicate");async function le(e){e.executeWhenReady(()=>{e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.refreshRate=o.metadata?.refreshRate??_e.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME)})})}i(le,"configureShadowMapRefreshRate");var Be=require("babylonjs"),Ge=require("babylonjs"),Ke=require("babylonjs"),b=null,V=new Map;function Lt(){return b}i(Lt,"getVLSPostProcess");function _t(e){b=e}i(_t,"setVLSPostProcessRef");function me(e){b&&e.activeCamera&&(b.dispose(e.activeCamera),b=null)}i(me,"disposeVLSPostProcess");function ke(e,o){return o??=e.meshes.find(t=>v(t)),b=new Ke.VolumetricLightScatteringPostProcess("VolumetricLightScatteringPostProcess",1,e.activeCamera,o,100,Ge.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1),b}i(ke,"createVLSPostProcess");function pe(){return b?{meshId:b.mesh?.id,exposure:b.exposure,decay:b.decay,weight:b.weight,density:b.density,invert:b.invert,useCustomMeshPosition:b.useCustomMeshPosition,customMeshPosition:b.customMeshPosition.asArray()}:null}i(pe,"serializeVLSPostProcess");function ue(e,o){let t=null;if(o.meshId){let r=e.getMeshById(o.meshId);r&&v(r)&&(t=r)}let n=ke(e,t);return n.exposure=o.exposure,n.decay=o.decay,n.weight=o.weight,n.density=o.density,n.invert=o.invert,n.useCustomMeshPosition=o.useCustomMeshPosition,n.customMeshPosition.copyFrom(Be.Vector3.FromArray(o.customMeshPosition)),n}i(ue,"parseVLSPostProcess");var ze=require("babylonjs"),p=null,L=new Map;function Bt(){return p}i(Bt,"getSSRRenderingPipeline");function Gt(e){p=e}i(Gt,"setSSRRenderingPipelineRef");function ge(){p&&(p.dispose(),p=null)}i(ge,"disposeSSRRenderingPipeline");function Ye(e,o){return p=new ze.SSRRenderingPipeline("SSRRenderingPipeline",e,[o]),p.samples=4,p}i(Ye,"createSSRRenderingPipeline");function fe(){return p?{samples:p.samples,step:p.step,thickness:p.thickness,strength:p.strength,reflectionSpecularFalloffExponent:p.reflectionSpecularFalloffExponent,maxSteps:p.maxSteps,maxDistance:p.maxDistance,roughnessFactor:p.roughnessFactor,reflectivityThreshold:p.reflectivityThreshold,blurDispersionStrehgth:p.blurDispersionStrength,clipToFrustum:p.clipToFrustum,enableSmoothReflections:p.enableSmoothReflections,enableAutomaticThicknessComputation:p.enableAutomaticThicknessComputation,attenuateFacingCamera:p.attenuateFacingCamera,attenuateScreenBorders:p.attenuateScreenBorders,attenuateIntersectionDistance:p.attenuateIntersectionDistance,attenuateBackfaceReflection:p.attenuateBackfaceReflection,blurDownsample:p.blurDownsample,selfCollisionNumSkip:p.selfCollisionNumSkip,ssrDownsample:p.ssrDownsample,backfaceDepthTextureDownsample:p.backfaceDepthTextureDownsample}:null}i(fe,"serializeSSRRenderingPipeline");function de(e,o,t){if(p)return p;let n=Ye(e,o);return n.samples=t.samples,n.step=t.step,n.thickness=t.thickness,n.strength=t.strength,n.reflectionSpecularFalloffExponent=t.reflectionSpecularFalloffExponent,n.maxSteps=t.maxSteps,n.maxDistance=t.maxDistance,n.roughnessFactor=t.roughnessFactor,n.reflectivityThreshold=t.reflectivityThreshold,n.blurDispersionStrength=t.blurDispersionStrehgth,n.clipToFrustum=t.clipToFrustum,n.enableSmoothReflections=t.enableSmoothReflections,n.enableAutomaticThicknessComputation=t.enableAutomaticThicknessComputation,n.attenuateFacingCamera=t.attenuateFacingCamera,n.attenuateScreenBorders=t.attenuateScreenBorders,n.attenuateIntersectionDistance=t.attenuateIntersectionDistance,n.attenuateBackfaceReflection=t.attenuateBackfaceReflection,n.blurDownsample=t.blurDownsample,n.selfCollisionNumSkip=t.selfCollisionNumSkip,n.ssrDownsample=t.ssrDownsample,n.backfaceDepthTextureDownsample=t.backfaceDepthTextureDownsample,n}i(de,"parseSSRRenderingPipeline");var He=require("babylonjs"),h=null,_=new Map;function Kt(){return h}i(Kt,"getSSAO2RenderingPipeline");function kt(e){h=e}i(kt,"setSSAO2RenderingPipelineRef");function ye(){h&&(h.dispose(),h=null)}i(ye,"disposeSSAO2RenderingPipeline");function je(e,o){return h=new He.SSAO2RenderingPipeline("SSAO2RenderingPipeline",e,1,[o]),h.samples=4,h}i(je,"createSSAO2RenderingPipeline");function he(){return h?{radius:h.radius,totalStrength:h.totalStrength,samples:h.samples,maxZ:h.maxZ,minZAspect:h.minZAspect,epsilon:h.epsilon,textureSamples:h.textureSamples,bypassBlur:h.bypassBlur,bilateralSamples:h.bilateralSamples,bilateralSoften:h.bilateralSoften,bilateralTolerance:h.bilateralTolerance,expensiveBlur:h.expensiveBlur}:null}i(he,"serializeSSAO2RenderingPipeline");function Se(e,o,t){if(h)return h;let n=je(e,o);return n.radius=t.radius,n.totalStrength=t.totalStrength,n.samples=t.samples,n.maxZ=t.maxZ,n.minZAspect=t.minZAspect,n.epsilon=t.epsilon,n.textureSamples=t.textureSamples,n.bypassBlur=t.bypassBlur,n.bilateralSamples=t.bilateralSamples,n.bilateralSoften=t.bilateralSoften,n.bilateralTolerance=t.bilateralTolerance,n.expensiveBlur=t.expensiveBlur,n}i(Se,"parseSSAO2RenderingPipeline");var We=require("babylonjs"),P=null,B=new Map;function be(){return P}i(be,"getMotionBlurPostProcess");function zt(e){P=e}i(zt,"setMotionBlurPostProcessRef");function Pe(){P&&(P.dispose(),P=null)}i(Pe,"disposeMotionBlurPostProcess");function Ue(e,o){return P=new We.MotionBlurPostProcess("MotionBlurPostProcess",e,1,o),P.motionStrength=1,P.isObjectBased=!0,P}i(Ue,"createMotionBlurPostProcess");function Ie(){return P?{isObjectBased:P.isObjectBased,motionStrength:P.motionStrength,motionBlurSamples:P.motionBlurSamples}:null}i(Ie,"serializeMotionBlurPostProcess");function Ce(e,o,t){if(P)return P;let n=Ue(e,o);return n.isObjectBased=t.isObjectBased,n.motionStrength=t.motionStrength,n.motionBlurSamples=t.motionBlurSamples,n}i(Ce,"parseMotionBlurPostProcess");var $e=require("babylonjs"),xe=require("babylonjs"),Qe=require("babylonjs"),Ze=require("babylonjs"),qe=require("babylonjs"),a=null,G=new Map;function z(){return a}i(z,"getDefaultRenderingPipeline");function Yt(e){a=e}i(Yt,"setDefaultRenderingPipelineRef");function Ae(){a&&(a.dispose(),a=null)}i(Ae,"disposeDefaultRenderingPipeline");function Xe(e,o){return a=new qe.DefaultRenderingPipeline("DefaultRenderingPipeline",!0,e,[o]),a.samples=4,a.depthOfField.lensSize=512,a.depthOfField.fStop=.25,a.depthOfField.focusDistance=55e3,a}i(Xe,"createDefaultRenderingPipeline");function Ee(){return a?{samples:a.samples,fxaaEnabled:a.fxaaEnabled,imageProcessingEnabled:a.imageProcessingEnabled,exposure:a.imageProcessing?.exposure,contrast:a.imageProcessing?.contrast,fromLinearSpace:a.imageProcessing?.fromLinearSpace,toneMappingEnabled:a.imageProcessing?.toneMappingEnabled,toneMappingType:a.imageProcessing?.toneMappingType,ditheringEnabled:a.imageProcessing?.ditheringEnabled,ditheringIntensity:a.imageProcessing?.ditheringIntensity,bloomEnabled:a.bloomEnabled,bloomThreshold:a.bloomThreshold,bloomWeight:a.bloomWeight,bloomScale:a.bloomScale,bloomKernel:a.bloomKernel,sharpenEnabled:a.sharpenEnabled,sharpenEdgeAmount:a.sharpen.edgeAmount,sharpenColorAmount:a.sharpen.colorAmount,grainEnabled:a.grainEnabled,grainIntensity:a.grain.intensity,grainAnimated:a.grain.animated,depthOfFieldEnabled:a.depthOfFieldEnabled,depthOfFieldBlurLevel:a.depthOfFieldBlurLevel,lensSize:a.depthOfField.lensSize,fStop:a.depthOfField.fStop,focusDistance:a.depthOfField.focusDistance,focalLength:a.depthOfField.focalLength,vignetteEnabled:a.imageProcessing?.vignetteEnabled,vignetteColor:a.imageProcessing?.vignetteColor.asArray(),vignetteWeight:a.imageProcessing?.vignetteWeight,chromaticAberrationEnabled:a.chromaticAberrationEnabled,aberrationAmount:a.chromaticAberration.aberrationAmount,radialIntensity:a.chromaticAberration.radialIntensity,direction:a.chromaticAberration.direction.asArray(),centerPosition:a.chromaticAberration.centerPosition.asArray(),glowLayerEnabled:a.glowLayerEnabled,glowLayerIntensity:a.glowLayer?.intensity,glowLayerBlurKernelSize:a.glowLayer?.blurKernelSize,colorGradingEnabled:a.imageProcessing.colorGradingEnabled,colorGradingTexture:a.imageProcessing.colorGradingTexture?.serialize(),colorGradingWithGreenDepth:a.imageProcessing.imageProcessingConfiguration.colorGradingWithGreenDepth,colorCurvesEnabled:a.imageProcessing.colorCurvesEnabled,globalHue:a.imageProcessing.colorCurves?.globalHue,globalDensity:a.imageProcessing.colorCurves?.globalDensity,globalExposure:a.imageProcessing.colorCurves?.globalExposure,globalSaturation:a.imageProcessing.colorCurves?.globalSaturation,highlightsHue:a.imageProcessing.colorCurves?.highlightsHue,highlightsDensity:a.imageProcessing.colorCurves?.highlightsDensity,highlightsExposure:a.imageProcessing.colorCurves?.highlightsExposure,highlightsSaturation:a.imageProcessing.colorCurves?.highlightsSaturation,midtonesHue:a.imageProcessing.colorCurves?.midtonesHue,midtonesDensity:a.imageProcessing.colorCurves?.midtonesDensity,midtonesExposure:a.imageProcessing.colorCurves?.midtonesExposure,midtonesSaturation:a.imageProcessing.colorCurves?.midtonesSaturation,shadowsHue:a.imageProcessing.colorCurves?.shadowsHue,shadowsDensity:a.imageProcessing.colorCurves?.shadowsDensity,shadowsExposure:a.imageProcessing.colorCurves?.shadowsExposure,shadowsSaturation:a.imageProcessing.colorCurves?.shadowsSaturation}:null}i(Ee,"serializeDefaultRenderingPipeline");function De(e,o,t,n){if(a)return a;let r=Xe(e,o);if(r.samples=t.samples,r.fxaaEnabled=t.fxaaEnabled,r.imageProcessingEnabled=t.imageProcessingEnabled,r.imageProcessing){if(r.imageProcessing.exposure=t.exposure,r.imageProcessing.contrast=t.contrast,r.imageProcessing.fromLinearSpace=t.fromLinearSpace,r.imageProcessing.toneMappingEnabled=t.toneMappingEnabled,r.imageProcessing.toneMappingType=t.toneMappingType,r.imageProcessing.ditheringEnabled=t.ditheringEnabled,r.imageProcessing.ditheringIntensity=t.ditheringIntensity,r.imageProcessing.vignetteEnabled=t.vignetteEnabled??!1,r.imageProcessing.vignetteColor=$e.Color4.FromArray(t.vignetteColor??[0,0,0]),r.imageProcessing.vignetteWeight=t.vignetteWeight??.3,r.imageProcessing.colorGradingEnabled=t.colorGradingEnabled??!1,r.imageProcessing.imageProcessingConfiguration.colorGradingWithGreenDepth=t.colorGradingWithGreenDepth??!0,t.colorGradingTexture){let c=null;if(t.colorGradingTexture.customType==="BABYLON.ColorGradingTexture"){let s=n+t.colorGradingTexture.name;c=new Ze.ColorGradingTexture(s,e),c.level=t.colorGradingTexture.level}else{let s=Qe.Texture.Parse(t.colorGradingTexture,e,n);ie(s)&&(c=s)}r.imageProcessing.colorGradingTexture=c}r.imageProcessing.colorCurvesEnabled=t.colorCurvesEnabled??!1,r.imageProcessing.colorCurves&&(r.imageProcessing.colorCurves.globalHue=t.globalHue??30,r.imageProcessing.colorCurves.globalDensity=t.globalDensity??0,r.imageProcessing.colorCurves.globalExposure=t.globalExposure??0,r.imageProcessing.colorCurves.globalSaturation=t.globalSaturation??0,r.imageProcessing.colorCurves.highlightsHue=t.highlightsHue??30,r.imageProcessing.colorCurves.highlightsDensity=t.highlightsDensity??0,r.imageProcessing.colorCurves.highlightsExposure=t.highlightsExposure??0,r.imageProcessing.colorCurves.highlightsSaturation=t.highlightsSaturation??0,r.imageProcessing.colorCurves.midtonesHue=t.midtonesHue??30,r.imageProcessing.colorCurves.midtonesDensity=t.midtonesDensity??0,r.imageProcessing.colorCurves.midtonesExposure=t.midtonesExposure??0,r.imageProcessing.colorCurves.midtonesSaturation=t.midtonesSaturation??0,r.imageProcessing.colorCurves.shadowsHue=t.shadowsHue??30,r.imageProcessing.colorCurves.shadowsDensity=t.shadowsDensity??0,r.imageProcessing.colorCurves.shadowsExposure=t.shadowsExposure??0,r.imageProcessing.colorCurves.shadowsSaturation=t.shadowsSaturation??0)}return r.bloomEnabled=t.bloomEnabled,r.bloomThreshold=t.bloomThreshold,r.bloomWeight=t.bloomWeight,r.bloomScale=t.bloomScale,r.bloomKernel=t.bloomKernel,r.sharpenEnabled=t.sharpenEnabled,r.sharpen.edgeAmount=t.sharpenEdgeAmount,r.sharpen.colorAmount=t.sharpenColorAmount,r.grainEnabled=t.grainEnabled,r.grain.intensity=t.grainIntensity,r.grain.animated=t.grainAnimated,r.depthOfFieldEnabled=t.depthOfFieldEnabled,r.depthOfFieldBlurLevel=t.depthOfFieldBlurLevel,r.depthOfField.lensSize=t.lensSize,r.depthOfField.fStop=t.fStop,r.depthOfField.focusDistance=t.focusDistance,r.depthOfField.focalLength=t.focalLength,r.chromaticAberrationEnabled=t.chromaticAberrationEnabled??!1,r.chromaticAberration.aberrationAmount=t.aberrationAmount??10,r.chromaticAberration.radialIntensity=t.radialIntensity??1,r.chromaticAberration.direction=xe.Vector2.FromArray(t.direction??[0,0]),r.chromaticAberration.centerPosition=xe.Vector2.FromArray(t.centerPosition??[0,0]),r.glowLayerEnabled=t.glowLayerEnabled??!1,r.glowLayer&&(r.glowLayer.intensity=t.glowLayerIntensity??1,r.glowLayer.blurKernelSize=t.glowLayerBlurKernelSize??32),r}i(De,"parseDefaultRenderingPipeline");function ro(e){_.set(e,he()),V.set(e,pe()),L.set(e,fe()),B.set(e,Ie()),G.set(e,Ee())}i(ro,"saveRenderingConfigurationForCamera");function Je(e,o){ye(),me(e.getScene()),ge(),Pe(),Ae();let t=_.get(e);t&&Se(e.getScene(),e,t);let n=V.get(e);n&&ue(e.getScene(),n);let r=L.get(e);r&&de(e.getScene(),e,r);let c=B.get(e);c&&Ce(e.getScene(),e,c);let s=G.get(e);s&&De(e.getScene(),e,s,o)}i(Je,"applyRenderingConfigurationForCamera");var Y=require("babylonjs"),et=require("babylonjs");function tt(e){let o=e.metadata?.physicsAggregate;if(!o)return;let t;v(e)?t=e:k(e)&&(t=e.sourceMesh);let n=new et.PhysicsAggregate(e,o.shape.type,{mesh:t,mass:o.massProperties.mass});n.body.setMassProperties({mass:o.massProperties.mass,inertia:o.massProperties.inertia?Y.Vector3.FromArray(o.massProperties.inertia):void 0,centerOfMass:o.massProperties.centerOfMass?Y.Vector3.FromArray(o.massProperties.centerOfMass):void 0,inertiaOrientation:o.massProperties.inertiaOrientation?Y.Quaternion.FromArray(o.massProperties.inertiaOrientation):void 0}),n.shape.density=o.shape.density,n.body.setMotionType(o.body.motionType),n.shape.material=o.material,e.physicsAggregate=n,e.metadata.physicsAggregate=void 0}i(tt,"configurePhysicsAggregate");function nt(e,o){(Array.isArray(o)?o:[]).forEach(n=>{let r=e.getCameraById(n.cameraId);r&&(n.ssao2RenderingPipeline&&_.set(r,n.ssao2RenderingPipeline),n.vlsPostProcess&&V.set(r,n.vlsPostProcess),n.ssrRenderingPipeline&&L.set(r,n.ssrRenderingPipeline),n.motionBlurPostProcess&&B.set(r,n.motionBlurPostProcess),n.defaultRenderingPipeline&&G.set(r,n.defaultRenderingPipeline))})}i(nt,"applyRenderingConfigurations");function Z(e,o){let t=o.soundTracks??[];t.length||t.push(o.mainSoundTrack);for(let n=0,r=t.length;n<r;n++){let c=t[n].soundCollection.find(s=>s.id===e);if(c)return c}return null}i(Z,"getSoundById");var rt=require("babylonjs"),q=require("babylonjs"),ot=require("babylonjs"),X=require("babylonjs"),it=require("babylonjs"),st=require("babylonjs-gui");function Te(e,o,t,n,r){let c=n.constructor;if(c){if(c._NodesFromScene?.forEach(s=>{n[s.propertyKey.toString()]=e.getNodeByName(s.nodeName)}),c._NodesFromDescendants?.forEach(s=>{let l=o.getDescendants?.(s.directDescendantsOnly,m=>m.name===s.nodeName)[0];n[s.propertyKey.toString()]=l??null}),c._AnimationGroups?.forEach(s=>{n[s.propertyKey.toString()]=e.getAnimationGroupByName(s.animationGroupName)}),c._SoundsFromScene?.forEach(s=>{let l=e.getSoundByName?.(s.soundName);n[s.propertyKey.toString()]=l??null}),(c._GuiFromAsset??[]).map(async s=>{let l=`${r}assets/${s.pathInAssets}`;try{let u=await(await fetch(l)).json(),S=st.AdvancedDynamicTexture.CreateFullscreenUI(u.name,!0,e);S.parseSerializedObject(u.content,!1),n[s.propertyKey.toString()]=S,s.onGuiCreated?.(n,S)}catch(m){throw console.error(`Failed to load GUI from asset: ${l}`),m}}),c._ParticleSystemsFromScene?.forEach(s=>{let l=e.particleSystems?.find(m=>m.name!==s.particleSystemName?!1:s.directDescendantsOnly?m.emitter===o:m);n[s.propertyKey.toString()]=l}),(c._VisibleInInspector??[]).map(async s=>{let l=s.propertyKey.toString(),m=t.values;if(m.hasOwnProperty(l)&&m[l].hasOwnProperty("value")){let u=m[l].value;switch(s.configuration.type){case"number":case"boolean":case"keymap":case"string":n[l]=u;break;case"vector2":n[l]=X.Vector2.FromArray(u);break;case"vector3":n[l]=X.Vector3.FromArray(u);break;case"color3":n[l]=q.Color3.FromArray(u);break;case"color4":n[l]=q.Color4.FromArray(u);break;case"entity":switch(s.configuration.entityType){case"node":n[l]=e.getNodeById(u)??null;break;case"animationGroup":n[l]=e.getAnimationGroupByName(u)??null;break;case"sound":n[l]=Z(u,e);break;case"particleSystem":n[l]=e.particleSystems?.find(C=>C.id===u)??null;break}break;case"texture":u&&(n[l]=ot.Texture.Parse(u,e,r));break;case"asset":if(u){let C=s.configuration.assetType,I=w.get(u);switch(C){case"json":n[l]=I;break;case"nodeParticleSystemSet":let f=it.NodeParticleSystemSet.Parse(I);n[l]=f;break;case"material":n[l]=rt.Material.Parse(I,e,r);break}}}}}),c._PointerEvents?.length){if(c._PointerEvents.find(m=>m.options.mode==="attachedMeshOnly")&&!$(o))throw new Error('@onPointerEvent with mode "attachedMeshOnly" can only be used on scripts attached to meshes (extends AbstractMesh).');if(c._PointerEvents.find(m=>m.options.mode!=="global")&&!N(o))throw new Error('@onPointerEvent with mode different from "global" can be used only on scripts attached to Node: Mesh, Light, Camera, TransformNode.');e.onPointerObservable.add(m=>{let u=null;c._PointerEvents.forEach(S=>{if(!S.eventTypes.includes(m.type))return;let C=S.propertyKey.toString();if(S.options.mode==="global")return n[C]?.(m);u=m.pickInfo,u||(u=e.pick(e.pointerX,e.pointerY,f=>f.isVisible&&f.isPickable&&f.isEnabled(!0)&&!f._masterMesh,!1));let I=u.pickedMesh;if(I&&(S.options.mode==="attachedMeshOnly"&&I===o||S.options.mode==="includeDescendants"&&N(o)&&[o,...o.getDescendants(!1)].find(g=>g===I)))return n[C]?.(m)})})}c._KeyboardEvents?.length&&e.onKeyboardObservable.add(s=>{c._KeyboardEvents.forEach(l=>{l.eventTypes.includes(s.type)&&n[l.propertyKey.toString()]?.(s)})})}}i(Te,"applyDecorators");var w=new Map;async function ve(e,o){[...e.transformNodes,...e.meshes,...e.lights,...e.cameras].filter(c=>c.metadata.scripts?.length).map(c=>c.metadata.scripts).flat().forEach(c=>{for(let s in c.values){if(!c.values.hasOwnProperty(s))continue;let l=c.values[s];l.type==="asset"&&l.value&&w.set(l.value,null)}});let r=[];w.forEach((c,s)=>{w.get(s)||r.push(new Promise(async l=>{try{let u=await(await fetch(`${o}${s}`)).json();w.set(s,u)}catch(m){console.error(m)}l()}))}),await Promise.all(r)}i(ve,"_preloadScriptsAssets");function M(e,o,t,n){o.metadata?.scripts&&(o.metadata.scripts?.forEach(async r=>{if(!r.enabled)return;let c=t[r.key];if(c)if(c.default){let s=new c.default(o);at(o,s,r.key),Te(e,o,r,s,n),s.onStart&&e.onBeforeRenderObservable.addOnce(()=>s.onStart()),s.onUpdate&&e.onBeforeRenderObservable.add(()=>s.onUpdate())}else c.onStart&&e.onBeforeRenderObservable.addOnce(()=>c.onStart(o)),c.onUpdate&&e.onBeforeRenderObservable.add(()=>c.onUpdate(o))}),o.metadata.scripts=void 0)}i(M,"_applyScriptsForObject");function Ht(e,o,t){if(t??=e.getScene?.(),!t)throw new Error("Cannot apply script on object: no scene available.");let n=new o(e);return Te(t,e,{values:{}},n,""),n.onStart&&t.onBeforeRenderObservable.addOnce(()=>n.onStart()),n.onUpdate&&t.onBeforeRenderObservable.add(()=>n.onUpdate()),n}i(Ht,"applyScriptOnObject");var K=new Map;function at(e,o,t){let n={key:t,instance:o};K.has(e)?K.get(e).push(n):K.set(e,[n]),e.__editorRunningScripts??=[],e.__editorRunningScripts.push(n),(N(e)||ae(e)||se(e))&&e.onDisposeObservable.addOnce(()=>{K.delete(e)})}i(at,"registerScriptInstance");function ct(e,o){return K.get(e)?.filter(r=>r.instance.constructor===o)?.map(r=>r.instance)??null}i(ct,"getAllScriptsByClassForObject");function jt(e,o){return ct(e,o)?.[0]??null}i(jt,"getScriptByClassForObject");var Oe=require("babylonjs"),J=require("babylonjs"),Wt=(0,J.GetParser)(Oe.SceneComponentConstants.NAME_AUDIO);(0,J.AddParser)(Oe.SceneComponentConstants.NAME_AUDIO,(e,o,t,n)=>{Wt?.(e,o,t,n),e.sounds?.forEach(r=>{let c=t.sounds?.find(s=>s.name===r.name);c&&(c.id=r.id,c.uniqueId=r.uniqueId)})});function O(e){let o=1;for(;o<=e;)o<<=1;return o>>1}i(O,"getPowerOfTwoUntil");var Re=require("babylonjs"),ee=Re.SerializationHelper._TextureParser;Re.SerializationHelper._TextureParser=(e,o,t)=>{if(o.loadingQuality==="high"||!e.metadata?.baseSize)return ee(e,o,t);let n=e.metadata.baseSize.width,r=e.metadata.baseSize.height,c=n===O(n)||r===O(r),s="";switch(o.loadingQuality){case"medium":let f=n*.66>>0,y=r*.66>>0;c&&(f=O(f),y=O(y)),s=`_${f}_${y}`;break;case"low":let g=n*.33>>0,d=r*.33>>0;c&&(g=O(g),d=O(d)),s=`_${g}_${d}`;break}let l=e.name;if(!l||!s)return ee(e,o,t);let m=l.split("/"),u=m.pop();if(!u)return ee(e,o,t);let S=u.split(".").pop(),I=`${u.replace(`.${S}`,"")}${s}.${S}`;return m.push(I),e.name=m.join("/"),ee(e,o,t)};var lt=require("babylonjs"),we=require("babylonjs"),mt=require("babylonjs"),pt=require("babylonjs");async function Ut(e,o,t,n,r){t.loadingQuality=r?.quality??"high",await(0,mt.AppendSceneAsync)(`${e}${o}`,t,{pluginExtension:".babylon",onProgress:i(s=>{let l=Math.min(s.loaded/s.total*.5);r?.onProgress?.(l)},"onProgress")}),pt.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&t.meshes.forEach(s=>v(s)&&s._checkDelayState());let c=t.getWaitingItemsCount();for(;!t.isDisposed&&(!t.isReady()||t.getWaitingItemsCount()>0);){await new Promise(l=>setTimeout(l,150));let s=c-t.getWaitingItemsCount();s===c&&t.textures.forEach(l=>{l.delayLoadState===we.Constants.DELAYLOADSTATE_NONE&&(l.delayLoadState=we.Constants.DELAYLOADSTATE_LOADED)}),r?.onProgress?.(.5+s/c*.5)}await ve(t,e),r?.onProgress?.(1),ce(t),le(t),t.metadata?.rendering&&(nt(t,t.metadata.rendering),t.activeCamera&&Je(t.activeCamera,e)),t.metadata?.physicsGravity&&t.getPhysicsEngine()?.setGravity(lt.Vector3.FromArray(t.metadata?.physicsGravity)),M(t,t,n,e),t.transformNodes.forEach(s=>{M(t,s,n,e)}),t.meshes.forEach(s=>{tt(s),M(t,s,n,e)}),t.lights.forEach(s=>{M(t,s,n,e)}),t.cameras.forEach(s=>{M(t,s,n,e)})}i(Ut,"loadScene");var ut=require("babylonjs");async function $t(e,o,t){let r=await(await fetch(e+o)).json(),s=ut.Tools.Instantiate(r.customType).Parse(r,t,e);return s.id=r.id,s.uniqueId=r.uniqueId,s}i($t,"loadMaterialFromFile");function Qt(e){return Promise.all(e.materials.map(async o=>{let t=o.getBindedMeshes();await Promise.all(t.map(async n=>{k(n)||await o.forceCompilationAsync(n,{clipPlane:!!e.clipPlane,useInstances:n.hasInstances})}))}))}i(Qt,"forceCompileAllSceneMaterials");function Zt(e){e.setTextureFormatToUse(["-dxt.ktx","-astc.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"])}i(Zt,"configureEngineToUseCompressedTextures");var D=require("babylonjs");function H(e){if(!isNaN(parseFloat(e))&&isFinite(e))return D.Animation.ANIMATIONTYPE_FLOAT;switch(e?.getClassName?.()){case"Vector2":return D.Animation.ANIMATIONTYPE_VECTOR2;case"Vector3":return D.Animation.ANIMATIONTYPE_VECTOR3;case"Quaternion":return D.Animation.ANIMATIONTYPE_QUATERNION;case"Color3":return D.Animation.ANIMATIONTYPE_COLOR3;case"Color4":return D.Animation.ANIMATIONTYPE_COLOR4;case"Size":return D.Animation.ANIMATIONTYPE_SIZE;case"Matrix":return D.Animation.ANIMATIONTYPE_MATRIX}return null}i(H,"getAnimationTypeForObject");function qt(e){return function(o,t){let n=o.constructor;n._NodesFromScene??=[],n._NodesFromScene.push({propertyKey:t,nodeName:e})}}i(qt,"nodeFromScene");function Xt(e,o=!1){return function(t,n){let r=t.constructor;r._NodesFromDescendants??=[],r._NodesFromDescendants.push({propertyKey:n,nodeName:e,directDescendantsOnly:o})}}i(Xt,"nodeFromDescendants");function Jt(e){return function(o,t){let n=o.constructor;n._AnimationGroups??=[],n._AnimationGroups.push({animationGroupName:e,propertyKey:t})}}i(Jt,"animationGroupFromScene");function en(e,o){return function(t,n){let r=t.constructor;r._GuiFromAsset??=[],r._GuiFromAsset.push({propertyKey:n,pathInAssets:e,onGuiCreated:o})}}i(en,"guiFromAsset");function tn(e){return function(o,t){let n=o.constructor;n._SoundsFromScene??=[],n._SoundsFromScene.push({propertyKey:t,soundName:e})}}i(tn,"soundFromScene");function nn(e,o=!1){return function(t,n){let r=t.constructor;r._ParticleSystemsFromScene??=[],r._ParticleSystemsFromScene.push({propertyKey:n,particleSystemName:e,directDescendantsOnly:o})}}i(nn,"particleSystemFromScene");function rn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"boolean"}})}}i(rn,"visibleAsBoolean");function on(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"string"}})}}i(on,"visibleAsString");function sn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"number"}})}}i(sn,"visibleAsNumber");function an(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector2"}})}}i(an,"visibleAsVector2");function cn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector3"}})}}i(cn,"visibleAsVector3");function ln(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color3"}})}}i(ln,"visibleAsColor3");function mn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color4"}})}}i(mn,"visibleAsColor4");function pn(e,o,t){return function(n,r){let c=n.constructor;c._VisibleInInspector??=[],c._VisibleInInspector.push({label:o,propertyKey:r,configuration:{...t,entityType:e,type:"entity"}})}}i(pn,"visibleAsEntity");function un(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"texture"}})}}i(un,"visibleAsTexture");function gn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"keymap"}})}}i(gn,"visibleAsKeyMap");function fn(e,o,t){return function(n,r){let c=n.constructor;c._VisibleInInspector??=[],c._VisibleInInspector.push({label:o,propertyKey:r,configuration:{...t,assetType:e,type:"asset"}})}}i(fn,"visibleAsAsset");function dn(e,o){return function(t,n){let r=t.constructor;r._PointerEvents??=[],r._PointerEvents.push({propertyKey:n,options:{mode:"global",...o??{}},eventTypes:Array.isArray(e)?e:[e]})}}i(dn,"onPointerEvent");function yn(e){return function(o,t){let n=o.constructor;n._KeyboardEvents??=[],n._KeyboardEvents.push({propertyKey:t,eventTypes:Array.isArray(e)?e:[e]})}}i(yn,"onKeyboardEvent");var te=require("babylonjs");function gt(e,o){let t;switch(e){case te.Animation.ANIMATIONTYPE_FLOAT:t=o.value;break;default:t=o.value.clone();break}return{value:t,frame:o.frame,interpolation:o.interpolation,inTangent:e===te.Animation.ANIMATIONTYPE_FLOAT?o.inTangent:o.inTangent?.clone(),outTangent:e===te.Animation.ANIMATIONTYPE_FLOAT?o.outTangent:o.outTangent?.clone()}}i(gt,"cloneKey");function ne(e,o){let t=o.split("."),n=e;for(let r=0;r<t.length;++r)n=n[t[r]];return n}i(ne,"getPropertyValue");var R=require("babylonjs"),re=require("babylonjs"),A=require("babylonjs");function hn(e,o){return{name:e.name,framesPerSecond:e.framesPerSecond,outputFramesPerSecond:e.outputFramesPerSecond,tracks:e.tracks.map(t=>{let n=null,r=null;if(t.node?(n=o.getNodeById(t.node),n||(n=o.particleSystems?.find(s=>s.id===t.node)??null)):t.defaultRenderingPipeline&&(n=z()),t.propertyPath){let s=ne(n,t.propertyPath);r=H(s)}let c=null;return t.sound&&(c=Z(t.sound,o)),{node:n,sound:c,propertyPath:t.propertyPath,defaultRenderingPipeline:t.defaultRenderingPipeline,animationGroup:t.animationGroup?o.getAnimationGroupByName(t.animationGroup):null,animationGroups:t.animationGroups,sounds:t.sounds,keyFrameEvents:t.keyFrameEvents?.map(s=>{let l={...s};switch(s.data?.type){case"set-enabled":l.data={type:"set-enabled",value:s.data.value,node:o.getNodeById(s.data.node)};break;case"apply-impulse":l.data={type:"apply-impulse",radius:s.data.radius,mesh:o.getMeshById(s.data.mesh),force:A.Vector3.FromArray(s.data.force),contactPoint:A.Vector3.FromArray(s.data.contactPoint)};break}return l}),keyFrameAnimations:n&&r!==null&&t.keyFrameAnimations?.map(s=>{let l=s.type==="key"?s:null;if(l)return{...l,value:x(l.value,r),inTangent:x(l.inTangent,r),outTangent:x(l.outTangent,r)};let m=s.type==="cut"?s:null;if(m)return{...m,key1:{...m.key1,value:x(m.key1.value,r),inTangent:x(m.key1.inTangent,r),outTangent:x(m.key1.outTangent,r)},key2:{...m.key2,value:x(m.key2.value,r),inTangent:x(m.key2.inTangent,r),outTangent:x(m.key2.outTangent,r)}};throw new Error(`Unknown key frame type: ${s.type}`)})}})}}i(hn,"parseCinematic");function x(e,o){if(e===null)return null;if(e!==void 0)switch(o){case R.Animation.ANIMATIONTYPE_FLOAT:return e;case R.Animation.ANIMATIONTYPE_VECTOR2:return A.Vector2.FromArray(e);case R.Animation.ANIMATIONTYPE_VECTOR3:return A.Vector3.FromArray(e);case R.Animation.ANIMATIONTYPE_QUATERNION:return A.Quaternion.FromArray(e);case R.Animation.ANIMATIONTYPE_COLOR3:return re.Color3.FromArray(e);case R.Animation.ANIMATIONTYPE_COLOR4:return re.Color4.FromArray(e);case R.Animation.ANIMATIONTYPE_MATRIX:return A.Matrix.FromArray(e)}}i(x,"parseCinematicKeyValue");function ft(e){e.node?.setEnabled(e.value)}i(ft,"handleSetEnabledEvent");var Me=require("babylonjs"),dt=Me.Vector3.Zero();function yt(e,o){let t=o.mesh?[o.mesh]:e.meshes.filter(n=>n.physicsAggregate);o.radius&&(t=t.filter(n=>{let r=n.getBoundingInfo().boundingBox.centerWorld;return Me.Vector3.Distance(r,o.contactPoint)<=o.radius})),t.forEach(n=>{if(n.physicsAggregate?.body){let r=o.contactPoint.subtract(n.getBoundingInfo().boundingBox.centerWorld);r.multiplyInPlace(o.force),n.physicsAggregate.body.setLinearVelocity(dt),n.physicsAggregate.body.setAngularVelocity(dt),n.physicsAggregate.body.applyImpulse(r.negateInPlace(),o.contactPoint)}})}i(yt,"handleApplyImpulseEvent");var ht=require("babylonjs"),T=require("babylonjs"),j=require("babylonjs"),St=require("babylonjs");function Sn(e,o,t){let n=new St.AnimationGroup(e.name,o);return e.tracks.forEach(r=>{let c=r.animationGroup;c&&r.animationGroups?.forEach(f=>{c.targetedAnimations.forEach(y=>{let g=null;e:{let E=n.targetedAnimations.filter(W=>W.target===y.target);if(E.length){let W=E.find(bt=>bt.animation.targetProperty===y.animation.targetProperty);if(W){g=W.animation;break e}}g=y.animation.clone(),g.setKeys([]),g.name=ht.Tools.RandomId(),g.framePerSecond=e.framesPerSecond}let d=g.getKeys(),F=y.animation.getKeys(),oe=f.speed,Fe=e.framesPerSecond/y.animation.framePerSecond/oe;F.forEach(E=>{E.frame>=f.startFrame&&E.frame<=f.endFrame&&d.push({...gt(y.animation.dataType,E),frame:f.frame+E.frame*Fe})}),g.setKeys(d),n.addTargetedAnimation(g,y.target)})});let s=r.sound,l=s?.getAudioBuffer();if(!t?.ignoreSounds&&s&&l&&r.sounds?.length){let f={dummy:0},y=new T.Animation(s.name,"dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),g=0;r.sounds?.forEach(d=>{let F=d.endFrame-d.startFrame;g=Math.max(g,d.frame+F),y.addEvent(new j.AnimationEvent(d.frame,oe=>{let E=(oe-d.frame+d.startFrame)/e.framesPerSecond;s.play(0,E)},!1)),y.addEvent(new j.AnimationEvent(d.frame+F,()=>{s.stop()}))}),y.setKeys([{frame:0,value:0},{frame:g,value:g}]),n.addTargetedAnimation(y,f)}if(r.keyFrameEvents){let f={dummy:0},y=new T.Animation("events","dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),g=0;r.keyFrameEvents?.forEach(d=>{g=Math.max(g,d.frame),y.addEvent(new j.AnimationEvent(d.frame,()=>{switch(d.data?.type){case"set-enabled":ft(d.data);break;case"apply-impulse":yt(o,d.data);break}}))}),y.setKeys([{frame:0,value:0},{frame:g,value:g}]),n.addTargetedAnimation(y,f)}let m=r.defaultRenderingPipeline?z():r.node;if(!m||!r.propertyPath||!r.keyFrameAnimations)return;let u=ne(m,r.propertyPath),S=H(u);if(S===null)return;let C=new T.Animation(r.propertyPath,r.propertyPath,60,S,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),I=[];r.keyFrameAnimations?.forEach(f=>{let y=f.type==="key"?f:null;if(y)return I.push(y);let g=f.type==="cut"?f:null;g&&(I.push(g.key1),I.push(g.key2),Q(m)&&r.propertyPath==="position"&&C.addEvent(new j.AnimationEvent(g.key1.frame,()=>{let d=be();if(!d)return;let F=d.motionStrength;d.motionStrength=0,requestAnimationFrame(()=>{d.motionStrength=F})})))}),C.setKeys(I),n.addTargetedAnimation(C,m)}),n.normalize(),n}i(Sn,"generateCinematicAnimationGroup");function bn(e){return e.type==="key"}i(bn,"isCinematicKey");function Pn(e){return e.type==="cut"}i(Pn,"isCinematicKeyCut");function In(e){return e.type==="event"}i(In,"isCinematicKeyEvent");function Cn(e){return e.type==="group"}i(Cn,"isCinematicGroup");function xn(e){return e.type==="sound"}i(xn,"isCinematicSound");0&&(module.exports={_applyScriptsForObject,_preloadScriptsAssets,animationGroupFromScene,applyScriptOnObject,configureEngineToUseCompressedTextures,configureShadowMapRefreshRate,configureShadowMapRenderListPredicate,createDefaultRenderingPipeline,createMotionBlurPostProcess,createSSAO2RenderingPipeline,createSSRRenderingPipeline,createVLSPostProcess,defaultPipelineCameraConfigurations,disposeDefaultRenderingPipeline,disposeMotionBlurPostProcess,disposeSSAO2RenderingPipeline,disposeSSRRenderingPipeline,disposeVLSPostProcess,forceCompileAllSceneMaterials,generateCinematicAnimationGroup,getAllScriptsByClassForObject,getAnimationTypeForObject,getDefaultRenderingPipeline,getMotionBlurPostProcess,getPowerOfTwoUntil,getSSAO2RenderingPipeline,getSSRRenderingPipeline,getScriptByClassForObject,getVLSPostProcess,guiFromAsset,isAbstractMesh,isAnyParticleSystem,isArcRotateCamera,isBone,isCamera,isCinematicGroup,isCinematicKey,isCinematicKeyCut,isCinematicKeyEvent,isCinematicSound,isDirectionalLight,isFreeCamera,isGPUParticleSystem,isGroundMesh,isHemisphericLight,isInstancedMesh,isLight,isMesh,isNode,isParticleSystem,isPointLight,isScene,isSpotLight,isTexture,isTransformNode,loadMaterialFromFile,loadScene,motionBlurPostProcessCameraConfigurations,nodeFromDescendants,nodeFromScene,onKeyboardEvent,onPointerEvent,parseCinematic,parseCinematicKeyValue,parseDefaultRenderingPipeline,parseMotionBlurPostProcess,parseSSAO2RenderingPipeline,parseSSRRenderingPipeline,parseVLSPostProcess,particleSystemFromScene,registerScriptInstance,scriptAssetsCache,scriptsDictionary,serializeDefaultRenderingPipeline,serializeMotionBlurPostProcess,serializeSSAO2RenderingPipeline,serializeSSRRenderingPipeline,serializeVLSPostProcess,setDefaultRenderingPipelineRef,setMotionBlurPostProcessRef,setSSAO2RenderingPipelineRef,setSSRRenderingPipelineRef,setVLSPostProcessRef,soundFromScene,ssaoRenderingPipelineCameraConfigurations,ssrRenderingPipelineCameraConfigurations,visibleAsAsset,visibleAsBoolean,visibleAsColor3,visibleAsColor4,visibleAsEntity,visibleAsKeyMap,visibleAsNumber,visibleAsString,visibleAsTexture,visibleAsVector2,visibleAsVector3,vlsPostProcessCameraConfigurations});
|
|
@@ -6,7 +6,8 @@ import { NodeParticleSystemSet } from "@babylonjs/core/Particles/Node/nodePartic
|
|
|
6
6
|
import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture";
|
|
7
7
|
import { getSoundById } from "../tools/sound";
|
|
8
8
|
import { isAbstractMesh, isNode } from "../tools/guards";
|
|
9
|
-
|
|
9
|
+
import { scriptAssetsCache } from "../loading/script";
|
|
10
|
+
export function applyDecorators(scene, object, script, instance, rootUrl) {
|
|
10
11
|
const ctor = instance.constructor;
|
|
11
12
|
if (!ctor) {
|
|
12
13
|
return;
|
|
@@ -30,7 +31,7 @@ export async function applyDecorators(scene, object, script, instance, rootUrl)
|
|
|
30
31
|
instance[params.propertyKey.toString()] = sound ?? null;
|
|
31
32
|
});
|
|
32
33
|
// @guiFromAsset
|
|
33
|
-
|
|
34
|
+
(ctor._GuiFromAsset ?? []).map(async (params) => {
|
|
34
35
|
const guiUrl = `${rootUrl}assets/${params.pathInAssets}`;
|
|
35
36
|
try {
|
|
36
37
|
const response = await fetch(guiUrl);
|
|
@@ -44,7 +45,7 @@ export async function applyDecorators(scene, object, script, instance, rootUrl)
|
|
|
44
45
|
console.error(`Failed to load GUI from asset: ${guiUrl}`);
|
|
45
46
|
throw e;
|
|
46
47
|
}
|
|
47
|
-
})
|
|
48
|
+
});
|
|
48
49
|
// @fromParticleSystems
|
|
49
50
|
ctor._ParticleSystemsFromScene?.forEach((params) => {
|
|
50
51
|
const particleSystem = scene.particleSystems?.find((particleSystem) => {
|
|
@@ -56,7 +57,7 @@ export async function applyDecorators(scene, object, script, instance, rootUrl)
|
|
|
56
57
|
instance[params.propertyKey.toString()] = particleSystem;
|
|
57
58
|
});
|
|
58
59
|
// @visibleAsNumber, @visibleAsBoolean etc.
|
|
59
|
-
|
|
60
|
+
(ctor._VisibleInInspector ?? []).map(async (params) => {
|
|
60
61
|
const propertyKey = params.propertyKey.toString();
|
|
61
62
|
const attachedScripts = script.values;
|
|
62
63
|
if (attachedScripts.hasOwnProperty(propertyKey) && attachedScripts[propertyKey].hasOwnProperty("value")) {
|
|
@@ -105,9 +106,11 @@ export async function applyDecorators(scene, object, script, instance, rootUrl)
|
|
|
105
106
|
case "asset":
|
|
106
107
|
if (value) {
|
|
107
108
|
const assetType = params.configuration.assetType;
|
|
108
|
-
const
|
|
109
|
-
const data = await response.json();
|
|
109
|
+
const data = scriptAssetsCache.get(value);
|
|
110
110
|
switch (assetType) {
|
|
111
|
+
case "json":
|
|
112
|
+
instance[propertyKey] = data;
|
|
113
|
+
break;
|
|
111
114
|
case "nodeParticleSystemSet":
|
|
112
115
|
const npss = NodeParticleSystemSet.Parse(data);
|
|
113
116
|
instance[propertyKey] = npss;
|
|
@@ -119,7 +122,7 @@ export async function applyDecorators(scene, object, script, instance, rootUrl)
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
})
|
|
125
|
+
});
|
|
123
126
|
// @onPointerEvent
|
|
124
127
|
if (ctor._PointerEvents?.length) {
|
|
125
128
|
const wrongMeshListener = ctor._PointerEvents.find((params) => params.options.mode === "attachedMeshOnly");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/decorators/apply.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAE7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAIlF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/decorators/apply.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,OAAO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ChB,IAAI,EAAE,SAAS;aACf;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAOD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc,EAAE,aAAsE;IACrH,OAAO,UAAU,MAAW,EAAE,WAA4B;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAkC,CAAC;QAEvD,IAAI,CAAC,mBAAmB,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;YAC7B,KAAK;YACL,WAAW;YACX,aAAa,EAAE;gBACd,GAAG,aAAa;gBAChB,IAAI,EAAE,QAAQ;aACd;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AASD,MAAM,UAAU,cAAc,CAC7B,SAAsD,EACtD,KAAc,EACd,aAAuF;IAEvF,OAAO,UAAU,MAAW,EAAE,WAA4B;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAkC,CAAC;QAEvD,IAAI,CAAC,mBAAmB,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;YAC7B,KAAK;YACL,WAAW;YACX,aAAa,EAAE;gBACd,GAAG,aAAa;gBAChB,SAAS;gBACT,IAAI,EAAE,OAAO;aACkC;SAChD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { Constants } from "@babylonjs/core/Engines/constants";
|
|
|
3
3
|
import { AppendSceneAsync } from "@babylonjs/core/Loading/sceneLoader";
|
|
4
4
|
import { SceneLoaderFlags } from "@babylonjs/core/Loading/sceneLoaderFlags";
|
|
5
5
|
import { isMesh } from "../tools/guards";
|
|
6
|
-
import {
|
|
6
|
+
import { configureShadowMapRefreshRate, configureShadowMapRenderListPredicate } from "../tools/light";
|
|
7
|
+
import { applyRenderingConfigurationForCamera } from "../rendering/tools";
|
|
7
8
|
import { configurePhysicsAggregate } from "./physics";
|
|
8
9
|
import { applyRenderingConfigurations } from "./rendering";
|
|
9
|
-
import {
|
|
10
|
-
import { configureShadowMapRefreshRate, configureShadowMapRenderListPredicate } from "../tools/light";
|
|
10
|
+
import { _applyScriptsForObject, _preloadScriptsAssets } from "./script";
|
|
11
11
|
import "./sound";
|
|
12
12
|
import "./texture";
|
|
13
13
|
export async function loadScene(rootUrl, sceneFilename, scene, scriptsMap, options) {
|
|
@@ -37,6 +37,7 @@ export async function loadScene(rootUrl, sceneFilename, scene, scriptsMap, optio
|
|
|
37
37
|
}
|
|
38
38
|
options?.onProgress?.(0.5 + (loadedItemsCount / waitingItemsCount) * 0.5);
|
|
39
39
|
}
|
|
40
|
+
await _preloadScriptsAssets(scene, rootUrl);
|
|
40
41
|
options?.onProgress?.(1);
|
|
41
42
|
configureShadowMapRenderListPredicate(scene);
|
|
42
43
|
configureShadowMapRefreshRate(scene);
|
|
@@ -49,21 +50,19 @@ export async function loadScene(rootUrl, sceneFilename, scene, scriptsMap, optio
|
|
|
49
50
|
if (scene.metadata?.physicsGravity) {
|
|
50
51
|
scene.getPhysicsEngine()?.setGravity(Vector3.FromArray(scene.metadata?.physicsGravity));
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
]);
|
|
53
|
+
_applyScriptsForObject(scene, scene, scriptsMap, rootUrl);
|
|
54
|
+
scene.transformNodes.forEach((transformNode) => {
|
|
55
|
+
_applyScriptsForObject(scene, transformNode, scriptsMap, rootUrl);
|
|
56
|
+
});
|
|
57
|
+
scene.meshes.forEach((mesh) => {
|
|
58
|
+
configurePhysicsAggregate(mesh);
|
|
59
|
+
_applyScriptsForObject(scene, mesh, scriptsMap, rootUrl);
|
|
60
|
+
});
|
|
61
|
+
scene.lights.forEach((light) => {
|
|
62
|
+
_applyScriptsForObject(scene, light, scriptsMap, rootUrl);
|
|
63
|
+
});
|
|
64
|
+
scene.cameras.forEach((camera) => {
|
|
65
|
+
_applyScriptsForObject(scene, camera, scriptsMap, rootUrl);
|
|
66
|
+
});
|
|
68
67
|
}
|
|
69
68
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/loading/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/loading/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AAEtG,OAAO,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW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,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7B,yBAAyB,CAAC,IAAI,CAAC,CAAC;QAChC,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAChC,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,56 @@
|
|
|
1
1
|
import { applyDecorators } from "../decorators/apply";
|
|
2
2
|
import { isAnyParticleSystem, isNode, isScene } from "../tools/guards";
|
|
3
|
+
/**
|
|
4
|
+
* Defines the cache of all
|
|
5
|
+
*/
|
|
6
|
+
export const scriptAssetsCache = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export async function _preloadScriptsAssets(scene, rootUrl) {
|
|
11
|
+
const nodes = [...scene.transformNodes, ...scene.meshes, ...scene.lights, ...scene.cameras];
|
|
12
|
+
const scripts = nodes
|
|
13
|
+
.filter((node) => node.metadata.scripts?.length)
|
|
14
|
+
.map((node) => node.metadata.scripts)
|
|
15
|
+
.flat();
|
|
16
|
+
scripts.forEach((script) => {
|
|
17
|
+
for (const key in script.values) {
|
|
18
|
+
if (!script.values.hasOwnProperty(key)) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const obj = script.values[key];
|
|
22
|
+
if (obj.type === "asset" && obj.value) {
|
|
23
|
+
scriptAssetsCache.set(obj.value, null);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const promises = [];
|
|
28
|
+
scriptAssetsCache.forEach((_, key) => {
|
|
29
|
+
if (scriptAssetsCache.get(key)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
promises.push(new Promise(async (resolve) => {
|
|
33
|
+
try {
|
|
34
|
+
const response = await fetch(`${rootUrl}${key}`);
|
|
35
|
+
const data = await response.json();
|
|
36
|
+
scriptAssetsCache.set(key, data);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.error(e);
|
|
40
|
+
}
|
|
41
|
+
resolve();
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
await Promise.all(promises);
|
|
45
|
+
}
|
|
3
46
|
/**
|
|
4
47
|
* @internal
|
|
5
48
|
*/
|
|
6
|
-
export
|
|
49
|
+
export function _applyScriptsForObject(scene, object, scriptsMap, rootUrl) {
|
|
7
50
|
if (!object.metadata?.scripts) {
|
|
8
51
|
return;
|
|
9
52
|
}
|
|
10
|
-
|
|
53
|
+
object.metadata.scripts?.forEach(async (script) => {
|
|
11
54
|
if (!script.enabled) {
|
|
12
55
|
return;
|
|
13
56
|
}
|
|
@@ -18,7 +61,7 @@ export async function _applyScriptsForObject(scene, object, scriptsMap, rootUrl)
|
|
|
18
61
|
if (exports.default) {
|
|
19
62
|
const instance = new exports.default(object);
|
|
20
63
|
registerScriptInstance(object, instance, script.key);
|
|
21
|
-
|
|
64
|
+
applyDecorators(scene, object, script, instance, rootUrl);
|
|
22
65
|
if (instance.onStart) {
|
|
23
66
|
scene.onBeforeRenderObservable.addOnce(() => instance.onStart());
|
|
24
67
|
}
|
|
@@ -34,9 +77,37 @@ export async function _applyScriptsForObject(scene, object, scriptsMap, rootUrl)
|
|
|
34
77
|
scene.onBeforeRenderObservable.add(() => exports.onUpdate(object));
|
|
35
78
|
}
|
|
36
79
|
}
|
|
37
|
-
})
|
|
80
|
+
});
|
|
38
81
|
object.metadata.scripts = undefined;
|
|
39
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Applies the given script constructor on the given object on the fly.
|
|
85
|
+
* @param object defines the reference to the object on which the script must be applied.
|
|
86
|
+
* @param scriptConstructor defines the constructor of the script to apply on the object.
|
|
87
|
+
* @param scene defines the reference to the scene. If not provided, will try to get it from object.getScene()
|
|
88
|
+
* @example
|
|
89
|
+
* import { applyScriptOnObject } from "babylonjs-editor-tools";
|
|
90
|
+
* ...
|
|
91
|
+
* const instance = applyScriptOnObject(mesh, MyScriptClass);
|
|
92
|
+
*/
|
|
93
|
+
export function applyScriptOnObject(object, scriptConstructor, scene) {
|
|
94
|
+
scene ??= object.getScene?.();
|
|
95
|
+
if (!scene) {
|
|
96
|
+
throw new Error("Cannot apply script on object: no scene available.");
|
|
97
|
+
}
|
|
98
|
+
const instance = new scriptConstructor(object);
|
|
99
|
+
const script = {
|
|
100
|
+
values: {},
|
|
101
|
+
};
|
|
102
|
+
applyDecorators(scene, object, script, instance, "");
|
|
103
|
+
if (instance.onStart) {
|
|
104
|
+
scene.onBeforeRenderObservable.addOnce(() => instance.onStart());
|
|
105
|
+
}
|
|
106
|
+
if (instance.onUpdate) {
|
|
107
|
+
scene.onBeforeRenderObservable.add(() => instance.onUpdate());
|
|
108
|
+
}
|
|
109
|
+
return instance;
|
|
110
|
+
}
|
|
40
111
|
export const scriptsDictionary = new Map();
|
|
41
112
|
/**
|
|
42
113
|
* When a scene is being loaded, scripts that were attached to objects in the scene using the Editor are processed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.js","sourceRoot":"","sources":["../../../src/loading/script.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAIvE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../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;QACtE,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE;YACxC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC,CAAQ,CAAC,CAAC;IACZ,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,6BAA6B,CAAsC,MAAW,EAAE,SAAY;IAC3G,MAAM,IAAI,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC;IAEzE,OAAQ,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAuB,IAAI,IAAI,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,yBAAyB,CAAsC,MAAW,EAAE,SAAY;IACvG,MAAM,MAAM,GAAG,6BAA6B,CAAI,MAAM,EAAE,SAAS,CAAC,CAAC;IACnE,OAAQ,MAAM,EAAE,CAAC,CAAC,CAAqB,IAAI,IAAI,CAAC;AACjD,CAAC"}
|
|
@@ -3,46 +3,46 @@ import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture
|
|
|
3
3
|
import { IPointerEventDecoratorOptions } from "./events";
|
|
4
4
|
import { VisibleInInspectorDecoratorConfiguration } from "./inspector";
|
|
5
5
|
export interface ISceneDecoratorData {
|
|
6
|
-
_NodesFromScene
|
|
6
|
+
_NodesFromScene?: {
|
|
7
7
|
nodeName: string;
|
|
8
8
|
propertyKey: string | Symbol;
|
|
9
9
|
}[];
|
|
10
|
-
_NodesFromDescendants
|
|
10
|
+
_NodesFromDescendants?: {
|
|
11
11
|
nodeName: string;
|
|
12
12
|
propertyKey: string | Symbol;
|
|
13
13
|
directDescendantsOnly: boolean;
|
|
14
14
|
}[];
|
|
15
|
-
_AnimationGroups
|
|
15
|
+
_AnimationGroups?: {
|
|
16
16
|
animationGroupName: string;
|
|
17
17
|
propertyKey: string | Symbol;
|
|
18
18
|
}[];
|
|
19
|
-
_SoundsFromScene
|
|
19
|
+
_SoundsFromScene?: {
|
|
20
20
|
soundName: string;
|
|
21
21
|
propertyKey: string | Symbol;
|
|
22
22
|
}[];
|
|
23
|
-
_GuiFromAsset
|
|
23
|
+
_GuiFromAsset?: {
|
|
24
24
|
pathInAssets: string;
|
|
25
25
|
onGuiCreated?: (instance: unknown, gui: AdvancedDynamicTexture) => unknown;
|
|
26
26
|
propertyKey: string | Symbol;
|
|
27
27
|
}[];
|
|
28
|
-
_ParticleSystemsFromScene
|
|
28
|
+
_ParticleSystemsFromScene?: {
|
|
29
29
|
particleSystemName: string;
|
|
30
30
|
directDescendantsOnly: boolean;
|
|
31
31
|
propertyKey: string | Symbol;
|
|
32
32
|
}[];
|
|
33
|
-
_VisibleInInspector
|
|
33
|
+
_VisibleInInspector?: {
|
|
34
34
|
label?: string;
|
|
35
35
|
propertyKey: string | Symbol;
|
|
36
36
|
configuration: VisibleInInspectorDecoratorConfiguration;
|
|
37
37
|
}[];
|
|
38
|
-
_PointerEvents
|
|
38
|
+
_PointerEvents?: {
|
|
39
39
|
eventTypes: number[];
|
|
40
40
|
options: IPointerEventDecoratorOptions;
|
|
41
41
|
propertyKey: string | Symbol;
|
|
42
42
|
}[];
|
|
43
|
-
_KeyboardEvents
|
|
43
|
+
_KeyboardEvents?: {
|
|
44
44
|
eventTypes: number[];
|
|
45
45
|
propertyKey: string | Symbol;
|
|
46
46
|
}[];
|
|
47
47
|
}
|
|
48
|
-
export declare function applyDecorators(scene: Scene, object: any, script: any, instance: any, rootUrl: string):
|
|
48
|
+
export declare function applyDecorators(scene: Scene, object: any, script: any, instance: any, rootUrl: string): void;
|
|
@@ -12,6 +12,9 @@ export type VisibleInInspectorDecoratorConfiguration = {
|
|
|
12
12
|
* @param configuration defines the optional configuration for the field in the inspector (description, etc.).
|
|
13
13
|
*/
|
|
14
14
|
export declare function visibleAsBoolean(label?: string, configuration?: Omit<VisibleInInspectorDecoratorConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
|
|
15
|
+
export type VisibleInInspectorDecoratorStringConfiguration = VisibleInInspectorDecoratorConfiguration & {
|
|
16
|
+
multiline?: boolean;
|
|
17
|
+
};
|
|
15
18
|
/**
|
|
16
19
|
* Makes the decorated property visible in the editor inspector as a string.
|
|
17
20
|
* The property can be customized per object in the editor and the custom value is applied
|
|
@@ -20,7 +23,7 @@ export declare function visibleAsBoolean(label?: string, configuration?: Omit<Vi
|
|
|
20
23
|
* @param label defines the optional label displayed in the inspector in the editor.
|
|
21
24
|
* @param configuration defines the optional configuration for the field in the inspector (description, etc.).
|
|
22
25
|
*/
|
|
23
|
-
export declare function visibleAsString(label?: string, configuration?: Omit<
|
|
26
|
+
export declare function visibleAsString(label?: string, configuration?: Omit<VisibleInInspectorDecoratorStringConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
|
|
24
27
|
/**
|
|
25
28
|
* Makes the decorated property visible in the editor inspector as a number.
|
|
26
29
|
* The property can be customized per object in the editor and the custom value is applied
|
|
@@ -127,7 +130,7 @@ export type VisibleInInspectorDecoratorTextureConfiguration = VisibleInInspector
|
|
|
127
130
|
* @param configuration defines the optional configuration for the field in the inspector (description, etc.).
|
|
128
131
|
*/
|
|
129
132
|
export declare function visibleAsKeyMap(label?: string, configuration?: Omit<VisibleInInspectorDecoratorConfiguration, "type">): (target: any, propertyKey: string | Symbol) => void;
|
|
130
|
-
export type VisibleInspectorDecoratorAssetPossibleTypes = "material" | "nodeParticleSystemSet";
|
|
133
|
+
export type VisibleInspectorDecoratorAssetPossibleTypes = "json" | "material" | "nodeParticleSystemSet";
|
|
131
134
|
export type VisibleInspectorDecoratorAssetConfiguration<T = VisibleInspectorDecoratorAssetPossibleTypes> = VisibleInInspectorDecoratorConfiguration & {
|
|
132
135
|
assetType: T;
|
|
133
136
|
typeRestriction?: T extends "material" ? "PBRMaterial" | "StandardMaterial" | "AnyMaterial" : never;
|
|
@@ -3,10 +3,29 @@ import { Scene } from "@babylonjs/core/scene";
|
|
|
3
3
|
import { IParticleSystem } from "@babylonjs/core/Particles/IParticleSystem";
|
|
4
4
|
import { IScript } from "../script";
|
|
5
5
|
import { ScriptMap } from "./loader";
|
|
6
|
+
/**
|
|
7
|
+
* Defines the cache of all
|
|
8
|
+
*/
|
|
9
|
+
export declare const scriptAssetsCache: Map<string, any>;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function _preloadScriptsAssets(scene: Scene, rootUrl: string): Promise<void>;
|
|
6
14
|
/**
|
|
7
15
|
* @internal
|
|
8
16
|
*/
|
|
9
|
-
export declare function _applyScriptsForObject(scene: Scene, object: any, scriptsMap: ScriptMap, rootUrl: string):
|
|
17
|
+
export declare function _applyScriptsForObject(scene: Scene, object: any, scriptsMap: ScriptMap, rootUrl: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Applies the given script constructor on the given object on the fly.
|
|
20
|
+
* @param object defines the reference to the object on which the script must be applied.
|
|
21
|
+
* @param scriptConstructor defines the constructor of the script to apply on the object.
|
|
22
|
+
* @param scene defines the reference to the scene. If not provided, will try to get it from object.getScene()
|
|
23
|
+
* @example
|
|
24
|
+
* import { applyScriptOnObject } from "babylonjs-editor-tools";
|
|
25
|
+
* ...
|
|
26
|
+
* const instance = applyScriptOnObject(mesh, MyScriptClass);
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyScriptOnObject(object: any, scriptConstructor: new (...args: any) => any, scene?: Scene): any;
|
|
10
29
|
export interface IRegisteredScript {
|
|
11
30
|
/**
|
|
12
31
|
* Defines the key of the script. Refer to scriptMap.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-editor-tools",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8",
|
|
4
4
|
"description": "Babylon.js Editor Tools is a set of tools to help you create, edit and manage your Babylon.js scenes made using the Babylon.js Editor",
|
|
5
5
|
"productName": "Babylon.js Editor Tools",
|
|
6
6
|
"scripts": {
|