babylonjs-editor-tools 5.1.0 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.node.js +1 -1
- package/build/src/cinematic/events/apply-impulse.js +1 -3
- package/build/src/cinematic/generate.js +1 -1
- package/build/src/cinematic/parse.js +46 -37
- package/build/src/cinematic/tools.js +1 -1
- package/build/src/decorators/apply.js +5 -3
- package/build/src/decorators/particle-systems.js +3 -2
- package/build/src/tools/animation.js +14 -7
- package/build/src/tools/texture.js +1 -7
- package/declaration/src/decorators/apply.d.ts +1 -0
- package/declaration/src/decorators/particle-systems.d.ts +2 -1
- package/package.json +35 -35
package/build/index.node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var H=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var i=(e,o)=>H(e,"name",{value:o,configurable:!0});var Pt=(e,o)=>{for(var t in o)H(e,t,{get:o[t],enumerable:!0})},bt=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of ht(o))!St.call(e,r)&&r!==t&&H(e,r,{get:()=>o[r],enumerable:!(n=yt(o,r))||n.enumerable});return e};var Ct=e=>bt(H({},"__esModule",{value:!0}),e);var yn={};Pt(yn,{_applyScriptsForObject:()=>R,animationGroupFromScene:()=>$t,configureEngineToUseCompressedTextures:()=>Ht,configureShadowMapRefreshRate:()=>Ae,configureShadowMapRenderListPredicate:()=>xe,createDefaultRenderingPipeline:()=>et,createMotionBlurPostProcess:()=>Qe,createSSAO2RenderingPipeline:()=>Ue,createSSRRenderingPipeline:()=>He,createVLSPostProcess:()=>je,defaultPipelineCameraConfigurations:()=>B,disposeDefaultRenderingPipeline:()=>be,disposeMotionBlurPostProcess:()=>ye,disposeSSAO2RenderingPipeline:()=>ue,disposeSSRRenderingPipeline:()=>ce,disposeVLSPostProcess:()=>se,forceCompileAllSceneMaterials:()=>Yt,generateCinematicAnimationGroup:()=>mn,getAllScriptsByClassForObject:()=>Be,getAnimationTypeForObject:()=>z,getDefaultRenderingPipeline:()=>k,getMotionBlurPostProcess:()=>de,getPowerOfTwoUntil:()=>D,getSSAO2RenderingPipeline:()=>Bt,getSSRRenderingPipeline:()=>Vt,getScriptByClassForObject:()=>Ft,getVLSPostProcess:()=>wt,guiFromAsset:()=>Qt,isAbstractMesh:()=>Oe,isAnyParticleSystem:()=>ie,isArcRotateCamera:()=>Tt,isBone:()=>It,isCamera:()=>W,isCinematicGroup:()=>fn,isCinematicKey:()=>pn,isCinematicKeyCut:()=>un,isCinematicKeyEvent:()=>gn,isCinematicSound:()=>dn,isDirectionalLight:()=>Dt,isFreeCamera:()=>At,isGPUParticleSystem:()=>Mt,isGroundMesh:()=>xt,isHemisphericLight:()=>Rt,isInstancedMesh:()=>_,isLight:()=>Fe,isMesh:()=>E,isNode:()=>re,isParticleSystem:()=>Ot,isPointLight:()=>Et,isScene:()=>oe,isSpotLight:()=>vt,isTexture:()=>ne,isTransformNode:()=>Me,loadMaterialFromFile:()=>jt,loadScene:()=>zt,motionBlurPostProcessCameraConfigurations:()=>L,nodeFromDescendants:()=>Ut,nodeFromScene:()=>Wt,parseCinematic:()=>cn,parseCinematicKeyValue:()=>C,parseDefaultRenderingPipeline:()=>Ie,parseMotionBlurPostProcess:()=>Se,parseSSAO2RenderingPipeline:()=>fe,parseSSRRenderingPipeline:()=>pe,parseVLSPostProcess:()=>le,particleSystemFromScene:()=>qt,registerScriptInstance:()=>Le,serializeDefaultRenderingPipeline:()=>Ce,serializeMotionBlurPostProcess:()=>he,serializeSSAO2RenderingPipeline:()=>ge,serializeSSRRenderingPipeline:()=>me,serializeVLSPostProcess:()=>ae,setDefaultRenderingPipelineRef:()=>Kt,setMotionBlurPostProcessRef:()=>Gt,setSSAO2RenderingPipelineRef:()=>_t,setSSRRenderingPipelineRef:()=>Lt,setVLSPostProcessRef:()=>Nt,soundFromScene:()=>Zt,ssaoRenderingPipelineCameraConfigurations:()=>V,ssrRenderingPipelineCameraConfigurations:()=>N,visibleAsBoolean:()=>Xt,visibleAsColor3:()=>rn,visibleAsColor4:()=>on,visibleAsEntity:()=>sn,visibleAsKeyMap:()=>ln,visibleAsNumber:()=>en,visibleAsString:()=>Jt,visibleAsTexture:()=>an,visibleAsVector2:()=>tn,visibleAsVector3:()=>nn,vlsPostProcessCameraConfigurations:()=>w});module.exports=Ct(yn);function Oe(e){switch(e.getClassName?.()){case"Mesh":case"LineMesh":case"GroundMesh":case"InstancedMesh":return!0}return!1}i(Oe,"isAbstractMesh");function E(e){switch(e.getClassName?.()){case"Mesh":case"GroundMesh":return!0}return!1}i(E,"isMesh");function _(e){return e.getClassName?.()==="InstancedMesh"}i(_,"isInstancedMesh");function It(e){return e.getClassName?.()==="Bone"}i(It,"isBone");function xt(e){return e.getClassName?.()==="GroundMesh"}i(xt,"isGroundMesh");function Me(e){return e.getClassName?.()==="TransformNode"}i(Me,"isTransformNode");function ne(e){return e?.getClassName?.()==="Texture"}i(ne,"isTexture");function W(e){switch(e.getClassName?.()){case"Camera":case"FreeCamera":case"TargetCamera":case"EditorCamera":case"ArcRotateCamera":case"UniversalCamera":return!0}return!1}i(W,"isCamera");function At(e){switch(e.getClassName?.()){case"FreeCamera":case"UniversalCamera":return!0}return!1}i(At,"isFreeCamera");function Tt(e){return e.getClassName?.()==="ArcRotateCamera"}i(Tt,"isArcRotateCamera");function Et(e){return e.getClassName?.()==="PointLight"}i(Et,"isPointLight");function Dt(e){return e.getClassName?.()==="DirectionalLight"}i(Dt,"isDirectionalLight");function vt(e){return e.getClassName?.()==="SpotLight"}i(vt,"isSpotLight");function Rt(e){return e.getClassName?.()==="HemisphericLight"}i(Rt,"isHemisphericLight");function Fe(e){switch(e.getClassName?.()){case"Light":case"PointLight":case"SpotLight":case"DirectionalLight":case"HemisphericLight":return!0}return!1}i(Fe,"isLight");function re(e){return Oe(e)||Me(e)||Fe(e)||W(e)}i(re,"isNode");function oe(e){return e.getClassName?.()==="Scene"}i(oe,"isScene");function Ot(e){return e.getClassName?.()==="ParticleSystem"}i(Ot,"isParticleSystem");function Mt(e){return e.getClassName?.()==="GPUParticleSystem"}i(Mt,"isGPUParticleSystem");function ie(e){switch(e.getClassName?.()){case"ParticleSystem":case"GPUParticleSystem":return!0}return!1}i(ie,"isAnyParticleSystem");function U(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(U,"getSoundById");var $=require("babylonjs"),we=require("babylonjs"),Q=require("babylonjs"),Ne=require("babylonjs-gui");function Ve(e,o,t,n,r){let l=n.constructor;l&&(l._NodesFromScene?.forEach(s=>{n[s.propertyKey.toString()]=e.getNodeByName(s.nodeName)}),l._NodesFromDescendants?.forEach(s=>{let c=o.getDescendants?.(s.directDescendantsOnly,p=>p.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}),l._GuiFromAsset?.forEach(async s=>{let c=`${r}assets/${s.pathInAssets}`;try{let y=await(await fetch(c)).json(),b=Ne.AdvancedDynamicTexture.CreateFullscreenUI(y.name,!0,e);b.parseSerializedObject(y.content,!1),n[s.propertyKey.toString()]=b,s.onGuiCreated?.(n,b)}catch(p){throw console.error(`Failed to load GUI from asset: ${c}`),p}}),l._ParticleSystemsFromScene?.forEach(s=>{let c=e.particleSystems?.find(p=>p.name===s.particleSystemName);n[s.propertyKey.toString()]=c}),l._VisibleInInspector?.forEach(s=>{let c=s.propertyKey.toString(),p=t.values;if(p.hasOwnProperty(c)&&p[c].hasOwnProperty("value")){let y=p[c].value;switch(s.configuration.type){case"number":case"boolean":case"keymap":case"string":n[c]=y;break;case"vector2":n[c]=Q.Vector2.FromArray(y);break;case"vector3":n[c]=Q.Vector3.FromArray(y);break;case"color3":n[c]=$.Color3.FromArray(y);break;case"color4":n[c]=$.Color4.FromArray(y);break;case"entity":switch(s.configuration.entityType){case"node":n[c]=e.getNodeById(y)??null;break;case"animationGroup":n[c]=e.getAnimationGroupByName(y)??null;break;case"sound":n[c]=U(y,e);break;case"particleSystem":n[c]=e.particleSystems?.find(O=>O.id===y)??null;break}break;case"texture":y&&(n[c]=we.Texture.Parse(y,e,r));break}}}))}i(Ve,"applyDecorators");function R(e,o,t,n){o.metadata&&(o.metadata.scripts?.forEach(r=>{if(!r.enabled)return;let l=t[r.key];if(l)if(l.default){let s=new l.default(o);Le(o,s,r.key),Ve(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(R,"_applyScriptsForObject");var G=new Map;function Le(e,o,t){let n={key:t,instance:o};G.has(e)?G.get(e).push(n):G.set(e,[n]),(re(e)||ie(e)||oe(e))&&e.onDisposeObservable.addOnce(()=>{G.delete(e)})}i(Le,"registerScriptInstance");function Be(e,o){return G.get(e)?.filter(r=>r.instance.constructor===o)?.map(r=>r.instance)??null}i(Be,"getAllScriptsByClassForObject");function Ft(e,o){return Be(e,o)?.[0]??null}i(Ft,"getScriptByClassForObject");var K=require("babylonjs"),_e=require("babylonjs");function Ge(e){let o=e.metadata?.physicsAggregate;if(!o)return;let t;E(e)?t=e:_(e)&&(t=e.sourceMesh);let n=new _e.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(Ge,"configurePhysicsAggregate");var Ke=require("babylonjs"),ke=require("babylonjs"),ze=require("babylonjs"),S=null,w=new Map;function wt(){return S}i(wt,"getVLSPostProcess");function Nt(e){S=e}i(Nt,"setVLSPostProcessRef");function se(e){S&&e.activeCamera&&(S.dispose(e.activeCamera),S=null)}i(se,"disposeVLSPostProcess");function je(e,o){return o??=e.meshes.find(t=>E(t)),S=new ze.VolumetricLightScatteringPostProcess("VolumetricLightScatteringPostProcess",1,e.activeCamera,o,100,ke.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1),S}i(je,"createVLSPostProcess");function ae(){return S?{meshId:S.mesh?.id,exposure:S.exposure,decay:S.decay,weight:S.weight,density:S.density,invert:S.invert,useCustomMeshPosition:S.useCustomMeshPosition,customMeshPosition:S.customMeshPosition.asArray()}:null}i(ae,"serializeVLSPostProcess");function le(e,o){let t=null;if(o.meshId){let r=e.getMeshById(o.meshId);r&&E(r)&&(t=r)}let n=je(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(Ke.Vector3.FromArray(o.customMeshPosition)),n}i(le,"parseVLSPostProcess");var Ye=require("babylonjs"),m=null,N=new Map;function Vt(){return m}i(Vt,"getSSRRenderingPipeline");function Lt(e){m=e}i(Lt,"setSSRRenderingPipelineRef");function ce(){m&&(m.dispose(),m=null)}i(ce,"disposeSSRRenderingPipeline");function He(e,o){return m=new Ye.SSRRenderingPipeline("SSRRenderingPipeline",e,[o]),m.samples=4,m}i(He,"createSSRRenderingPipeline");function me(){return m?{samples:m.samples,step:m.step,thickness:m.thickness,strength:m.strength,reflectionSpecularFalloffExponent:m.reflectionSpecularFalloffExponent,maxSteps:m.maxSteps,maxDistance:m.maxDistance,roughnessFactor:m.roughnessFactor,reflectivityThreshold:m.reflectivityThreshold,blurDispersionStrehgth:m.blurDispersionStrength,clipToFrustum:m.clipToFrustum,enableSmoothReflections:m.enableSmoothReflections,enableAutomaticThicknessComputation:m.enableAutomaticThicknessComputation,attenuateFacingCamera:m.attenuateFacingCamera,attenuateScreenBorders:m.attenuateScreenBorders,attenuateIntersectionDistance:m.attenuateIntersectionDistance,attenuateBackfaceReflection:m.attenuateBackfaceReflection,blurDownsample:m.blurDownsample,selfCollisionNumSkip:m.selfCollisionNumSkip,ssrDownsample:m.ssrDownsample,backfaceDepthTextureDownsample:m.backfaceDepthTextureDownsample}:null}i(me,"serializeSSRRenderingPipeline");function pe(e,o,t){if(m)return m;let n=He(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(pe,"parseSSRRenderingPipeline");var We=require("babylonjs"),d=null,V=new Map;function Bt(){return d}i(Bt,"getSSAO2RenderingPipeline");function _t(e){d=e}i(_t,"setSSAO2RenderingPipelineRef");function ue(){d&&(d.dispose(),d=null)}i(ue,"disposeSSAO2RenderingPipeline");function Ue(e,o){return d=new We.SSAO2RenderingPipeline("SSAO2RenderingPipeline",e,1,[o]),d.samples=4,d}i(Ue,"createSSAO2RenderingPipeline");function ge(){return d?{radius:d.radius,totalStrength:d.totalStrength,samples:d.samples,maxZ:d.maxZ,minZAspect:d.minZAspect,epsilon:d.epsilon,textureSamples:d.textureSamples,bypassBlur:d.bypassBlur,bilateralSamples:d.bilateralSamples,bilateralSoften:d.bilateralSoften,bilateralTolerance:d.bilateralTolerance,expensiveBlur:d.expensiveBlur}:null}i(ge,"serializeSSAO2RenderingPipeline");function fe(e,o,t){if(d)return d;let n=Ue(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(fe,"parseSSAO2RenderingPipeline");var $e=require("babylonjs"),P=null,L=new Map;function de(){return P}i(de,"getMotionBlurPostProcess");function Gt(e){P=e}i(Gt,"setMotionBlurPostProcessRef");function ye(){P&&(P.dispose(),P=null)}i(ye,"disposeMotionBlurPostProcess");function Qe(e,o){return P=new $e.MotionBlurPostProcess("MotionBlurPostProcess",e,1,o),P.motionStrength=1,P.isObjectBased=!0,P}i(Qe,"createMotionBlurPostProcess");function he(){return P?{isObjectBased:P.isObjectBased,motionStrength:P.motionStrength,motionBlurSamples:P.motionBlurSamples}:null}i(he,"serializeMotionBlurPostProcess");function Se(e,o,t){if(P)return P;let n=Qe(e,o);return n.isObjectBased=t.isObjectBased,n.motionStrength=t.motionStrength,n.motionBlurSamples=t.motionBlurSamples,n}i(Se,"parseMotionBlurPostProcess");var Ze=require("babylonjs"),Pe=require("babylonjs"),qe=require("babylonjs"),Xe=require("babylonjs"),Je=require("babylonjs"),a=null,B=new Map;function k(){return a}i(k,"getDefaultRenderingPipeline");function Kt(e){a=e}i(Kt,"setDefaultRenderingPipelineRef");function be(){a&&(a.dispose(),a=null)}i(be,"disposeDefaultRenderingPipeline");function et(e,o){return a=new Je.DefaultRenderingPipeline("DefaultRenderingPipeline",!0,e,[o]),a.samples=4,a.depthOfField.lensSize=512,a.depthOfField.fStop=.25,a.depthOfField.focusDistance=55e3,a}i(et,"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 Ie(e,o,t,n){if(a)return a;let r=et(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=Ze.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 Xe.ColorGradingTexture(s,e),l.level=t.colorGradingTexture.level}else{let s=qe.Texture.Parse(t.colorGradingTexture,e,n);ne(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=Pe.Vector2.FromArray(t.direction??[0,0]),r.chromaticAberration.centerPosition=Pe.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(Ie,"parseDefaultRenderingPipeline");function tt(e,o){(Array.isArray(o)?o:[]).forEach(n=>{let r=e.getCameraById(n.cameraId);r&&(n.ssao2RenderingPipeline&&V.set(r,n.ssao2RenderingPipeline),n.vlsPostProcess&&w.set(r,n.vlsPostProcess),n.ssrRenderingPipeline&&N.set(r,n.ssrRenderingPipeline),n.motionBlurPostProcess&&L.set(r,n.motionBlurPostProcess),n.defaultRenderingPipeline&&B.set(r,n.defaultRenderingPipeline))})}i(tt,"applyRenderingConfigurations");function Lo(e){V.set(e,ge()),w.set(e,ae()),N.set(e,me()),L.set(e,he()),B.set(e,Ce())}i(Lo,"saveRenderingConfigurationForCamera");function nt(e,o){ue(),se(e.getScene()),ce(),ye(),be();let t=V.get(e);t&&fe(e.getScene(),e,t);let n=w.get(e);n&&le(e.getScene(),n);let r=N.get(e);r&&pe(e.getScene(),e,r);let l=L.get(e);l&&Se(e.getScene(),e,l);let s=B.get(e);s&&Ie(e.getScene(),e,s,o)}i(nt,"applyRenderingConfigurationForCamera");var rt=require("babylonjs"),ot=require("babylonjs");function xe(e){e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.renderListPredicate=n=>rt.Vector3.Distance(n.getAbsolutePosition(),o.getAbsolutePosition())<=o.range)})}i(xe,"configureShadowMapRenderListPredicate");async function Ae(e){e.executeWhenReady(()=>{e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.refreshRate=o.metadata?.refreshRate??ot.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME)})})}i(Ae,"configureShadowMapRefreshRate");var Te=require("babylonjs"),Z=require("babylonjs"),kt=(0,Z.GetParser)(Te.SceneComponentConstants.NAME_AUDIO);(0,Z.AddParser)(Te.SceneComponentConstants.NAME_AUDIO,(e,o,t,n)=>{kt?.(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 D(e){let o=1;for(;o<=e;)o<<=1;return o>>1}i(D,"getPowerOfTwoUntil");var Ee=require("babylonjs"),q=Ee.SerializationHelper._TextureParser;Ee.SerializationHelper._TextureParser=(e,o,t)=>{if(o.loadingQuality==="high"||!e.metadata?.baseSize)return q(e,o,t);let n=e.metadata.baseSize.width,r=e.metadata.baseSize.height,l=n===D(n)||r===D(r),s="";switch(o.loadingQuality){case"medium":let h=n*.66>>0,f=r*.66>>0;l&&(h=D(h),f=D(f)),s=`_${h}_${f}`;break;case"low":let u=n*.33>>0,g=r*.33>>0;l&&(u=D(u),g=D(g)),s=`_${u}_${g}`;break}let c=e.name;if(!c||!s)return q(e,o,t);let p=c.split("/"),y=p.pop();if(!y)return q(e,o,t);let b=y.split(".").pop(),M=`${y.replace(`.${b}`,"")}${s}.${b}`;return p.push(M),e.name=p.join("/"),q(e,o,t)};var it=require("babylonjs"),De=require("babylonjs"),st=require("babylonjs"),at=require("babylonjs");async function zt(e,o,t,n,r){t.loadingQuality=r?.quality??"high",await(0,st.AppendSceneAsync)(`${e}${o}`,t,{pluginExtension:".babylon",onProgress:i(s=>{let c=Math.min(s.loaded/s.total*.5);r?.onProgress?.(c)},"onProgress")}),at.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&t.meshes.forEach(s=>E(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===De.Constants.DELAYLOADSTATE_NONE&&(c.delayLoadState=De.Constants.DELAYLOADSTATE_LOADED)}),r?.onProgress?.(.5+s/l*.5)}r?.onProgress?.(1),xe(t),Ae(t),t.metadata?.rendering&&(tt(t,t.metadata.rendering),t.activeCamera&&nt(t.activeCamera,e)),t.metadata?.physicsGravity&&t.getPhysicsEngine()?.setGravity(it.Vector3.FromArray(t.metadata?.physicsGravity)),R(t,t,n,e),t.transformNodes.forEach(s=>{R(t,s,n,e)}),t.meshes.forEach(s=>{Ge(s),R(t,s,n,e)}),t.lights.forEach(s=>{R(t,s,n,e)}),t.cameras.forEach(s=>{R(t,s,n,e)})}i(zt,"loadScene");var lt=require("babylonjs");async function jt(e,o,t){let r=await(await fetch(e+o)).json(),s=lt.Tools.Instantiate(r.customType).Parse(r,t,e);return s.id=r.id,s.uniqueId=r.uniqueId,s}i(jt,"loadMaterialFromFile");function Yt(e){return Promise.all(e.materials.map(async o=>{let t=o.getBindedMeshes();await Promise.all(t.map(async n=>{_(n)||await o.forceCompilationAsync(n,{clipPlane:!!e.clipPlane,useInstances:n.hasInstances})}))}))}i(Yt,"forceCompileAllSceneMaterials");function Ht(e){e.setTextureFormatToUse(["-dxt.ktx","-astc.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"])}i(Ht,"configureEngineToUseCompressedTextures");var A=require("babylonjs");function z(e){if(!isNaN(parseFloat(e))&&isFinite(e))return A.Animation.ANIMATIONTYPE_FLOAT;switch(e?.getClassName?.()){case"Vector2":return A.Animation.ANIMATIONTYPE_VECTOR2;case"Vector3":return A.Animation.ANIMATIONTYPE_VECTOR3;case"Quaternion":return A.Animation.ANIMATIONTYPE_QUATERNION;case"Color3":return A.Animation.ANIMATIONTYPE_COLOR3;case"Color4":return A.Animation.ANIMATIONTYPE_COLOR4;case"Size":return A.Animation.ANIMATIONTYPE_SIZE;case"Matrix":return A.Animation.ANIMATIONTYPE_MATRIX}return null}i(z,"getAnimationTypeForObject");function Wt(e){return function(o,t){let n=o.constructor;n._NodesFromScene??=[],n._NodesFromScene.push({propertyKey:t,nodeName:e})}}i(Wt,"nodeFromScene");function Ut(e,o=!1){return function(t,n){let r=t.constructor;r._NodesFromDescendants??=[],r._NodesFromDescendants.push({propertyKey:n,nodeName:e,directDescendantsOnly:o})}}i(Ut,"nodeFromDescendants");function $t(e){return function(o,t){let n=o.constructor;n._AnimationGroups??=[],n._AnimationGroups.push({animationGroupName:e,propertyKey:t})}}i($t,"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 Zt(e){return function(o,t){let n=o.constructor;n._SoundsFromScene??=[],n._SoundsFromScene.push({propertyKey:t,soundName:e})}}i(Zt,"soundFromScene");function qt(e){return function(o,t){let n=o.constructor;n._ParticleSystemsFromScene??=[],n._ParticleSystemsFromScene.push({propertyKey:t,particleSystemName:e})}}i(qt,"particleSystemFromScene");function Xt(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"boolean"}})}}i(Xt,"visibleAsBoolean");function Jt(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"string"}})}}i(Jt,"visibleAsString");function en(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"number"}})}}i(en,"visibleAsNumber");function tn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector2"}})}}i(tn,"visibleAsVector2");function nn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"vector3"}})}}i(nn,"visibleAsVector3");function rn(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color3"}})}}i(rn,"visibleAsColor3");function on(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"color4"}})}}i(on,"visibleAsColor4");function sn(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(sn,"visibleAsEntity");function an(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"texture"}})}}i(an,"visibleAsTexture");function ln(e,o){return function(t,n){let r=t.constructor;r._VisibleInInspector??=[],r._VisibleInInspector.push({label:e,propertyKey:n,configuration:{...o,type:"keymap"}})}}i(ln,"visibleAsKeyMap");var X=require("babylonjs");function ct(e,o){let t;switch(e){case X.Animation.ANIMATIONTYPE_FLOAT:t=o.value;break;default:t=o.value.clone();break}return{value:t,frame:o.frame,interpolation:o.interpolation,inTangent:e===X.Animation.ANIMATIONTYPE_FLOAT?o.inTangent:o.inTangent?.clone(),outTangent:e===X.Animation.ANIMATIONTYPE_FLOAT?o.outTangent:o.outTangent?.clone()}}i(ct,"cloneKey");function J(e,o){let t=o.split("."),n=e;for(let r=0;r<t.length;++r)n=n[t[r]];return n}i(J,"getPropertyValue");var v=require("babylonjs"),ee=require("babylonjs"),I=require("babylonjs");function cn(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=k()),t.propertyPath){let s=J(n,t.propertyPath);r=z(s)}let l=null;return t.sound&&(l=U(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:I.Vector3.FromArray(s.data.force),contactPoint:I.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:C(c.value,r),inTangent:C(c.inTangent,r),outTangent:C(c.outTangent,r)};let p=s.type==="cut"?s:null;if(p)return{...p,key1:{...p.key1,value:C(p.key1.value,r),inTangent:C(p.key1.inTangent,r),outTangent:C(p.key1.outTangent,r)},key2:{...p.key2,value:C(p.key2.value,r),inTangent:C(p.key2.inTangent,r),outTangent:C(p.key2.outTangent,r)}};throw new Error(`Unknown key frame type: ${s.type}`)})}})}}i(cn,"parseCinematic");function C(e,o){if(e===null)return null;if(e!==void 0)switch(o){case v.Animation.ANIMATIONTYPE_FLOAT:return e;case v.Animation.ANIMATIONTYPE_VECTOR2:return I.Vector2.FromArray(e);case v.Animation.ANIMATIONTYPE_VECTOR3:return I.Vector3.FromArray(e);case v.Animation.ANIMATIONTYPE_QUATERNION:return I.Quaternion.FromArray(e);case v.Animation.ANIMATIONTYPE_COLOR3:return ee.Color3.FromArray(e);case v.Animation.ANIMATIONTYPE_COLOR4:return ee.Color4.FromArray(e);case v.Animation.ANIMATIONTYPE_MATRIX:return I.Matrix.FromArray(e)}}i(C,"parseCinematicKeyValue");function mt(e){e.node?.setEnabled(e.value)}i(mt,"handleSetEnabledEvent");var ve=require("babylonjs"),pt=ve.Vector3.Zero();function ut(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 ve.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(pt),n.physicsAggregate.body.setAngularVelocity(pt),n.physicsAggregate.body.applyImpulse(r.negateInPlace(),o.contactPoint)}})}i(ut,"handleApplyImpulseEvent");var gt=require("babylonjs"),T=require("babylonjs"),j=require("babylonjs"),ft=require("babylonjs");function mn(e,o,t){let n=new ft.AnimationGroup(e.name,o);return e.tracks.forEach(r=>{let l=r.animationGroup;l&&r.animationGroups?.forEach(h=>{l.targetedAnimations.forEach(f=>{let u=null;e:{let x=n.targetedAnimations.filter(Y=>Y.target===f.target);if(x.length){let Y=x.find(dt=>dt.animation.targetProperty===f.animation.targetProperty);if(Y){u=Y.animation;break e}}u=f.animation.clone(),u.setKeys([]),u.name=gt.Tools.RandomId(),u.framePerSecond=e.framesPerSecond}let g=u.getKeys(),F=f.animation.getKeys(),te=h.speed,Re=e.framesPerSecond/f.animation.framePerSecond/te;F.forEach(x=>{x.frame>=h.startFrame&&x.frame<=h.endFrame&&g.push({...ct(f.animation.dataType,x),frame:h.frame+x.frame*Re})}),u.setKeys(g),n.addTargetedAnimation(u,f.target)})});let s=r.sound,c=s?.getAudioBuffer();if(!t?.ignoreSounds&&s&&c&&r.sounds?.length){let h={dummy:0},f=new T.Animation(s.name,"dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;r.sounds?.forEach(g=>{let F=g.endFrame-g.startFrame;u=Math.max(u,g.frame+F),f.addEvent(new j.AnimationEvent(g.frame,te=>{let x=(te-g.frame+g.startFrame)/e.framesPerSecond;s.play(0,x)},!1)),f.addEvent(new j.AnimationEvent(g.frame+F,()=>{s.stop()}))}),f.setKeys([{frame:0,value:0},{frame:u,value:u}]),n.addTargetedAnimation(f,h)}if(r.keyFrameEvents){let h={dummy:0},f=new T.Animation("events","dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;r.keyFrameEvents?.forEach(g=>{u=Math.max(u,g.frame),f.addEvent(new j.AnimationEvent(g.frame,()=>{switch(g.data?.type){case"set-enabled":mt(g.data);break;case"apply-impulse":ut(o,g.data);break}}))}),f.setKeys([{frame:0,value:0},{frame:u,value:u}]),n.addTargetedAnimation(f,h)}let p=r.defaultRenderingPipeline?k():r.node;if(!p||!r.propertyPath||!r.keyFrameAnimations)return;let y=J(p,r.propertyPath),b=z(y);if(b===null)return;let O=new T.Animation(r.propertyPath,r.propertyPath,60,b,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),M=[];r.keyFrameAnimations?.forEach(h=>{let f=h.type==="key"?h:null;if(f)return M.push(f);let u=h.type==="cut"?h:null;u&&(M.push(u.key1),M.push(u.key2),W(p)&&r.propertyPath==="position"&&O.addEvent(new j.AnimationEvent(u.key1.frame,()=>{let g=de();if(!g)return;let F=g.motionStrength;g.motionStrength=0,requestAnimationFrame(()=>{g.motionStrength=F})})))}),O.setKeys(M),n.addTargetedAnimation(O,p)}),n.normalize(),n}i(mn,"generateCinematicAnimationGroup");function pn(e){return e.type==="key"}i(pn,"isCinematicKey");function un(e){return e.type==="cut"}i(un,"isCinematicKeyCut");function gn(e){return e.type==="event"}i(gn,"isCinematicKeyEvent");function fn(e){return e.type==="group"}i(fn,"isCinematicGroup");function dn(e){return e.type==="sound"}i(dn,"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,parseCinematic,parseCinematicKeyValue,parseDefaultRenderingPipeline,parseMotionBlurPostProcess,parseSSAO2RenderingPipeline,parseSSRRenderingPipeline,parseVLSPostProcess,particleSystemFromScene,registerScriptInstance,serializeDefaultRenderingPipeline,serializeMotionBlurPostProcess,serializeSSAO2RenderingPipeline,serializeSSRRenderingPipeline,serializeVLSPostProcess,setDefaultRenderingPipelineRef,setMotionBlurPostProcessRef,setSSAO2RenderingPipelineRef,setSSRRenderingPipelineRef,setVLSPostProcessRef,soundFromScene,ssaoRenderingPipelineCameraConfigurations,ssrRenderingPipelineCameraConfigurations,visibleAsBoolean,visibleAsColor3,visibleAsColor4,visibleAsEntity,visibleAsKeyMap,visibleAsNumber,visibleAsString,visibleAsTexture,visibleAsVector2,visibleAsVector3,vlsPostProcessCameraConfigurations});
|
|
1
|
+
var H=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var i=(e,o)=>H(e,"name",{value:o,configurable:!0});var Pt=(e,o)=>{for(var t in o)H(e,t,{get:o[t],enumerable:!0})},bt=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of ht(o))!St.call(e,n)&&n!==t&&H(e,n,{get:()=>o[n],enumerable:!(r=yt(o,n))||r.enumerable});return e};var Ct=e=>bt(H({},"__esModule",{value:!0}),e);var yn={};Pt(yn,{_applyScriptsForObject:()=>R,animationGroupFromScene:()=>$t,configureEngineToUseCompressedTextures:()=>Ht,configureShadowMapRefreshRate:()=>Ae,configureShadowMapRenderListPredicate:()=>xe,createDefaultRenderingPipeline:()=>et,createMotionBlurPostProcess:()=>Qe,createSSAO2RenderingPipeline:()=>Ue,createSSRRenderingPipeline:()=>He,createVLSPostProcess:()=>Ye,defaultPipelineCameraConfigurations:()=>B,disposeDefaultRenderingPipeline:()=>be,disposeMotionBlurPostProcess:()=>ye,disposeSSAO2RenderingPipeline:()=>ue,disposeSSRRenderingPipeline:()=>ce,disposeVLSPostProcess:()=>se,forceCompileAllSceneMaterials:()=>jt,generateCinematicAnimationGroup:()=>mn,getAllScriptsByClassForObject:()=>Be,getAnimationTypeForObject:()=>z,getDefaultRenderingPipeline:()=>k,getMotionBlurPostProcess:()=>de,getPowerOfTwoUntil:()=>D,getSSAO2RenderingPipeline:()=>Bt,getSSRRenderingPipeline:()=>Vt,getScriptByClassForObject:()=>Ft,getVLSPostProcess:()=>wt,guiFromAsset:()=>Qt,isAbstractMesh:()=>Oe,isAnyParticleSystem:()=>ie,isArcRotateCamera:()=>Tt,isBone:()=>It,isCamera:()=>W,isCinematicGroup:()=>fn,isCinematicKey:()=>pn,isCinematicKeyCut:()=>un,isCinematicKeyEvent:()=>gn,isCinematicSound:()=>dn,isDirectionalLight:()=>Dt,isFreeCamera:()=>At,isGPUParticleSystem:()=>Mt,isGroundMesh:()=>xt,isHemisphericLight:()=>Rt,isInstancedMesh:()=>_,isLight:()=>Fe,isMesh:()=>E,isNode:()=>re,isParticleSystem:()=>Ot,isPointLight:()=>Et,isScene:()=>oe,isSpotLight:()=>vt,isTexture:()=>ne,isTransformNode:()=>Me,loadMaterialFromFile:()=>Yt,loadScene:()=>zt,motionBlurPostProcessCameraConfigurations:()=>L,nodeFromDescendants:()=>Ut,nodeFromScene:()=>Wt,parseCinematic:()=>cn,parseCinematicKeyValue:()=>C,parseDefaultRenderingPipeline:()=>Ie,parseMotionBlurPostProcess:()=>Se,parseSSAO2RenderingPipeline:()=>fe,parseSSRRenderingPipeline:()=>pe,parseVLSPostProcess:()=>le,particleSystemFromScene:()=>qt,registerScriptInstance:()=>Le,serializeDefaultRenderingPipeline:()=>Ce,serializeMotionBlurPostProcess:()=>he,serializeSSAO2RenderingPipeline:()=>ge,serializeSSRRenderingPipeline:()=>me,serializeVLSPostProcess:()=>ae,setDefaultRenderingPipelineRef:()=>Kt,setMotionBlurPostProcessRef:()=>Gt,setSSAO2RenderingPipelineRef:()=>_t,setSSRRenderingPipelineRef:()=>Lt,setVLSPostProcessRef:()=>Nt,soundFromScene:()=>Zt,ssaoRenderingPipelineCameraConfigurations:()=>V,ssrRenderingPipelineCameraConfigurations:()=>N,visibleAsBoolean:()=>Xt,visibleAsColor3:()=>rn,visibleAsColor4:()=>on,visibleAsEntity:()=>sn,visibleAsKeyMap:()=>ln,visibleAsNumber:()=>en,visibleAsString:()=>Jt,visibleAsTexture:()=>an,visibleAsVector2:()=>tn,visibleAsVector3:()=>nn,vlsPostProcessCameraConfigurations:()=>w});module.exports=Ct(yn);function Oe(e){switch(e.getClassName?.()){case"Mesh":case"LineMesh":case"GroundMesh":case"InstancedMesh":return!0}return!1}i(Oe,"isAbstractMesh");function E(e){switch(e.getClassName?.()){case"Mesh":case"GroundMesh":return!0}return!1}i(E,"isMesh");function _(e){return e.getClassName?.()==="InstancedMesh"}i(_,"isInstancedMesh");function It(e){return e.getClassName?.()==="Bone"}i(It,"isBone");function xt(e){return e.getClassName?.()==="GroundMesh"}i(xt,"isGroundMesh");function Me(e){return e.getClassName?.()==="TransformNode"}i(Me,"isTransformNode");function ne(e){return e?.getClassName?.()==="Texture"}i(ne,"isTexture");function W(e){switch(e.getClassName?.()){case"Camera":case"FreeCamera":case"TargetCamera":case"EditorCamera":case"ArcRotateCamera":case"UniversalCamera":return!0}return!1}i(W,"isCamera");function At(e){switch(e.getClassName?.()){case"FreeCamera":case"UniversalCamera":return!0}return!1}i(At,"isFreeCamera");function Tt(e){return e.getClassName?.()==="ArcRotateCamera"}i(Tt,"isArcRotateCamera");function Et(e){return e.getClassName?.()==="PointLight"}i(Et,"isPointLight");function Dt(e){return e.getClassName?.()==="DirectionalLight"}i(Dt,"isDirectionalLight");function vt(e){return e.getClassName?.()==="SpotLight"}i(vt,"isSpotLight");function Rt(e){return e.getClassName?.()==="HemisphericLight"}i(Rt,"isHemisphericLight");function Fe(e){switch(e.getClassName?.()){case"Light":case"PointLight":case"SpotLight":case"DirectionalLight":case"HemisphericLight":return!0}return!1}i(Fe,"isLight");function re(e){return Oe(e)||Me(e)||Fe(e)||W(e)}i(re,"isNode");function oe(e){return e.getClassName?.()==="Scene"}i(oe,"isScene");function Ot(e){return e.getClassName?.()==="ParticleSystem"}i(Ot,"isParticleSystem");function Mt(e){return e.getClassName?.()==="GPUParticleSystem"}i(Mt,"isGPUParticleSystem");function ie(e){switch(e.getClassName?.()){case"ParticleSystem":case"GPUParticleSystem":return!0}return!1}i(ie,"isAnyParticleSystem");function U(e,o){let t=o.soundTracks??[];t.length||t.push(o.mainSoundTrack);for(let r=0,n=t.length;r<n;r++){let l=t[r].soundCollection.find(s=>s.id===e);if(l)return l}return null}i(U,"getSoundById");var $=require("babylonjs"),we=require("babylonjs"),Q=require("babylonjs"),Ne=require("babylonjs-gui");function Ve(e,o,t,r,n){let l=r.constructor;l&&(l._NodesFromScene?.forEach(s=>{r[s.propertyKey.toString()]=e.getNodeByName(s.nodeName)}),l._NodesFromDescendants?.forEach(s=>{let c=o.getDescendants?.(s.directDescendantsOnly,m=>m.name===s.nodeName)[0];r[s.propertyKey.toString()]=c??null}),l._AnimationGroups?.forEach(s=>{r[s.propertyKey.toString()]=e.getAnimationGroupByName(s.animationGroupName)}),l._SoundsFromScene?.forEach(s=>{let c=e.getSoundByName?.(s.soundName);r[s.propertyKey.toString()]=c??null}),l._GuiFromAsset?.forEach(async s=>{let c=`${n}assets/${s.pathInAssets}`;try{let y=await(await fetch(c)).json(),b=Ne.AdvancedDynamicTexture.CreateFullscreenUI(y.name,!0,e);b.parseSerializedObject(y.content,!1),r[s.propertyKey.toString()]=b,s.onGuiCreated?.(r,b)}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);r[s.propertyKey.toString()]=c}),l._VisibleInInspector?.forEach(s=>{let c=s.propertyKey.toString(),m=t.values;if(m.hasOwnProperty(c)&&m[c].hasOwnProperty("value")){let y=m[c].value;switch(s.configuration.type){case"number":case"boolean":case"keymap":case"string":r[c]=y;break;case"vector2":r[c]=Q.Vector2.FromArray(y);break;case"vector3":r[c]=Q.Vector3.FromArray(y);break;case"color3":r[c]=$.Color3.FromArray(y);break;case"color4":r[c]=$.Color4.FromArray(y);break;case"entity":switch(s.configuration.entityType){case"node":r[c]=e.getNodeById(y)??null;break;case"animationGroup":r[c]=e.getAnimationGroupByName(y)??null;break;case"sound":r[c]=U(y,e);break;case"particleSystem":r[c]=e.particleSystems?.find(O=>O.id===y)??null;break}break;case"texture":y&&(r[c]=we.Texture.Parse(y,e,n));break}}}))}i(Ve,"applyDecorators");function R(e,o,t,r){o.metadata&&(o.metadata.scripts?.forEach(n=>{if(!n.enabled)return;let l=t[n.key];if(l)if(l.default){let s=new l.default(o);Le(o,s,n.key),Ve(e,o,n,s,r),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(R,"_applyScriptsForObject");var G=new Map;function Le(e,o,t){let r={key:t,instance:o};G.has(e)?G.get(e).push(r):G.set(e,[r]),(re(e)||ie(e)||oe(e))&&e.onDisposeObservable.addOnce(()=>{G.delete(e)})}i(Le,"registerScriptInstance");function Be(e,o){return G.get(e)?.filter(n=>n.instance.constructor===o)?.map(n=>n.instance)??null}i(Be,"getAllScriptsByClassForObject");function Ft(e,o){return Be(e,o)?.[0]??null}i(Ft,"getScriptByClassForObject");var K=require("babylonjs"),_e=require("babylonjs");function Ge(e){let o=e.metadata?.physicsAggregate;if(!o)return;let t;E(e)?t=e:_(e)&&(t=e.sourceMesh);let r=new _e.PhysicsAggregate(e,o.shape.type,{mesh:t,mass:o.massProperties.mass});r.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}),r.shape.density=o.shape.density,r.body.setMotionType(o.body.motionType),r.shape.material=o.material,e.physicsAggregate=r,e.metadata.physicsAggregate=void 0}i(Ge,"configurePhysicsAggregate");var Ke=require("babylonjs"),ke=require("babylonjs"),ze=require("babylonjs"),S=null,w=new Map;function wt(){return S}i(wt,"getVLSPostProcess");function Nt(e){S=e}i(Nt,"setVLSPostProcessRef");function se(e){S&&e.activeCamera&&(S.dispose(e.activeCamera),S=null)}i(se,"disposeVLSPostProcess");function Ye(e,o){return o??=e.meshes.find(t=>E(t)),S=new ze.VolumetricLightScatteringPostProcess("VolumetricLightScatteringPostProcess",1,e.activeCamera,o,100,ke.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1),S}i(Ye,"createVLSPostProcess");function ae(){return S?{meshId:S.mesh?.id,exposure:S.exposure,decay:S.decay,weight:S.weight,density:S.density,invert:S.invert,useCustomMeshPosition:S.useCustomMeshPosition,customMeshPosition:S.customMeshPosition.asArray()}:null}i(ae,"serializeVLSPostProcess");function le(e,o){let t=null;if(o.meshId){let n=e.getMeshById(o.meshId);n&&E(n)&&(t=n)}let r=Ye(e,t);return r.exposure=o.exposure,r.decay=o.decay,r.weight=o.weight,r.density=o.density,r.invert=o.invert,r.useCustomMeshPosition=o.useCustomMeshPosition,r.customMeshPosition.copyFrom(Ke.Vector3.FromArray(o.customMeshPosition)),r}i(le,"parseVLSPostProcess");var je=require("babylonjs"),p=null,N=new Map;function Vt(){return p}i(Vt,"getSSRRenderingPipeline");function Lt(e){p=e}i(Lt,"setSSRRenderingPipelineRef");function ce(){p&&(p.dispose(),p=null)}i(ce,"disposeSSRRenderingPipeline");function He(e,o){return p=new je.SSRRenderingPipeline("SSRRenderingPipeline",e,[o]),p.samples=4,p}i(He,"createSSRRenderingPipeline");function me(){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(me,"serializeSSRRenderingPipeline");function pe(e,o,t){if(p)return p;let r=He(e,o);return r.samples=t.samples,r.step=t.step,r.thickness=t.thickness,r.strength=t.strength,r.reflectionSpecularFalloffExponent=t.reflectionSpecularFalloffExponent,r.maxSteps=t.maxSteps,r.maxDistance=t.maxDistance,r.roughnessFactor=t.roughnessFactor,r.reflectivityThreshold=t.reflectivityThreshold,r.blurDispersionStrength=t.blurDispersionStrehgth,r.clipToFrustum=t.clipToFrustum,r.enableSmoothReflections=t.enableSmoothReflections,r.enableAutomaticThicknessComputation=t.enableAutomaticThicknessComputation,r.attenuateFacingCamera=t.attenuateFacingCamera,r.attenuateScreenBorders=t.attenuateScreenBorders,r.attenuateIntersectionDistance=t.attenuateIntersectionDistance,r.attenuateBackfaceReflection=t.attenuateBackfaceReflection,r.blurDownsample=t.blurDownsample,r.selfCollisionNumSkip=t.selfCollisionNumSkip,r.ssrDownsample=t.ssrDownsample,r.backfaceDepthTextureDownsample=t.backfaceDepthTextureDownsample,r}i(pe,"parseSSRRenderingPipeline");var We=require("babylonjs"),d=null,V=new Map;function Bt(){return d}i(Bt,"getSSAO2RenderingPipeline");function _t(e){d=e}i(_t,"setSSAO2RenderingPipelineRef");function ue(){d&&(d.dispose(),d=null)}i(ue,"disposeSSAO2RenderingPipeline");function Ue(e,o){return d=new We.SSAO2RenderingPipeline("SSAO2RenderingPipeline",e,1,[o]),d.samples=4,d}i(Ue,"createSSAO2RenderingPipeline");function ge(){return d?{radius:d.radius,totalStrength:d.totalStrength,samples:d.samples,maxZ:d.maxZ,minZAspect:d.minZAspect,epsilon:d.epsilon,textureSamples:d.textureSamples,bypassBlur:d.bypassBlur,bilateralSamples:d.bilateralSamples,bilateralSoften:d.bilateralSoften,bilateralTolerance:d.bilateralTolerance,expensiveBlur:d.expensiveBlur}:null}i(ge,"serializeSSAO2RenderingPipeline");function fe(e,o,t){if(d)return d;let r=Ue(e,o);return r.radius=t.radius,r.totalStrength=t.totalStrength,r.samples=t.samples,r.maxZ=t.maxZ,r.minZAspect=t.minZAspect,r.epsilon=t.epsilon,r.textureSamples=t.textureSamples,r.bypassBlur=t.bypassBlur,r.bilateralSamples=t.bilateralSamples,r.bilateralSoften=t.bilateralSoften,r.bilateralTolerance=t.bilateralTolerance,r.expensiveBlur=t.expensiveBlur,r}i(fe,"parseSSAO2RenderingPipeline");var $e=require("babylonjs"),P=null,L=new Map;function de(){return P}i(de,"getMotionBlurPostProcess");function Gt(e){P=e}i(Gt,"setMotionBlurPostProcessRef");function ye(){P&&(P.dispose(),P=null)}i(ye,"disposeMotionBlurPostProcess");function Qe(e,o){return P=new $e.MotionBlurPostProcess("MotionBlurPostProcess",e,1,o),P.motionStrength=1,P.isObjectBased=!0,P}i(Qe,"createMotionBlurPostProcess");function he(){return P?{isObjectBased:P.isObjectBased,motionStrength:P.motionStrength,motionBlurSamples:P.motionBlurSamples}:null}i(he,"serializeMotionBlurPostProcess");function Se(e,o,t){if(P)return P;let r=Qe(e,o);return r.isObjectBased=t.isObjectBased,r.motionStrength=t.motionStrength,r.motionBlurSamples=t.motionBlurSamples,r}i(Se,"parseMotionBlurPostProcess");var Ze=require("babylonjs"),Pe=require("babylonjs"),qe=require("babylonjs"),Xe=require("babylonjs"),Je=require("babylonjs"),a=null,B=new Map;function k(){return a}i(k,"getDefaultRenderingPipeline");function Kt(e){a=e}i(Kt,"setDefaultRenderingPipelineRef");function be(){a&&(a.dispose(),a=null)}i(be,"disposeDefaultRenderingPipeline");function et(e,o){return a=new Je.DefaultRenderingPipeline("DefaultRenderingPipeline",!0,e,[o]),a.samples=4,a.depthOfField.lensSize=512,a.depthOfField.fStop=.25,a.depthOfField.focusDistance=55e3,a}i(et,"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 Ie(e,o,t,r){if(a)return a;let n=et(e,o);if(n.samples=t.samples,n.fxaaEnabled=t.fxaaEnabled,n.imageProcessingEnabled=t.imageProcessingEnabled,n.imageProcessing){if(n.imageProcessing.exposure=t.exposure,n.imageProcessing.contrast=t.contrast,n.imageProcessing.fromLinearSpace=t.fromLinearSpace,n.imageProcessing.toneMappingEnabled=t.toneMappingEnabled,n.imageProcessing.toneMappingType=t.toneMappingType,n.imageProcessing.ditheringEnabled=t.ditheringEnabled,n.imageProcessing.ditheringIntensity=t.ditheringIntensity,n.imageProcessing.vignetteEnabled=t.vignetteEnabled??!1,n.imageProcessing.vignetteColor=Ze.Color4.FromArray(t.vignetteColor??[0,0,0]),n.imageProcessing.vignetteWeight=t.vignetteWeight??.3,n.imageProcessing.colorGradingEnabled=t.colorGradingEnabled??!1,n.imageProcessing.imageProcessingConfiguration.colorGradingWithGreenDepth=t.colorGradingWithGreenDepth??!0,t.colorGradingTexture){let l=null;if(t.colorGradingTexture.customType==="BABYLON.ColorGradingTexture"){let s=r+t.colorGradingTexture.name;l=new Xe.ColorGradingTexture(s,e),l.level=t.colorGradingTexture.level}else{let s=qe.Texture.Parse(t.colorGradingTexture,e,r);ne(s)&&(l=s)}n.imageProcessing.colorGradingTexture=l}n.imageProcessing.colorCurvesEnabled=t.colorCurvesEnabled??!1,n.imageProcessing.colorCurves&&(n.imageProcessing.colorCurves.globalHue=t.globalHue??30,n.imageProcessing.colorCurves.globalDensity=t.globalDensity??0,n.imageProcessing.colorCurves.globalExposure=t.globalExposure??0,n.imageProcessing.colorCurves.globalSaturation=t.globalSaturation??0,n.imageProcessing.colorCurves.highlightsHue=t.highlightsHue??30,n.imageProcessing.colorCurves.highlightsDensity=t.highlightsDensity??0,n.imageProcessing.colorCurves.highlightsExposure=t.highlightsExposure??0,n.imageProcessing.colorCurves.highlightsSaturation=t.highlightsSaturation??0,n.imageProcessing.colorCurves.midtonesHue=t.midtonesHue??30,n.imageProcessing.colorCurves.midtonesDensity=t.midtonesDensity??0,n.imageProcessing.colorCurves.midtonesExposure=t.midtonesExposure??0,n.imageProcessing.colorCurves.midtonesSaturation=t.midtonesSaturation??0,n.imageProcessing.colorCurves.shadowsHue=t.shadowsHue??30,n.imageProcessing.colorCurves.shadowsDensity=t.shadowsDensity??0,n.imageProcessing.colorCurves.shadowsExposure=t.shadowsExposure??0,n.imageProcessing.colorCurves.shadowsSaturation=t.shadowsSaturation??0)}return n.bloomEnabled=t.bloomEnabled,n.bloomThreshold=t.bloomThreshold,n.bloomWeight=t.bloomWeight,n.bloomScale=t.bloomScale,n.bloomKernel=t.bloomKernel,n.sharpenEnabled=t.sharpenEnabled,n.sharpen.edgeAmount=t.sharpenEdgeAmount,n.sharpen.colorAmount=t.sharpenColorAmount,n.grainEnabled=t.grainEnabled,n.grain.intensity=t.grainIntensity,n.grain.animated=t.grainAnimated,n.depthOfFieldEnabled=t.depthOfFieldEnabled,n.depthOfFieldBlurLevel=t.depthOfFieldBlurLevel,n.depthOfField.lensSize=t.lensSize,n.depthOfField.fStop=t.fStop,n.depthOfField.focusDistance=t.focusDistance,n.depthOfField.focalLength=t.focalLength,n.chromaticAberrationEnabled=t.chromaticAberrationEnabled??!1,n.chromaticAberration.aberrationAmount=t.aberrationAmount??10,n.chromaticAberration.radialIntensity=t.radialIntensity??1,n.chromaticAberration.direction=Pe.Vector2.FromArray(t.direction??[0,0]),n.chromaticAberration.centerPosition=Pe.Vector2.FromArray(t.centerPosition??[0,0]),n.glowLayerEnabled=t.glowLayerEnabled??!1,n.glowLayer&&(n.glowLayer.intensity=t.glowLayerIntensity??1,n.glowLayer.blurKernelSize=t.glowLayerBlurKernelSize??32),n}i(Ie,"parseDefaultRenderingPipeline");function tt(e,o){(Array.isArray(o)?o:[]).forEach(r=>{let n=e.getCameraById(r.cameraId);n&&(r.ssao2RenderingPipeline&&V.set(n,r.ssao2RenderingPipeline),r.vlsPostProcess&&w.set(n,r.vlsPostProcess),r.ssrRenderingPipeline&&N.set(n,r.ssrRenderingPipeline),r.motionBlurPostProcess&&L.set(n,r.motionBlurPostProcess),r.defaultRenderingPipeline&&B.set(n,r.defaultRenderingPipeline))})}i(tt,"applyRenderingConfigurations");function Ko(e){V.set(e,ge()),w.set(e,ae()),N.set(e,me()),L.set(e,he()),B.set(e,Ce())}i(Ko,"saveRenderingConfigurationForCamera");function nt(e,o){ue(),se(e.getScene()),ce(),ye(),be();let t=V.get(e);t&&fe(e.getScene(),e,t);let r=w.get(e);r&&le(e.getScene(),r);let n=N.get(e);n&&pe(e.getScene(),e,n);let l=L.get(e);l&&Se(e.getScene(),e,l);let s=B.get(e);s&&Ie(e.getScene(),e,s,o)}i(nt,"applyRenderingConfigurationForCamera");var rt=require("babylonjs"),ot=require("babylonjs");function xe(e){e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.renderListPredicate=r=>rt.Vector3.Distance(r.getAbsolutePosition(),o.getAbsolutePosition())<=o.range)})}i(xe,"configureShadowMapRenderListPredicate");async function Ae(e){e.executeWhenReady(()=>{e.lights.forEach(o=>{let t=o.getShadowGenerator()?.getShadowMap();t&&(t.refreshRate=o.metadata?.refreshRate??ot.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME)})})}i(Ae,"configureShadowMapRefreshRate");var Te=require("babylonjs"),Z=require("babylonjs"),kt=(0,Z.GetParser)(Te.SceneComponentConstants.NAME_AUDIO);(0,Z.AddParser)(Te.SceneComponentConstants.NAME_AUDIO,(e,o,t,r)=>{kt?.(e,o,t,r),e.sounds?.forEach(n=>{let l=t.sounds?.find(s=>s.name===n.name);l&&(l.id=n.id,l.uniqueId=n.uniqueId)})});function D(e){let o=1;for(;o<=e;)o<<=1;return o>>1}i(D,"getPowerOfTwoUntil");var Ee=require("babylonjs"),q=Ee.SerializationHelper._TextureParser;Ee.SerializationHelper._TextureParser=(e,o,t)=>{if(o.loadingQuality==="high"||!e.metadata?.baseSize)return q(e,o,t);let r=e.metadata.baseSize.width,n=e.metadata.baseSize.height,l=r===D(r)||n===D(n),s="";switch(o.loadingQuality){case"medium":let h=r*.66>>0,f=n*.66>>0;l&&(h=D(h),f=D(f)),s=`_${h}_${f}`;break;case"low":let u=r*.33>>0,g=n*.33>>0;l&&(u=D(u),g=D(g)),s=`_${u}_${g}`;break}let c=e.name;if(!c||!s)return q(e,o,t);let m=c.split("/"),y=m.pop();if(!y)return q(e,o,t);let b=y.split(".").pop(),M=`${y.replace(`.${b}`,"")}${s}.${b}`;return m.push(M),e.name=m.join("/"),q(e,o,t)};var it=require("babylonjs"),De=require("babylonjs"),st=require("babylonjs"),at=require("babylonjs");async function zt(e,o,t,r,n){t.loadingQuality=n?.quality??"high",await(0,st.AppendSceneAsync)(`${e}${o}`,t,{pluginExtension:".babylon",onProgress:i(s=>{let c=Math.min(s.loaded/s.total*.5);n?.onProgress?.(c)},"onProgress")}),at.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&t.meshes.forEach(s=>E(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===De.Constants.DELAYLOADSTATE_NONE&&(c.delayLoadState=De.Constants.DELAYLOADSTATE_LOADED)}),n?.onProgress?.(.5+s/l*.5)}n?.onProgress?.(1),xe(t),Ae(t),t.metadata?.rendering&&(tt(t,t.metadata.rendering),t.activeCamera&&nt(t.activeCamera,e)),t.metadata?.physicsGravity&&t.getPhysicsEngine()?.setGravity(it.Vector3.FromArray(t.metadata?.physicsGravity)),R(t,t,r,e),t.transformNodes.forEach(s=>{R(t,s,r,e)}),t.meshes.forEach(s=>{Ge(s),R(t,s,r,e)}),t.lights.forEach(s=>{R(t,s,r,e)}),t.cameras.forEach(s=>{R(t,s,r,e)})}i(zt,"loadScene");var lt=require("babylonjs");async function Yt(e,o,t){let n=await(await fetch(e+o)).json(),s=lt.Tools.Instantiate(n.customType).Parse(n,t,e);return s.id=n.id,s.uniqueId=n.uniqueId,s}i(Yt,"loadMaterialFromFile");function jt(e){return Promise.all(e.materials.map(async o=>{let t=o.getBindedMeshes();await Promise.all(t.map(async r=>{_(r)||await o.forceCompilationAsync(r,{clipPlane:!!e.clipPlane,useInstances:r.hasInstances})}))}))}i(jt,"forceCompileAllSceneMaterials");function Ht(e){e.setTextureFormatToUse(["-dxt.ktx","-astc.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"])}i(Ht,"configureEngineToUseCompressedTextures");var A=require("babylonjs");function z(e){if(!isNaN(parseFloat(e))&&isFinite(e))return A.Animation.ANIMATIONTYPE_FLOAT;switch(e?.getClassName?.()){case"Vector2":return A.Animation.ANIMATIONTYPE_VECTOR2;case"Vector3":return A.Animation.ANIMATIONTYPE_VECTOR3;case"Quaternion":return A.Animation.ANIMATIONTYPE_QUATERNION;case"Color3":return A.Animation.ANIMATIONTYPE_COLOR3;case"Color4":return A.Animation.ANIMATIONTYPE_COLOR4;case"Size":return A.Animation.ANIMATIONTYPE_SIZE;case"Matrix":return A.Animation.ANIMATIONTYPE_MATRIX}return null}i(z,"getAnimationTypeForObject");function Wt(e){return function(o,t){let r=o.constructor;r._NodesFromScene??=[],r._NodesFromScene.push({propertyKey:t,nodeName:e})}}i(Wt,"nodeFromScene");function Ut(e,o=!1){return function(t,r){let n=t.constructor;n._NodesFromDescendants??=[],n._NodesFromDescendants.push({propertyKey:r,nodeName:e,directDescendantsOnly:o})}}i(Ut,"nodeFromDescendants");function $t(e){return function(o,t){let r=o.constructor;r._AnimationGroups??=[],r._AnimationGroups.push({animationGroupName:e,propertyKey:t})}}i($t,"animationGroupFromScene");function Qt(e,o){return function(t,r){let n=t.constructor;n._GuiFromAsset??=[],n._GuiFromAsset.push({propertyKey:r,pathInAssets:e,onGuiCreated:o})}}i(Qt,"guiFromAsset");function Zt(e){return function(o,t){let r=o.constructor;r._SoundsFromScene??=[],r._SoundsFromScene.push({propertyKey:t,soundName:e})}}i(Zt,"soundFromScene");function qt(e,o=!1){return function(t,r){let n=t.constructor;n._ParticleSystemsFromScene??=[],n._ParticleSystemsFromScene.push({propertyKey:r,particleSystemName:e,directDescendantsOnly:o})}}i(qt,"particleSystemFromScene");function Xt(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"boolean"}})}}i(Xt,"visibleAsBoolean");function Jt(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"string"}})}}i(Jt,"visibleAsString");function en(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"number"}})}}i(en,"visibleAsNumber");function tn(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"vector2"}})}}i(tn,"visibleAsVector2");function nn(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"vector3"}})}}i(nn,"visibleAsVector3");function rn(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"color3"}})}}i(rn,"visibleAsColor3");function on(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"color4"}})}}i(on,"visibleAsColor4");function sn(e,o,t){return function(r,n){let l=r.constructor;l._VisibleInInspector??=[],l._VisibleInInspector.push({label:o,propertyKey:n,configuration:{...t,entityType:e,type:"entity"}})}}i(sn,"visibleAsEntity");function an(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"texture"}})}}i(an,"visibleAsTexture");function ln(e,o){return function(t,r){let n=t.constructor;n._VisibleInInspector??=[],n._VisibleInInspector.push({label:e,propertyKey:r,configuration:{...o,type:"keymap"}})}}i(ln,"visibleAsKeyMap");var X=require("babylonjs");function ct(e,o){let t;switch(e){case X.Animation.ANIMATIONTYPE_FLOAT:t=o.value;break;default:t=o.value.clone();break}return{value:t,frame:o.frame,interpolation:o.interpolation,inTangent:e===X.Animation.ANIMATIONTYPE_FLOAT?o.inTangent:o.inTangent?.clone(),outTangent:e===X.Animation.ANIMATIONTYPE_FLOAT?o.outTangent:o.outTangent?.clone()}}i(ct,"cloneKey");function J(e,o){let t=o.split("."),r=e;for(let n=0;n<t.length;++n)r=r[t[n]];return r}i(J,"getPropertyValue");var v=require("babylonjs"),ee=require("babylonjs"),I=require("babylonjs");function cn(e,o){return{name:e.name,framesPerSecond:e.framesPerSecond,outputFramesPerSecond:e.outputFramesPerSecond,tracks:e.tracks.map(t=>{let r=null,n=null;if(t.node?(r=o.getNodeById(t.node),r||(r=o.particleSystems?.find(s=>s.id===t.node)??null)):t.defaultRenderingPipeline&&(r=k()),t.propertyPath){let s=J(r,t.propertyPath);n=z(s)}let l=null;return t.sound&&(l=U(t.sound,o)),{node:r,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:I.Vector3.FromArray(s.data.force),contactPoint:I.Vector3.FromArray(s.data.contactPoint)};break}return c}),keyFrameAnimations:r&&n!==null&&t.keyFrameAnimations?.map(s=>{let c=s.type==="key"?s:null;if(c)return{...c,value:C(c.value,n),inTangent:C(c.inTangent,n),outTangent:C(c.outTangent,n)};let m=s.type==="cut"?s:null;if(m)return{...m,key1:{...m.key1,value:C(m.key1.value,n),inTangent:C(m.key1.inTangent,n),outTangent:C(m.key1.outTangent,n)},key2:{...m.key2,value:C(m.key2.value,n),inTangent:C(m.key2.inTangent,n),outTangent:C(m.key2.outTangent,n)}};throw new Error(`Unknown key frame type: ${s.type}`)})}})}}i(cn,"parseCinematic");function C(e,o){if(e===null)return null;if(e!==void 0)switch(o){case v.Animation.ANIMATIONTYPE_FLOAT:return e;case v.Animation.ANIMATIONTYPE_VECTOR2:return I.Vector2.FromArray(e);case v.Animation.ANIMATIONTYPE_VECTOR3:return I.Vector3.FromArray(e);case v.Animation.ANIMATIONTYPE_QUATERNION:return I.Quaternion.FromArray(e);case v.Animation.ANIMATIONTYPE_COLOR3:return ee.Color3.FromArray(e);case v.Animation.ANIMATIONTYPE_COLOR4:return ee.Color4.FromArray(e);case v.Animation.ANIMATIONTYPE_MATRIX:return I.Matrix.FromArray(e)}}i(C,"parseCinematicKeyValue");function mt(e){e.node?.setEnabled(e.value)}i(mt,"handleSetEnabledEvent");var ve=require("babylonjs"),pt=ve.Vector3.Zero();function ut(e,o){let t=o.mesh?[o.mesh]:e.meshes.filter(r=>r.physicsAggregate);o.radius&&(t=t.filter(r=>{let n=r.getBoundingInfo().boundingBox.centerWorld;return ve.Vector3.Distance(n,o.contactPoint)<=o.radius})),t.forEach(r=>{if(r.physicsAggregate?.body){let n=o.contactPoint.subtract(r.getBoundingInfo().boundingBox.centerWorld);n.multiplyInPlace(o.force),r.physicsAggregate.body.setLinearVelocity(pt),r.physicsAggregate.body.setAngularVelocity(pt),r.physicsAggregate.body.applyImpulse(n.negateInPlace(),o.contactPoint)}})}i(ut,"handleApplyImpulseEvent");var gt=require("babylonjs"),T=require("babylonjs"),Y=require("babylonjs"),ft=require("babylonjs");function mn(e,o,t){let r=new ft.AnimationGroup(e.name,o);return e.tracks.forEach(n=>{let l=n.animationGroup;l&&n.animationGroups?.forEach(h=>{l.targetedAnimations.forEach(f=>{let u=null;e:{let x=r.targetedAnimations.filter(j=>j.target===f.target);if(x.length){let j=x.find(dt=>dt.animation.targetProperty===f.animation.targetProperty);if(j){u=j.animation;break e}}u=f.animation.clone(),u.setKeys([]),u.name=gt.Tools.RandomId(),u.framePerSecond=e.framesPerSecond}let g=u.getKeys(),F=f.animation.getKeys(),te=h.speed,Re=e.framesPerSecond/f.animation.framePerSecond/te;F.forEach(x=>{x.frame>=h.startFrame&&x.frame<=h.endFrame&&g.push({...ct(f.animation.dataType,x),frame:h.frame+x.frame*Re})}),u.setKeys(g),r.addTargetedAnimation(u,f.target)})});let s=n.sound,c=s?.getAudioBuffer();if(!t?.ignoreSounds&&s&&c&&n.sounds?.length){let h={dummy:0},f=new T.Animation(s.name,"dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;n.sounds?.forEach(g=>{let F=g.endFrame-g.startFrame;u=Math.max(u,g.frame+F),f.addEvent(new Y.AnimationEvent(g.frame,te=>{let x=(te-g.frame+g.startFrame)/e.framesPerSecond;s.play(0,x)},!1)),f.addEvent(new Y.AnimationEvent(g.frame+F,()=>{s.stop()}))}),f.setKeys([{frame:0,value:0},{frame:u,value:u}]),r.addTargetedAnimation(f,h)}if(n.keyFrameEvents){let h={dummy:0},f=new T.Animation("events","dummy",60,T.Animation.ANIMATIONTYPE_FLOAT,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),u=0;n.keyFrameEvents?.forEach(g=>{u=Math.max(u,g.frame),f.addEvent(new Y.AnimationEvent(g.frame,()=>{switch(g.data?.type){case"set-enabled":mt(g.data);break;case"apply-impulse":ut(o,g.data);break}}))}),f.setKeys([{frame:0,value:0},{frame:u,value:u}]),r.addTargetedAnimation(f,h)}let m=n.defaultRenderingPipeline?k():n.node;if(!m||!n.propertyPath||!n.keyFrameAnimations)return;let y=J(m,n.propertyPath),b=z(y);if(b===null)return;let O=new T.Animation(n.propertyPath,n.propertyPath,60,b,T.Animation.ANIMATIONLOOPMODE_CYCLE,!1),M=[];n.keyFrameAnimations?.forEach(h=>{let f=h.type==="key"?h:null;if(f)return M.push(f);let u=h.type==="cut"?h:null;u&&(M.push(u.key1),M.push(u.key2),W(m)&&n.propertyPath==="position"&&O.addEvent(new Y.AnimationEvent(u.key1.frame,()=>{let g=de();if(!g)return;let F=g.motionStrength;g.motionStrength=0,requestAnimationFrame(()=>{g.motionStrength=F})})))}),O.setKeys(M),r.addTargetedAnimation(O,m)}),r.normalize(),r}i(mn,"generateCinematicAnimationGroup");function pn(e){return e.type==="key"}i(pn,"isCinematicKey");function un(e){return e.type==="cut"}i(un,"isCinematicKeyCut");function gn(e){return e.type==="event"}i(gn,"isCinematicKeyEvent");function fn(e){return e.type==="group"}i(fn,"isCinematicGroup");function dn(e){return e.type==="sound"}i(dn,"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,parseCinematic,parseCinematicKeyValue,parseDefaultRenderingPipeline,parseMotionBlurPostProcess,parseSSAO2RenderingPipeline,parseSSRRenderingPipeline,parseVLSPostProcess,particleSystemFromScene,registerScriptInstance,serializeDefaultRenderingPipeline,serializeMotionBlurPostProcess,serializeSSAO2RenderingPipeline,serializeSSRRenderingPipeline,serializeVLSPostProcess,setDefaultRenderingPipelineRef,setMotionBlurPostProcessRef,setSSAO2RenderingPipelineRef,setSSRRenderingPipelineRef,setVLSPostProcessRef,soundFromScene,ssaoRenderingPipelineCameraConfigurations,ssrRenderingPipelineCameraConfigurations,visibleAsBoolean,visibleAsColor3,visibleAsColor4,visibleAsEntity,visibleAsKeyMap,visibleAsNumber,visibleAsString,visibleAsTexture,visibleAsVector2,visibleAsVector3,vlsPostProcessCameraConfigurations});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Vector3 } from "@babylonjs/core/Maths/math.vector";
|
|
2
2
|
const zeroVector = Vector3.Zero();
|
|
3
3
|
export function handleApplyImpulseEvent(scene, config) {
|
|
4
|
-
let meshes = config.mesh
|
|
5
|
-
? [config.mesh]
|
|
6
|
-
: scene.meshes.filter((m) => m.physicsAggregate);
|
|
4
|
+
let meshes = config.mesh ? [config.mesh] : scene.meshes.filter((m) => m.physicsAggregate);
|
|
7
5
|
if (config.radius) {
|
|
8
6
|
meshes = meshes.filter((mesh) => {
|
|
9
7
|
const centerWorld = mesh.getBoundingInfo().boundingBox.centerWorld;
|
|
@@ -41,7 +41,7 @@ export function generateCinematicAnimationGroup(cinematic, scene, options) {
|
|
|
41
41
|
const keys = animation.getKeys();
|
|
42
42
|
const sourceKeys = targetedAnimation.animation.getKeys();
|
|
43
43
|
const speed = configuration.speed;
|
|
44
|
-
const normalizedFps =
|
|
44
|
+
const normalizedFps = cinematic.framesPerSecond / targetedAnimation.animation.framePerSecond / speed;
|
|
45
45
|
sourceKeys.forEach((k) => {
|
|
46
46
|
if (k.frame >= configuration.startFrame && k.frame <= configuration.endFrame) {
|
|
47
47
|
keys.push({
|
|
@@ -67,36 +67,38 @@ export function parseCinematic(data, scene) {
|
|
|
67
67
|
}
|
|
68
68
|
return result;
|
|
69
69
|
}),
|
|
70
|
-
keyFrameAnimations: node &&
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
...animationKeyCut
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
70
|
+
keyFrameAnimations: node &&
|
|
71
|
+
animationType !== null &&
|
|
72
|
+
track.keyFrameAnimations?.map((keyFrame) => {
|
|
73
|
+
const animationKey = keyFrame.type === "key" ? keyFrame : null;
|
|
74
|
+
if (animationKey) {
|
|
75
|
+
return {
|
|
76
|
+
...animationKey,
|
|
77
|
+
value: parseCinematicKeyValue(animationKey.value, animationType),
|
|
78
|
+
inTangent: parseCinematicKeyValue(animationKey.inTangent, animationType),
|
|
79
|
+
outTangent: parseCinematicKeyValue(animationKey.outTangent, animationType),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const animationKeyCut = keyFrame.type === "cut" ? keyFrame : null;
|
|
83
|
+
if (animationKeyCut) {
|
|
84
|
+
return {
|
|
85
|
+
...animationKeyCut,
|
|
86
|
+
key1: {
|
|
87
|
+
...animationKeyCut.key1,
|
|
88
|
+
value: parseCinematicKeyValue(animationKeyCut.key1.value, animationType),
|
|
89
|
+
inTangent: parseCinematicKeyValue(animationKeyCut.key1.inTangent, animationType),
|
|
90
|
+
outTangent: parseCinematicKeyValue(animationKeyCut.key1.outTangent, animationType),
|
|
91
|
+
},
|
|
92
|
+
key2: {
|
|
93
|
+
...animationKeyCut.key2,
|
|
94
|
+
value: parseCinematicKeyValue(animationKeyCut.key2.value, animationType),
|
|
95
|
+
inTangent: parseCinematicKeyValue(animationKeyCut.key2.inTangent, animationType),
|
|
96
|
+
outTangent: parseCinematicKeyValue(animationKeyCut.key2.outTangent, animationType),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
throw new Error(`Unknown key frame type: ${keyFrame.type}`);
|
|
101
|
+
}),
|
|
100
102
|
};
|
|
101
103
|
}),
|
|
102
104
|
};
|
|
@@ -115,13 +117,20 @@ export function parseCinematicKeyValue(value, type) {
|
|
|
115
117
|
return undefined;
|
|
116
118
|
}
|
|
117
119
|
switch (type) {
|
|
118
|
-
case Animation.ANIMATIONTYPE_FLOAT:
|
|
119
|
-
|
|
120
|
-
case Animation.
|
|
121
|
-
|
|
122
|
-
case Animation.
|
|
123
|
-
|
|
124
|
-
case Animation.
|
|
120
|
+
case Animation.ANIMATIONTYPE_FLOAT:
|
|
121
|
+
return value;
|
|
122
|
+
case Animation.ANIMATIONTYPE_VECTOR2:
|
|
123
|
+
return Vector2.FromArray(value);
|
|
124
|
+
case Animation.ANIMATIONTYPE_VECTOR3:
|
|
125
|
+
return Vector3.FromArray(value);
|
|
126
|
+
case Animation.ANIMATIONTYPE_QUATERNION:
|
|
127
|
+
return Quaternion.FromArray(value);
|
|
128
|
+
case Animation.ANIMATIONTYPE_COLOR3:
|
|
129
|
+
return Color3.FromArray(value);
|
|
130
|
+
case Animation.ANIMATIONTYPE_COLOR4:
|
|
131
|
+
return Color4.FromArray(value);
|
|
132
|
+
case Animation.ANIMATIONTYPE_MATRIX:
|
|
133
|
+
return Matrix.FromArray(value);
|
|
125
134
|
}
|
|
126
135
|
}
|
|
127
136
|
//# sourceMappingURL=parse.js.map
|
|
@@ -25,7 +25,7 @@ export function cloneKey(dataType, key) {
|
|
|
25
25
|
* @example getPropertyValue(scene, "ambientColor.r");
|
|
26
26
|
*/
|
|
27
27
|
export function getPropertyValue(object, property) {
|
|
28
|
-
const parts = property.split(
|
|
28
|
+
const parts = property.split(".");
|
|
29
29
|
let value = object;
|
|
30
30
|
for (let i = 0; i < parts.length; ++i) {
|
|
31
31
|
value = value[parts[i]];
|
|
@@ -45,7 +45,10 @@ export function applyDecorators(scene, object, script, instance, rootUrl) {
|
|
|
45
45
|
// @fromParticleSystems
|
|
46
46
|
ctor._ParticleSystemsFromScene?.forEach((params) => {
|
|
47
47
|
const particleSystem = scene.particleSystems?.find((particleSystem) => {
|
|
48
|
-
|
|
48
|
+
if (particleSystem.name !== params.particleSystemName) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return params.directDescendantsOnly ? particleSystem.emitter === object : particleSystem;
|
|
49
52
|
});
|
|
50
53
|
instance[params.propertyKey.toString()] = particleSystem;
|
|
51
54
|
});
|
|
@@ -53,8 +56,7 @@ export function applyDecorators(scene, object, script, instance, rootUrl) {
|
|
|
53
56
|
ctor._VisibleInInspector?.forEach((params) => {
|
|
54
57
|
const propertyKey = params.propertyKey.toString();
|
|
55
58
|
const attachedScripts = script.values;
|
|
56
|
-
if (attachedScripts.hasOwnProperty(propertyKey) &&
|
|
57
|
-
attachedScripts[propertyKey].hasOwnProperty("value")) {
|
|
59
|
+
if (attachedScripts.hasOwnProperty(propertyKey) && attachedScripts[propertyKey].hasOwnProperty("value")) {
|
|
58
60
|
const value = attachedScripts[propertyKey].value;
|
|
59
61
|
switch (params.configuration.type) {
|
|
60
62
|
case "number":
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* from the scene and assigned to the property. Node link cant' be used in constructor.
|
|
5
5
|
* This can be used only by scripts using Classes.
|
|
6
6
|
* @param particleSystemName defines the name of the sound to retrieve in scene.
|
|
7
|
+
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also global particle systems will be considered.
|
|
7
8
|
*/
|
|
8
|
-
export function particleSystemFromScene(particleSystemName) {
|
|
9
|
+
export function particleSystemFromScene(particleSystemName, directDescendantsOnly = false) {
|
|
9
10
|
return function (target, propertyKey) {
|
|
10
11
|
const ctor = target.constructor;
|
|
11
12
|
ctor._ParticleSystemsFromScene ??= [];
|
|
12
|
-
ctor._ParticleSystemsFromScene.push({ propertyKey, particleSystemName });
|
|
13
|
+
ctor._ParticleSystemsFromScene.push({ propertyKey, particleSystemName, directDescendantsOnly });
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=particle-systems.js.map
|
|
@@ -8,13 +8,20 @@ export function getAnimationTypeForObject(effectiveProperty) {
|
|
|
8
8
|
return Animation.ANIMATIONTYPE_FLOAT;
|
|
9
9
|
}
|
|
10
10
|
switch (effectiveProperty?.getClassName?.()) {
|
|
11
|
-
case "Vector2":
|
|
12
|
-
|
|
13
|
-
case "
|
|
14
|
-
|
|
15
|
-
case "
|
|
16
|
-
|
|
17
|
-
case "
|
|
11
|
+
case "Vector2":
|
|
12
|
+
return Animation.ANIMATIONTYPE_VECTOR2;
|
|
13
|
+
case "Vector3":
|
|
14
|
+
return Animation.ANIMATIONTYPE_VECTOR3;
|
|
15
|
+
case "Quaternion":
|
|
16
|
+
return Animation.ANIMATIONTYPE_QUATERNION;
|
|
17
|
+
case "Color3":
|
|
18
|
+
return Animation.ANIMATIONTYPE_COLOR3;
|
|
19
|
+
case "Color4":
|
|
20
|
+
return Animation.ANIMATIONTYPE_COLOR4;
|
|
21
|
+
case "Size":
|
|
22
|
+
return Animation.ANIMATIONTYPE_SIZE;
|
|
23
|
+
case "Matrix":
|
|
24
|
+
return Animation.ANIMATIONTYPE_MATRIX;
|
|
18
25
|
}
|
|
19
26
|
return null;
|
|
20
27
|
}
|
|
@@ -5,12 +5,6 @@
|
|
|
5
5
|
* @see `@babylonjs/core/Engines/Extensions/engine.textureSelector.d.ts` for more information.
|
|
6
6
|
*/
|
|
7
7
|
export function configureEngineToUseCompressedTextures(engine) {
|
|
8
|
-
engine.setTextureFormatToUse([
|
|
9
|
-
"-dxt.ktx",
|
|
10
|
-
"-astc.ktx",
|
|
11
|
-
"-pvrtc.ktx",
|
|
12
|
-
"-etc1.ktx",
|
|
13
|
-
"-etc2.ktx",
|
|
14
|
-
]);
|
|
8
|
+
engine.setTextureFormatToUse(["-dxt.ktx", "-astc.ktx", "-pvrtc.ktx", "-etc1.ktx", "-etc2.ktx"]);
|
|
15
9
|
}
|
|
16
10
|
//# sourceMappingURL=texture.js.map
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
* from the scene and assigned to the property. Node link cant' be used in constructor.
|
|
5
5
|
* This can be used only by scripts using Classes.
|
|
6
6
|
* @param particleSystemName defines the name of the sound to retrieve in scene.
|
|
7
|
+
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also global particle systems will be considered.
|
|
7
8
|
*/
|
|
8
|
-
export declare function particleSystemFromScene(particleSystemName: string): (target: any, propertyKey: string | Symbol) => void;
|
|
9
|
+
export declare function particleSystemFromScene(particleSystemName: string, directDescendantsOnly?: boolean): (target: any, propertyKey: string | Symbol) => void;
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "babylonjs-editor-tools",
|
|
3
|
+
"version": "5.1.3",
|
|
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
|
+
"productName": "Babylon.js Editor Tools",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p . && node esbuild.mjs",
|
|
8
|
+
"watch": "concurrently \"tsc -p . --watch\" \"node esbuild.mjs --watch\"",
|
|
9
|
+
"test": "jest build/test/*",
|
|
10
|
+
"coverage": "jest build/test/* --coverage"
|
|
11
|
+
},
|
|
12
|
+
"main": "build/index.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./declaration/src/index.d.ts",
|
|
16
|
+
"import": "./build/src/index.js",
|
|
17
|
+
"require": "./build/index.node.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"typings": "declaration/src/index.d.ts",
|
|
21
|
+
"license": "(Apache-2.0)",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@babel/core": "^7.26.10",
|
|
24
|
+
"@babel/preset-env": "^7.26.9",
|
|
25
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
26
|
+
"@babylonjs/core": "8.26.1",
|
|
27
|
+
"@babylonjs/gui": "8.26.1",
|
|
28
|
+
"@types/jest": "^29.5.14",
|
|
29
|
+
"babel-jest": "^29.7.0",
|
|
30
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
31
|
+
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
32
|
+
"esbuild": "0.25.5",
|
|
33
|
+
"jest": "^29.7.0",
|
|
34
|
+
"typescript": "5.8.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {}
|
|
37
37
|
}
|